TRACE_EVENT without ARGS

From: Wolfgang Grandegger
Date: Fri Sep 21 2012 - 12:38:29 EST


Hello,

I would like to define trace events for functions without arguments,
e.g. my_yield(). But TRACE_EVENT requires at least one argument to be
defined and I also have not found an example in the kernel sources,
apart from:

$ cat include/trace/events/xen.h
...
TRACE_EVENT(xen_mmu_flush_tlb,
TP_PROTO(int x),
TP_ARGS(x),
TP_STRUCT__entry(__array(char, x, 0)),
TP_fast_assign((void)x),
TP_printk("%s", "")
);

It uses a dummy argument to work around the problem. Is that the
recommended way to handle such cases?

TIA,

Wolfgang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/