diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-09-03 01:41:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-09-03 01:41:11 -0400 |
commit | 7d992feb7694a21ee81f22894b455dadd5d1c110 (patch) | |
tree | d0f0961186b1c31c536a26a7f986ad7ca677453b /include/linux/ftrace_event.h | |
parent | 6e4664525b1db28f8c4e1130957f70a94c19213e (diff) | |
parent | 25f27ce4a6a4995c8bdd69b4b2180465ed5ad2b8 (diff) |
Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull RCU updates from Paul E. McKenney:
"
* Update RCU documentation. These were posted to LKML at
https://lkml.org/lkml/2013/8/19/611.
* Miscellaneous fixes. These were posted to LKML at
https://lkml.org/lkml/2013/8/19/619.
* Full-system idle detection. This is for use by Frederic
Weisbecker's adaptive-ticks mechanism. Its purpose is
to allow the timekeeping CPU to shut off its tick when
all other CPUs are idle. These were posted to LKML at
https://lkml.org/lkml/2013/8/19/648.
* Improve rcutorture test coverage. These were posted to LKML at
https://lkml.org/lkml/2013/8/19/675.
"
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r-- | include/linux/ftrace_event.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 120d57a1c3a5..5eaa746735ff 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -359,6 +359,40 @@ do { \ | |||
359 | __trace_printk(ip, fmt, ##args); \ | 359 | __trace_printk(ip, fmt, ##args); \ |
360 | } while (0) | 360 | } while (0) |
361 | 361 | ||
362 | /** | ||
363 | * tracepoint_string - register constant persistent string to trace system | ||
364 | * @str - a constant persistent string that will be referenced in tracepoints | ||
365 | * | ||
366 | * If constant strings are being used in tracepoints, it is faster and | ||
367 | * more efficient to just save the pointer to the string and reference | ||
368 | * that with a printf "%s" instead of saving the string in the ring buffer | ||
369 | * and wasting space and time. | ||
370 | * | ||
371 | * The problem with the above approach is that userspace tools that read | ||
372 | * the binary output of the trace buffers do not have access to the string. | ||
373 | * Instead they just show the address of the string which is not very | ||
374 | * useful to users. | ||
375 | * | ||
376 | * With tracepoint_string(), the string will be registered to the tracing | ||
377 | * system and exported to userspace via the debugfs/tracing/printk_formats | ||
378 | * file that maps the string address to the string text. This way userspace | ||
379 | * tools that read the binary buffers have a way to map the pointers to | ||
380 | * the ASCII strings they represent. | ||
381 | * | ||
382 | * The @str used must be a constant string and persistent as it would not | ||
383 | * make sense to show a string that no longer exists. But it is still fine | ||
384 | * to be used with modules, because when modules are unloaded, if they | ||
385 | * had tracepoints, the ring buffers are cleared too. As long as the string | ||
386 | * does not change during the life of the module, it is fine to use | ||
387 | * tracepoint_string() within a module. | ||
388 | */ | ||
389 | #define tracepoint_string(str) \ | ||
390 | ({ \ | ||
391 | static const char *___tp_str __tracepoint_string = str; \ | ||
392 | ___tp_str; \ | ||
393 | }) | ||
394 | #define __tracepoint_string __attribute__((section("__tracepoint_str"))) | ||
395 | |||
362 | #ifdef CONFIG_PERF_EVENTS | 396 | #ifdef CONFIG_PERF_EVENTS |
363 | struct perf_event; | 397 | struct perf_event; |
364 | 398 | ||