power_cpu_migrate.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM power
  4. #if !defined(_TRACE_POWER_CPU_MIGRATE_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_POWER_CPU_MIGRATE_H
  6. #include <linux/tracepoint.h>
  7. #define __cpu_migrate_proto \
  8. TP_PROTO(u64 timestamp, \
  9. u32 cpu_hwid)
  10. #define __cpu_migrate_args \
  11. TP_ARGS(timestamp, \
  12. cpu_hwid)
  13. DECLARE_EVENT_CLASS(cpu_migrate,
  14. __cpu_migrate_proto,
  15. __cpu_migrate_args,
  16. TP_STRUCT__entry(
  17. __field(u64, timestamp )
  18. __field(u32, cpu_hwid )
  19. ),
  20. TP_fast_assign(
  21. __entry->timestamp = timestamp;
  22. __entry->cpu_hwid = cpu_hwid;
  23. ),
  24. TP_printk("timestamp=%llu cpu_hwid=0x%08lX",
  25. (unsigned long long)__entry->timestamp,
  26. (unsigned long)__entry->cpu_hwid
  27. )
  28. );
  29. #define __define_cpu_migrate_event(name) \
  30. DEFINE_EVENT(cpu_migrate, cpu_migrate_##name, \
  31. __cpu_migrate_proto, \
  32. __cpu_migrate_args \
  33. )
  34. __define_cpu_migrate_event(begin);
  35. __define_cpu_migrate_event(finish);
  36. __define_cpu_migrate_event(current);
  37. #undef __define_cpu_migrate
  38. #undef __cpu_migrate_proto
  39. #undef __cpu_migrate_args
  40. /* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
  41. #ifndef _PWR_CPU_MIGRATE_EVENT_AVOID_DOUBLE_DEFINING
  42. #define _PWR_CPU_MIGRATE_EVENT_AVOID_DOUBLE_DEFINING
  43. /*
  44. * Set from_phys_cpu and to_phys_cpu to CPU_MIGRATE_ALL_CPUS to indicate
  45. * a whole-cluster migration:
  46. */
  47. #define CPU_MIGRATE_ALL_CPUS 0x80000000U
  48. #endif
  49. #endif /* _TRACE_POWER_CPU_MIGRATE_H */
  50. /* This part must be outside protection */
  51. #undef TRACE_INCLUDE_FILE
  52. #define TRACE_INCLUDE_FILE power_cpu_migrate
  53. #include <trace/define_trace.h>