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>
Wed, 6 Feb 2013 21:56:16 +0000 (16:56 -0500)
commit48205d6057735bebb9e9fb87781bb17614782200
treeae1c7078a28b7f671a0d63dc04b531744eed3fe2
parent4bc738c1febc4653365b91f658093a6795ff79a9
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.025368 seconds and 4 git commands to generate.