diff options
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r-- | include/linux/ftrace_event.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 06c6faa9e5cc..28672e87e910 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -571,40 +571,6 @@ do { \ | |||
571 | __trace_printk(ip, fmt, ##args); \ | 571 | __trace_printk(ip, fmt, ##args); \ |
572 | } while (0) | 572 | } while (0) |
573 | 573 | ||
574 | /** | ||
575 | * tracepoint_string - register constant persistent string to trace system | ||
576 | * @str - a constant persistent string that will be referenced in tracepoints | ||
577 | * | ||
578 | * If constant strings are being used in tracepoints, it is faster and | ||
579 | * more efficient to just save the pointer to the string and reference | ||
580 | * that with a printf "%s" instead of saving the string in the ring buffer | ||
581 | * and wasting space and time. | ||
582 | * | ||
583 | * The problem with the above approach is that userspace tools that read | ||
584 | * the binary output of the trace buffers do not have access to the string. | ||
585 | * Instead they just show the address of the string which is not very | ||
586 | * useful to users. | ||
587 | * | ||
588 | * With tracepoint_string(), the string will be registered to the tracing | ||
589 | * system and exported to userspace via the debugfs/tracing/printk_formats | ||
590 | * file that maps the string address to the string text. This way userspace | ||
591 | * tools that read the binary buffers have a way to map the pointers to | ||
592 | * the ASCII strings they represent. | ||
593 | * | ||
594 | * The @str used must be a constant string and persistent as it would not | ||
595 | * make sense to show a string that no longer exists. But it is still fine | ||
596 | * to be used with modules, because when modules are unloaded, if they | ||
597 | * had tracepoints, the ring buffers are cleared too. As long as the string | ||
598 | * does not change during the life of the module, it is fine to use | ||
599 | * tracepoint_string() within a module. | ||
600 | */ | ||
601 | #define tracepoint_string(str) \ | ||
602 | ({ \ | ||
603 | static const char *___tp_str __tracepoint_string = str; \ | ||
604 | ___tp_str; \ | ||
605 | }) | ||
606 | #define __tracepoint_string __attribute__((section("__tracepoint_str"))) | ||
607 | |||
608 | #ifdef CONFIG_PERF_EVENTS | 574 | #ifdef CONFIG_PERF_EVENTS |
609 | struct perf_event; | 575 | struct perf_event; |
610 | 576 | ||