On Tue, 26 Mar 2013, kernel kernel wrote: > Is it possible to use perf to record the performance counters of > specific lines of code instead of the entire program?
If you want exact counts (i.e., these three lines of code had exactly 20 branch misses) you'll need to instrument your code using a library like PAPI, or else insert raw perf_event calls yourself before and after the lines of interest (see the example at the end of the perf_event_open manpage). Doing self-monitoring like this introduces a certain amount of overhead into your program and measurements. Vince -- To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html