exceptions.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM exceptions
  4. #if !defined(_TRACE_PAGE_FAULT_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_PAGE_FAULT_H
  6. #include <linux/tracepoint.h>
  7. DECLARE_EVENT_CLASS(exceptions,
  8. TP_PROTO(unsigned long address, struct pt_regs *regs,
  9. unsigned long error_code),
  10. TP_ARGS(address, regs, error_code),
  11. TP_STRUCT__entry(
  12. __field( unsigned long, address )
  13. __field( unsigned long, ip )
  14. __field( unsigned long, error_code )
  15. ),
  16. TP_fast_assign(
  17. __entry->address = address;
  18. __entry->ip = instruction_pointer(regs);
  19. __entry->error_code = error_code;
  20. ),
  21. TP_printk("address=%ps ip=%ps error_code=0x%lx",
  22. (void *)__entry->address, (void *)__entry->ip,
  23. __entry->error_code) );
  24. DEFINE_EVENT(exceptions, page_fault_user,
  25. TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code),
  26. TP_ARGS(address, regs, error_code));
  27. DEFINE_EVENT(exceptions, page_fault_kernel,
  28. TP_PROTO(unsigned long address, struct pt_regs *regs, unsigned long error_code),
  29. TP_ARGS(address, regs, error_code));
  30. #endif /* _TRACE_PAGE_FAULT_H */
  31. /* This part must be outside protection */
  32. #include <trace/define_trace.h>