lkml.org 
[lkml]   [2009]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] perfcounter: Ignore the nmi call frames in the x86-64 backtraces
On Mon, Jul 06, 2009 at 02:17:48PM +0200, Peter Zijlstra wrote:
> On Wed, 2009-07-01 at 21:02 +0200, Frederic Weisbecker wrote:
>
> > +int x86_is_stack_id(int id, char *name)
> > +{
> > + return x86_stack_ids[id - 1] == name;
> > +}
>
> OK, this bit would need a bit of a comment explaining why this works, as
> I don't think the C language guarantees de-duplication of constant
> strings.
>
> Therefore the above only works correctly if its passed a pointer from
> the x86_stack_ids[] array -- as it indeed is, since the string passed is
> obtained through the below method:


Right, that need some comments, I will do that with x86-32 support at the same
time.

Thanks.



> > +static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
> > + unsigned *usedp, char **idp)
> > +{
> > unsigned k;
> >
> > /*
> > @@ -61,7 +68,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
> > if (*usedp & (1U << k))
> > break;
> > *usedp |= 1U << k;
> > - *idp = ids[k];
> > + *idp = x86_stack_ids[k];
> > return (unsigned long *)end;
> > }
> > /*
>
>



\
 
 \ /
  Last update: 2009-07-07 09:45    [W:0.053 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site