I am measuring the CPU usage of a running server process.

I use a shell to run perf stat -p <pid> & to attach to the process, run some commands, and kill -INT the perf to get the result.

The perf stat will output its result when being interrupted. But how do I capture the output from kill -INT into a bash variable?

Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.