lkml.org 
[lkml]   [2015]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V7 3/6] perf, x86: handle multiple records in PEBS buffer
On Wed, May 06, 2015 at 03:01:16PM +0200, Andi Kleen wrote:
> > > > + if (p->status != (1 << bit)) {
> > > > + u64 pebs_status;
> > > > +
> > > > + /* slow path */
> > > > + pebs_status = p->status & cpuc->pebs_enabled;
> > > > + pebs_status &= (1ULL << MAX_PEBS_EVENTS) - 1;
> > > > + if (pebs_status != (1 << bit)) {
> > > > + perf_log_lost(event);
> > >
> > > Does it make sense to keep an error[bit] count and only log once with the
> > > actual number in? -- when !0 obviously.
> >
> > Yes, will do it.
>
> If you use anything but u8 for the array member it would be too large
> for the NMI stack, and u8 is lilkely overflow prone. Would not do it.

If we're so close that 4*8=32 bytes would overflow the stack we're in
trouble already.

But we could just switch counts[] over to short and have another short
array for errors[], that way no extra bytes of stack used.


\
 
 \ /
  Last update: 2015-05-06 15:41    [W:2.464 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site