Martin Ichilevici de Oliveira <martin.i.olive...@gmail.com> writes:
>
> /*******************/
> /* Gets called whenever my program generates a cache-miss */
> void my_func()
> {
>     unsigned long addr = get_ip_that_generated_event();
>     printf("A cache-miss occurred at IP: %x!\n", addr);
> }

This will almost certainly not work with any useful workload.
Just compare the overhead of the instrumentation with the total
run time. The program will be doing nothing but such interrupts
and perf will eventually throttle the interrupts. Besides
PEBS is not designed to catch every event anyways.

If you really want to instrument all cache misses you most likely
want to use some memory trace mechanism and a offline cache model
or a simulator.

-Andi

-- 
a...@linux.intel.com -- Speaking for myself only
--
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

Reply via email to