restricted_preemptirq.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4. */
  5. #if !defined(_TRACE_RESTRICTED_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define _TRACE_RESTRICTED_PREEMPTIRQ_H
  7. #ifdef CONFIG_PREEMPTIRQ_TRACEPOINTS
  8. #undef TRACE_SYSTEM
  9. #define TRACE_SYSTEM restricted_preemptirq
  10. #undef TRACE_INCLUDE_PATH
  11. #define TRACE_INCLUDE_PATH trace/hooks
  12. #include <linux/tracepoint.h>
  13. #include <trace/hooks/vendor_hooks.h>
  14. #ifdef CONFIG_TRACE_IRQFLAGS
  15. DECLARE_RESTRICTED_HOOK(restricted_irq_disable,
  16. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  17. TP_ARGS(ip, parent_ip), 1);
  18. DECLARE_RESTRICTED_HOOK(restricted_irq_enable,
  19. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  20. TP_ARGS(ip, parent_ip), 1);
  21. #else
  22. #define trace_restricted_irq_enable(ip, parent_ip)
  23. #define trace_restricted_irq_disable(ip, parent_ip)
  24. #endif /* CONFIG_TRACE_IRQFLAGS */
  25. #ifdef CONFIG_TRACE_PREEMPT_TOGGLE
  26. DECLARE_RESTRICTED_HOOK(restricted_preempt_disable,
  27. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  28. TP_ARGS(ip, parent_ip), 1);
  29. DECLARE_RESTRICTED_HOOK(restricted_preempt_enable,
  30. TP_PROTO(unsigned long ip, unsigned long parent_ip),
  31. TP_ARGS(ip, parent_ip), 1);
  32. #else
  33. #define trace_restricted_preempt_enable(ip, parent_ip)
  34. #define trace_restricted_preempt_disable(ip, parent_ip)
  35. #endif /* CONFIG_TRACE_PREEMPT_TOGGLE */
  36. #include <trace/define_trace.h>
  37. #else /* ! CONFIG_PREEMPTIRQ_TRACEPOINTS */
  38. #define trace_restricted_irq_enable(...)
  39. #define trace_restricted_irq_disable(...)
  40. #define trace_restricted_preempt_enable(...)
  41. #define trace_restricted_preempt_disable(...)
  42. #endif /* ! CONFIG_PREEMPTIRQ_TRACEPOINTS */
  43. #endif /* TRACE_RESTRICTED_PREEMPTIRQ_H || TRACE_HEADER_MULTI_READ */