bkl.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM bkl
  3. #if !defined(_TRACE_BKL_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_BKL_H
  5. #include <linux/tracepoint.h>
  6. TRACE_EVENT(lock_kernel,
  7. TP_PROTO(const char *func, const char *file, int line),
  8. TP_ARGS(func, file, line),
  9. TP_STRUCT__entry(
  10. __field( int, depth )
  11. __field_ext( const char *, func, FILTER_PTR_STRING )
  12. __field_ext( const char *, file, FILTER_PTR_STRING )
  13. __field( int, line )
  14. ),
  15. TP_fast_assign(
  16. /* We want to record the lock_depth after lock is acquired */
  17. __entry->depth = current->lock_depth + 1;
  18. __entry->func = func;
  19. __entry->file = file;
  20. __entry->line = line;
  21. ),
  22. TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth,
  23. __entry->file, __entry->line, __entry->func)
  24. );
  25. TRACE_EVENT(unlock_kernel,
  26. TP_PROTO(const char *func, const char *file, int line),
  27. TP_ARGS(func, file, line),
  28. TP_STRUCT__entry(
  29. __field(int, depth )
  30. __field(const char *, func )
  31. __field(const char *, file )
  32. __field(int, line )
  33. ),
  34. TP_fast_assign(
  35. __entry->depth = current->lock_depth;
  36. __entry->func = func;
  37. __entry->file = file;
  38. __entry->line = line;
  39. ),
  40. TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth,
  41. __entry->file, __entry->line, __entry->func)
  42. );
  43. #endif /* _TRACE_BKL_H */
  44. /* This part must be outside protection */
  45. #include <trace/define_trace.h>