On 2013/8/12 8:03, Karim Yaghmour wrote: > > Wondering if there's a way for reading perf counters in the kernel. I'd > like to read/record perf counters on ftrace function tracing > entries/exits to provide a rundown of the value of various counters on > function call boundaries. > > [ Steven: apologies for sending you a duplicate here of what I somewhat > already sent privately. ] >
If you want to base on ftrace, below two approach maybe take into use: - register_ftrace_function/unregister_ftrace_function - perf_event_create_kernel_counter (function event id is 1) the first one is simplest, IMO. You need to write your own kernel module to use these approach. jovi. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/