Skip to content

Commit 08d43a5

Browse files
tzanussirostedt
authored andcommitted
tracing: Add lock-free tracing_map
Add tracing_map, a special-purpose lock-free map for tracing. tracing_map is designed to aggregate or 'sum' one or more values associated with a specific object of type tracing_map_elt, which is associated by the map to a given key. It provides various hooks allowing per-tracer customization and is separated out into a separate file in order to allow it to be shared between multiple tracers, but isn't meant to be generally used outside of that context. The tracing_map implementation was inspired by lock-free map algorithms originated by Dr. Cliff Click: http://www.azulsystems.com/blog/cliff/2007-03-26-non-blocking-hashtable http://www.azulsystems.com/events/javaone_2007/2007_LockFreeHash.pdf Link: http://lkml.kernel.org/r/b43d68d1add33582a396f553c8ef705a33a6a748.1449767187.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi <[email protected]> Tested-by: Masami Hiramatsu <[email protected]> Reviewed-by: Namhyung Kim <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 540b589 commit 08d43a5

File tree

4 files changed

+1354
-0
lines changed

4 files changed

+1354
-0
lines changed

kernel/trace/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,19 @@ config MMIOTRACE
528528
See Documentation/trace/mmiotrace.txt.
529529
If you are not helping to develop drivers, say N.
530530

531+
config TRACING_MAP
532+
bool
533+
depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
534+
default n
535+
help
536+
tracing_map is a special-purpose lock-free map for tracing,
537+
separated out as a stand-alone facility in order to allow it
538+
to be shared between multiple tracers. It isn't meant to be
539+
generally used outside of that context, and is normally
540+
selected by tracers that use it.
541+
542+
If in doubt, say N.
543+
531544
config MMIOTRACE_TEST
532545
tristate "Test module for mmiotrace"
533546
depends on MMIOTRACE && m

kernel/trace/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ obj-$(CONFIG_TRACING) += trace_output.o
3131
obj-$(CONFIG_TRACING) += trace_seq.o
3232
obj-$(CONFIG_TRACING) += trace_stat.o
3333
obj-$(CONFIG_TRACING) += trace_printk.o
34+
obj-$(CONFIG_TRACING_MAP) += tracing_map.o
3435
obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o
3536
obj-$(CONFIG_FUNCTION_TRACER) += trace_functions.o
3637
obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o

0 commit comments

Comments
 (0)