adf_trace.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (C) 2013 Google, Inc.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #undef TRACE_SYSTEM
  15. #define TRACE_SYSTEM adf
  16. #if !defined(__VIDEO_ADF_ADF_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  17. #define __VIDEO_ADF_ADF_TRACE_H
  18. #include <linux/tracepoint.h>
  19. #include <video/adf.h>
  20. TRACE_EVENT(adf_event,
  21. TP_PROTO(struct adf_obj *obj, enum adf_event_type type),
  22. TP_ARGS(obj, type),
  23. TP_STRUCT__entry(
  24. __string(name, obj->name)
  25. __field(enum adf_event_type, type)
  26. __array(char, type_str, 32)
  27. ),
  28. TP_fast_assign(
  29. __assign_str(name, obj->name);
  30. __entry->type = type;
  31. strlcpy(__entry->type_str, adf_event_type_str(obj, type),
  32. sizeof(__entry->type_str));
  33. ),
  34. TP_printk("obj=%s type=%u (%s)",
  35. __get_str(name),
  36. __entry->type,
  37. __entry->type_str)
  38. );
  39. TRACE_EVENT(adf_event_enable,
  40. TP_PROTO(struct adf_obj *obj, enum adf_event_type type),
  41. TP_ARGS(obj, type),
  42. TP_STRUCT__entry(
  43. __string(name, obj->name)
  44. __field(enum adf_event_type, type)
  45. __array(char, type_str, 32)
  46. ),
  47. TP_fast_assign(
  48. __assign_str(name, obj->name);
  49. __entry->type = type;
  50. strlcpy(__entry->type_str, adf_event_type_str(obj, type),
  51. sizeof(__entry->type_str));
  52. ),
  53. TP_printk("obj=%s type=%u (%s)",
  54. __get_str(name),
  55. __entry->type,
  56. __entry->type_str)
  57. );
  58. TRACE_EVENT(adf_event_disable,
  59. TP_PROTO(struct adf_obj *obj, enum adf_event_type type),
  60. TP_ARGS(obj, type),
  61. TP_STRUCT__entry(
  62. __string(name, obj->name)
  63. __field(enum adf_event_type, type)
  64. __array(char, type_str, 32)
  65. ),
  66. TP_fast_assign(
  67. __assign_str(name, obj->name);
  68. __entry->type = type;
  69. strlcpy(__entry->type_str, adf_event_type_str(obj, type),
  70. sizeof(__entry->type_str));
  71. ),
  72. TP_printk("obj=%s type=%u (%s)",
  73. __get_str(name),
  74. __entry->type,
  75. __entry->type_str)
  76. );
  77. #endif /* __VIDEO_ADF_ADF_TRACE_H */
  78. #undef TRACE_INCLUDE_PATH
  79. #undef TRACE_INCLUDE_FILE
  80. #define TRACE_INCLUDE_PATH .
  81. #define TRACE_INCLUDE_FILE adf_trace
  82. #include <trace/define_trace.h>