0

I've been trying to profile my C++ application in Linux by following this article on perf record. My understanding is all I need to do is run perf record program [program_options], where program is the program executable and [program options] are the arguments I want to pass to the program. However, when I try to profile my application like this:

perf record ./csvJsonTransducer -enable-AVX-deletion test.csv testout.json

perf returns almost immediately with a report. It takes nearly 30 seconds to run./csvJsonTransducer -enable-AVX-deletion test.csv testout.json without perf, though, and I want perf to monitor my program for the entirety of its execution, not return immediately. Why is perf returning so quickly? How can I make it take the entire run of my program into account?

Adam
  • 8,752
  • 12
  • 54
  • 96

1 Answers1

0

Your commands seems ok. Try change the paranoid level at /proc/sys/kernel/perf_event_paranoid. Setting this parameter to -1 (as root) should solve permission issues:

echo "-1" > /proc/sys/kernel/perf_event_paranoid

You can also try to set the event that you want to monitor with perf record. The default event is cycles (if supported). Check man perf-list.

Try the command:

perf record -e cycles ./csvJsonTransducer -enable-AVX-deletion test.csv testout.json

to force the monitoring of cycles.

osgx
  • 90,338
  • 53
  • 357
  • 513
fusiled
  • 199
  • 2
  • 10