[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51C1FD7F.9090606@gmail.com>
Date: Wed, 19 Jun 2013 12:50:39 -0600
From: David Ahern <dsahern@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
CC: Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
"zhangwei(Jovi)" <jovi.zhangwei@...wei.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/3] tracing/perf: perf_trace_buf/perf_xxx hacks.
On 6/19/13 11:51 AM, Oleg Nesterov wrote:
> On 06/19, Oleg Nesterov wrote:
>>
>> On 06/19, Peter Zijlstra wrote:
>>>
>>> I'm probably missing something obviuos, but what are we trying to do?
>>
>> Say, "perf record -e sched:sched_switch -p1".
>>
>> Every task except /sbin/init will do perf_trace_sched_switch() and
>> perf_trace_buf_prepare() + perf_trace_buf_submit for no reason(),
>> it doesn't have a counter.
>
> I did some testing under kvm, not sure these numbers actually mean
> something, but still.
>
> So, the test-case:
>
> int pipe1[2], pipe2[2];
>
> void *tfunc(void *arg)
> {
> for (;;) {
> char c;
> assert(read(pipe1[0], &c, 1) == 1);
> assert(write(pipe2[1], &c, 1) == 1);
> }
> }
>
> int main(void)
> {
> pthread_t thr;
> int nr;
>
> assert(pipe(pipe1) == 0);
> assert(pipe(pipe2) == 0);
>
> assert(pthread_create(&thr, NULL, tfunc, NULL) == 0);
>
> for (nr = 0; nr < 1000 * 1000; ++nr) {
> char c;
>
> assert(write(pipe1[1], &c, 1) == 1);
> assert(read(pipe2[0], &c, 1) == 1);
> }
>
> return 0;
> }
Same as "perf bench sched pipe"
David
>
> Idle machine, "/usr/bin/time -f "%e %S %U" taskset 1 ./pf" 3 times:
>
> 20.73 20.05 0.66
> 20.68 20.04 0.63
> 20.68 20.02 0.65
>
> Now with "perf record -e sched:sched_switch -p1" running,
>
> before 3/3:
>
> 21.59 20.77 0.80
> 21.40 20.70 0.68
> 21.50 20.72 0.78
>
> after 3/3:
>
> 21.00 20.23 0.76
> 20.89 20.19 0.69
> 20.94 20.26 0.66
>
> Oleg.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists