On Fri, 10 Jan 2014, Guru Prasad wrote: > Architecture: ARM > CPU: Cortex-A9 > > Hi, > My goal is to log PMU counters during context switches. > > Is there any documentation available in kernel on how to use perf > functions within the kernel itself? > I'm having a lot of difficulty setting up struct perf_event from > within the kernel.
someone's probably going to chime in and say you can do this from userspace using the right combination of ftrace events (or could you even do it setting overflow on the software context switch event with a frequency of 1?) In any case I wouldn't reccommend poking the PMU registers directly in a kernel that has perf_event running. Reading them is probably OK but writing them is just going to confuse things. Can you not set up and start the counters from userspace and then just have your printing code in the kernel print things (without touching the registers?) Vince Weaver vincent.wea...@maine.edu http://www.eece.maine.edu/~vweaver/ -- 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