lkml.org 
[lkml]   [2008]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] kmemtrace: Use tracepoints instead of markers.
On Tue, Dec 30, 2008 at 10:40:17AM -0200, Arnaldo Carvalho de Melo wrote:
> Em Tue, Dec 30, 2008 at 09:41:28AM +0200, Eduard - Gabriel Munteanu escreveu:
> > kmemtrace now uses tracepoints instead of markers. We no longer need to
> > use format specifiers. Also dropped kmemtrace_mark_alloc_node(), since
> > it's easy to pass -1 as the NUMA node without providing a needless and
> > long-named variant of the same function.
> >
> > Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
> > diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
> > index 7555ce9..fe3cea2 100644
> > --- a/include/linux/slab_def.h
> > +++ b/include/linux/slab_def.h
> > @@ -76,8 +76,8 @@ found:
> >
> > ret = kmem_cache_alloc_notrace(cachep, flags);
> >
> > - kmemtrace_mark_alloc(KMEMTRACE_TYPE_KMALLOC, _THIS_IP_, ret,
> > - size, slab_buffer_size(cachep), flags);
> > + trace_kmalloc(_THIS_IP_, ret,
> > + size, slab_buffer_size(cachep), flags, -1);
>
> Is there a way for a tracepoint to get the caller without having to pass
> it explicitely?
>
> - Arnaldo

It might be possible, but for correctness DEFINE_TRACE() should use
__always_inline instead of inline.

But it is quite pointless. Sometimes we need _RET_IP_, sometimes
_THIS_IP_ and sometimes a parameter we've been passed. That's because we
want the IP of the caller, so it depends on whether this slab function
is __always_inline, non-inlined or deeply nested within other functions
(which can be as well __always_inline or non-inlined).


Eduard



\
 
 \ /
  Last update: 2008-12-30 15:05    [W:0.089 / U:4.412 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site