lkml.org 
[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf report: auto-detect branch stack sampling mode

* Arnaldo Carvalho de Melo <acme@redhat.com> wrote:

> > Something like this seems to do it for me.
> >
> > offset = addr - sym->start;
> > + len = sym->end - sym->start;
> > + if (offset >= len)
> > + return 0;
> > +
>
> That is my fault, I should have added a BUG_ON() spitting out
> a callchain in this case, as that function shouldn't be called
> if the address is not within its range :-\

Btw., I'd suggest not doing a BUG_ON() but some less destructive
warning: both symbol table errors and sample stream hickups are
common and can lead to essentially arbitrary input data - we
shouldn't crash on that.

Thanks,

Ingo


\
 
 \ /
  Last update: 2012-03-06 07:31    [W:0.072 / U:2.404 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site