[ Added a bunch of people that use perf ;-) ]
+/*
+ * Allow modules to register additional trace routines
+ */
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_entry);
+EXPORT_TRACEPOINT_SYMBOL_GPL(irq_handler_exit);
+
Instead of just saying "Allow modules to register additional trace
routines", please explain what its used for. What are you measuring
externally? Just the timings of the interrupts?
How about "Allow for module (internal or external) to register trace function which
shows (or measures) interactions with user-space executables more directly. Knowing
when interrupts happen and how they can subtly impact user-space application timing
is important in some application."
I'm also curious to know why ftrace isn't good enough.
ftrace (if one considers ltt-ng) is probably capable of doing what my trace does
except that the timestamp is not TOD (Time Of Day) -- but probably/maybe could
be made to do so???
It's a matter of complexity or "start up cost" (or entry barrier).
I'm not the best at articulating all there is to TRACE succinctly, but lets
start with the fact that the user-space component of TRACE is basically just a header
file that defines the TRACE printf-like macro and handles the initialization which is
basically mmap-ing a file (as a trace buffer (with control structure)) and is,
for the most part, Unix OS independent.
Heh, that sounds like the perf interface. Have you thought about using
that instead?
Look at what PowerTop does: https://01.org/powertop
You can use the perf interface to mmap a memory buffer and read the
data in its raw format. To parse the data, you need to read the format
files in /sys/kernel/debug/tracing/events, but there's a library that
does that. Unfortunately, that library isn't in distros yet (we really
need to get that done). But you can just copy the code from the kernel
source tree from tools/lib/traceevents/ and use that as perf does (as
well as powertop does too).
The format files tells you how to get the data from the raw binary
format.
If you use the perf interface, you can have userspace tools do custom
things with the events as they happen. This may make your utility more
robust in the long run.
I'd be happy to help you understand how to use the traceevent library. I
don't use the perf interface, but you can get examples from the
PowerTop code.
[snip]
-- Steve