Advertisement
vanandel

"mainline" db2k.h

Aug 4th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. /* subsystem name is "db2k" */
  2. /* this is the "Mainline" version */
  3. #undef TRACE_SYSTEM
  4. #define TRACE_SYSTEM db2k
  5.  
  6. #if !defined(_TRACE_DB2K) || defined(TRACE_HEADER_MULTI_READ)
  7. #define _TRACE_DB2K_H
  8.  
  9. #include <linux/tracepoint.h>
  10.  
  11. TRACE_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, TASK_COMM_LEN)
  24.     ) ,
  25.  
  26.     TP_fast_assign(
  27.       __entry->my_int =  foo;
  28.       memcpy(__entry->msg, bar, TASK_COMM_LEN);
  29.     ),
  30.  
  31.     TP_printk("bar = %s, foo=%d", __entry->msg, __entry->my_int)
  32.      
  33. );
  34.  
  35. #endif
  36.  
  37. /* this part must be outside protection */
  38. #include <trace/define_trace.h>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement