gpio.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM gpio
  3. #ifndef CONFIG_TRACING_EVENTS_GPIO
  4. #define NOTRACE
  5. #endif
  6. #if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ)
  7. #define _TRACE_GPIO_H
  8. #include <linux/tracepoint.h>
  9. TRACE_EVENT(gpio_direction,
  10. TP_PROTO(unsigned gpio, int in, int err),
  11. TP_ARGS(gpio, in, err),
  12. TP_STRUCT__entry(
  13. __field(unsigned, gpio)
  14. __field(int, in)
  15. __field(int, err)
  16. ),
  17. TP_fast_assign(
  18. __entry->gpio = gpio;
  19. __entry->in = in;
  20. __entry->err = err;
  21. ),
  22. TP_printk("%u %3s (%d)", __entry->gpio,
  23. __entry->in ? "in" : "out", __entry->err)
  24. );
  25. TRACE_EVENT(gpio_value,
  26. TP_PROTO(unsigned gpio, int get, int value),
  27. TP_ARGS(gpio, get, value),
  28. TP_STRUCT__entry(
  29. __field(unsigned, gpio)
  30. __field(int, get)
  31. __field(int, value)
  32. ),
  33. TP_fast_assign(
  34. __entry->gpio = gpio;
  35. __entry->get = get;
  36. __entry->value = value;
  37. ),
  38. TP_printk("%u %3s %d", __entry->gpio,
  39. __entry->get ? "get" : "set", __entry->value)
  40. );
  41. #endif /* if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) */
  42. /* This part must be outside protection */
  43. #include <trace/define_trace.h>