lkml.org 
[lkml]   [2008]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 05/24] perfmon: X86 generic code (x86)
> What if a threads reprograms the counters while another is reading them?

In the worst case you get an invalid event, which is then discarded.
I think. I've never tried to understand it in all details, but
at least it seems to work.

> How is the buffer reset?

drivers/oprofile/cpu_buffer.c:

/* Resets the cpu buffer to a sane state. */
void cpu_buffer_reset(struct oprofile_cpu_buffer *cpu_buf)
{
/* reset these to invalid values; the next sample
* collected will populate the buffer with proper
* values to initialize the buffer
*/
cpu_buf->last_is_kernel = -1;
cpu_buf->last_task = NULL;
}

-Andi

--
ak@linux.intel.com


\
 
 \ /
  Last update: 2008-11-27 13:37    [W:0.068 / U:0.116 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site