Cannot append perf to file

I am using Ubuntu 18.04.1 LTS and I have perf version 4.15.18. I trying to redirect and append the output of the following command of perf to a file but doesn't seem to work.

perf stat -a -e power/energy-cores/,power/energy-gpu/,power/energy-pkg/, power/energy-ram sleep 1 >> power.log

Upvotes: 0

Views: 254

Answers (1)

Barmar
Barmar

Reputation: 782529

perf stat writes to stderr by default, you're redirecting stdout.

Use the --output and --append options to specify where the results should be written.

perf stat -a --output power.log --append -e power/energy-cores/,power/energy-gpu/,power/energy-pkg/, power/energy-ram sleep 1

Upvotes: 1

Related Questions