Advertisement
vanandel

LTTng adaptation db2k.h

Aug 4th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.88 KB | None | 0 0
  1. /* subsystem name is "db2k" */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM db2k
  4.  
  5. #if !defined(_TRACE_DB2K_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define _TRACE_DB2K_H
  7. /* this is the "adaptation layer" for our custom tracing */
  8.  
  9. #include <linux/tracepoint.h>
  10.  
  11. LTTNG_TRACEPOINT_EVENT(
  12.     /* "db2k" is the subsystem name, "hello" is the event name */
  13.     db2k_hello,
  14.  
  15.     /* tracepoint function prototype */
  16.     TP_PROTO(int foo, const char* bar),
  17.  
  18.     /* arguments for this tracepoint */
  19.     TP_ARGS(foo, bar),
  20.  
  21.    TP_STRUCT__entry(
  22.         __field(int, my_int)
  23.         __array(char, msg, 32)
  24.     ) ,
  25.  
  26.     TP_fast_assign(
  27.       tp_assign(my_int, foo)
  28.       tp_memcpy(msg, bar, 32)
  29.     ),
  30.  
  31.     TP_printk("bar = %s, foo=%d",
  32.         __entry->msg,
  33.         __entry->my_int)
  34. )
  35.  
  36. #endif
  37. /* this part must be outside protection */
  38. #include "../../../probes/define_trace.h"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement