Speed up probe registration for large amount of events
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 6 Feb 2013 21:56:16 +0000 (16:56 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 8 Feb 2013 21:18:18 +0000 (16:18 -0500)
commite3c0465ab9bc43410b413f5e93ef8083d91f9bc5
tree7fa321f494443a19eb0be269b73ef0a6d57e0508
parent9e9e67a64cf9f9ccb97a1eb5de1abf3eb09ab679
Speed up probe registration for large amount of events

LTTng-UST probe registration is O(n^2). I actually left a comment that
describes this, also implying that we can improve this if it becomes an
issue.

I've had a report from Yang Wang, who works on instrumenting the J9 VM,
that O(n^2) does not agree well with 16000 probes and tracepoints.

It appears that lttng_probe_register() is being too paranoid for its own
good. There are now many things that are guaranteed by the way probe
providers are being built.

We actually need to keep a check that no provider with the same name has
been registered (O(n) on the number of registered providers, could be
improved with a hash table if it ever becomes necessary).

Use an assert to check that each event name starts with its own provider
name (it would be an internal error within the provider if it's not the
case). (O(n) on the number of events within a provider)

The rest is just useless, so remove this O(n^2) check.

While we are there, remove the now unused
lttng_event_get()/lttng_event_put() functions.

Reported-by: Yang Wang <yangw.wang5@unb.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
liblttng-ust/lttng-events.c
liblttng-ust/lttng-probes.c
This page took 0.025346 seconds and 4 git commands to generate.