RHEL7 ftrace events

Posted on

I'm running RHEL7.1, 3.10.0-229.el7.x86_64 and using trace-cmd-2.2.1-6.el7.x86_64 ...

I have a tiny kernel module that is attempting to record some information to the kernel trace buffer. There are really just a couple interesting lines ...
printk(KERN_INFO "kotrace tracing %d bytes\n", size);
trace_kotrace_print(0);
trace_printk("kotrace hello\n");

I see the simple printk, and the canned trace_printk() but seem to have something wrong with the custom trace point between these 2. My trace point is really nothing more than another print statement (not the end product) but I don't see it getting into the ftrace buffer. This worked fine in RHEL6 but not in RHEL7. I've attached the files. It runs like this ...
make
insmod kotrace.ko
trace-cmd start -e kotrace
cat /sys/kernel/debug/tracing/set_event # just to verify
cat /sys/kernel/debug/tracing/trace_pipe # hang another window waiting
echo hello > /sys/kotrace/trace_data
# I expect something like this at the trace pipe: ksh-6523 [002] 2499186.104234: kotrace: 6

The trace-cmd RPM and event support has a few interface changes since RHEL6 and some reorganization but looks much the same as far as I can tell. The TRACE_EVENT macros pretty much match those that ship with the kernel source. Is there something new? Anybody have a suggestion?

It seems to have something to do with the tracepoint.h __DECLARE_TRACE macro expansion which now includes a query of "static_key_false()" which appears to be "noop"ing the tracepoint.

Attachments

Responses