lkml.org 
[lkml]   [2011]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] perf record: add time-of-day option


On 03/01/2011 07:29 AM, Peter Zijlstra wrote:

>> +/* add a sample to the event stream based on user request */
>> +static int perf_event_generate_sample(struct perf_event *event)
>> +{
>> + struct perf_sample_data data;
>> + struct pt_regs regs;
>> +
>> + perf_fetch_caller_regs(&regs);
>> + event->pmu->read(event);
>> + perf_sample_data_init(&data, 0);
>> + data.period = event->hw.last_period;
>> + perf_event_output(event, 0, &data, &regs);
>> +
>> + return 0;
>> +}
>
> I'm not quite sure why you need this..
>

periodic samples are generated after the specified period. I want the
first sample immediately and the remainder based on the set period.

So generically, how do you get the first sample into the event stream
and let the others happen based on the timer? I need not only the
counter value but also the perf_clock timestamp that comes from the
SAMPLE_TIME attribute.

David



\
 
 \ /
  Last update: 2011-03-01 15:37    [W:0.115 / U:30.312 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site