Hi Luke, On 04/20/2014 02:45 PM, Luke Gorrie wrote: > Howdy! > > Is it possible for a self-profiling program to receive a signal (e.g. > SIGPROF) driven by a chosen PMU event (e.g. cache-misses, etc)? > > I'm using a SIGITIMER-driven profiler (LuaJIT's one) and it would be > wonderfully convenient to be able to switch the event source while > keeping the signal-driven flow.
It is possible to receive a SIGIO after a specified number of events. You have to be careful to set the sample_period, watermark, and wakeup_events or wakeup_watermark attributes and set the asynchronous flag on the resulting file descriptor (always setting the owner may be required as well) for it to work. You can find an example in perf_event_tests [1]. 1. https://github.com/deater/perf_event_tests/blob/master/tests/overflow/wakeup_events_overflow.c Regards, Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation. -- To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
