Introduce hash table for lttng_create_event_if_missing()
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 16 Jan 2013 17:56:09 +0000 (12:56 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 16 Jan 2013 17:58:07 +0000 (12:58 -0500)
commit22c3c099d738ab9658a46a2afa01ba9f49506942
tree61389452373ae85966c933e9bb3e4551104c551a
parente7ac2635e1418a06a20fb27e3e29c0ab3b695d73
Introduce hash table for lttng_create_event_if_missing()

lttng_create_event_if_missing() takes a lot of CPU time with stress-test
applications containing 1000 different TRACEPOINT_EVENT() and 1000
individual tracepoint() call-site.

With tracing disabled:

time ./AppWith1000_lines_TP 0

real    0m2.487s
user    0m2.424s
sys     0m0.000s

Introducing this hash table cuts the overhead very significantly when
tracing is enabled:

Before patch:

 72.16%  AppWith1000_lin  liblttng-ust.so.0.0.0             [.] lttng_create_event_if_missing
 25.64%  AppWith1000_lin  AppWith1000_lines_TP              [.] a(int)

time ./AppWith1000_lines_TP 0

real    0m7.946s
user    0m7.864s
sys     0m0.000s

After patch:

 89.13%  AppWith1000_lin  AppWith1000_lines_TP              [.] a(int)
  3.30%  AppWith1000_lin  liblttng-ust.so.0.0.0             [.] lttng_create_event_if_missing

time ./AppWith1000_lines_TP 0

real    0m2.762s
user    0m2.692s
sys     0m0.004s

Acked-by: David Goulet <dgoulet@efficios.com>
Acked-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
liblttng-ust/lttng-events.c
This page took 0.026415 seconds and 4 git commands to generate.