sputrace.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #if !defined(_TRACE_SPUFS_H) || defined(TRACE_HEADER_MULTI_READ)
  3. #define _TRACE_SPUFS_H
  4. #include <linux/tracepoint.h>
  5. #include <linux/stringify.h>
  6. #undef TRACE_SYSTEM
  7. #define TRACE_SYSTEM spufs
  8. TRACE_EVENT(spufs_context,
  9. TP_PROTO(struct spu_context *ctx, struct spu *spu, const char *name),
  10. TP_ARGS(ctx, spu, name),
  11. TP_STRUCT__entry(
  12. __field(const char *, name)
  13. __field(int, owner_tid)
  14. __field(int, number)
  15. ),
  16. TP_fast_assign(
  17. __entry->name = name;
  18. __entry->owner_tid = ctx->tid;
  19. __entry->number = spu ? spu->number : -1;
  20. ),
  21. TP_printk("%s (ctxthread = %d, spu = %d)",
  22. __entry->name, __entry->owner_tid, __entry->number)
  23. );
  24. #define spu_context_trace(name, ctx, spu) \
  25. trace_spufs_context(ctx, spu, __stringify(name))
  26. #define spu_context_nospu_trace(name, ctx) \
  27. trace_spufs_context(ctx, NULL, __stringify(name))
  28. #endif /* _TRACE_SPUFS_H */
  29. #undef TRACE_INCLUDE_PATH
  30. #define TRACE_INCLUDE_PATH .
  31. #define TRACE_INCLUDE_FILE sputrace
  32. #include <trace/define_trace.h>