trace_nop.c 848 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * nop tracer
  3. *
  4. * Copyright (C) 2008 Steven Noonan <steven@uplinklabs.net>
  5. *
  6. */
  7. #include <linux/module.h>
  8. #include <linux/fs.h>
  9. #include <linux/debugfs.h>
  10. #include <linux/ftrace.h>
  11. #include "trace.h"
  12. static struct trace_array *ctx_trace;
  13. static void start_nop_trace(struct trace_array *tr)
  14. {
  15. /* Nothing to do! */
  16. }
  17. static void stop_nop_trace(struct trace_array *tr)
  18. {
  19. /* Nothing to do! */
  20. }
  21. static int nop_trace_init(struct trace_array *tr)
  22. {
  23. int cpu;
  24. ctx_trace = tr;
  25. for_each_online_cpu(cpu)
  26. tracing_reset(tr, cpu);
  27. start_nop_trace(tr);
  28. return 0;
  29. }
  30. static void nop_trace_reset(struct trace_array *tr)
  31. {
  32. stop_nop_trace(tr);
  33. }
  34. struct tracer nop_trace __read_mostly =
  35. {
  36. .name = "nop",
  37. .init = nop_trace_init,
  38. .reset = nop_trace_reset,
  39. #ifdef CONFIG_FTRACE_SELFTEST
  40. .selftest = trace_selftest_startup_nop,
  41. #endif
  42. };