Re: [PATCH] tracing/kmemtrace: normalize the raw tracer event tothe unified tracing API

From: Ingo Molnar
Date: Tue Dec 30 2008 - 03:00:57 EST



* Frederic Weisbecker <fweisbec@xxxxxxxxx> wrote:

> Pekka, note that I would be pleased to add statistical tracing on this
> tracer, but I would need a hashtable, or an array, or a list, or
> whatever iterable to insert the data into the stat tracing api.

there would be a couple of natural objects to group events by:

1) callsite [IP] of kmalloc()/kfree()/etc.

2) slab cache

3) slab object

for 1) callsite based histograms, i think ftrace should have a built-in
mechanism for that. kmemtrace tracepoints already pass in a call_site
argument that can be used to drive it.

for 2) slab cache based histograms (counts) - we need some knowledge about
the affected slab caches, and we need some space as well. The tracepoints
could be extended with a kmem_cache argument perhaps. A callback is needed
at cache creation time (which could be in the form of a tracepoint) that
gives kernel/tracing/kmemtrace.c the right place to allocate the per slab
histogram. (so that the other tracepoints dont have to do it implicitly -
which would be fragile as we are in the SLAB code, often with spinlocks
taken, so we cannot allocate)

i think 3) is the hardest so lets skip it for now ;-)

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/