From: Oleg Nesterov <oleg@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] tracing/perf: perf_trace_buf/perf_xxx hacks.
Date: Wed, 19 Jun 2013 19:51:39 +0200 [thread overview]
Message-ID: <20130619175139.GA20454@redhat.com> (raw)
In-Reply-To: <20130619152844.GA9176@redhat.com>
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;
}
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.
next prev parent reply other threads:[~2013-06-19 17:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-18 19:21 [PATCH 0/3] tracing/perf: perf_trace_buf/perf_xxx hacks Oleg Nesterov
2013-06-18 19:22 ` [PATCH 1/3] tracing/perf: expand TRACE_EVENT(sched_stat_runtime) Oleg Nesterov
2013-06-18 19:22 ` [PATCH 2/3] tracing/perf: reimplement TP_perf_assign() logic Oleg Nesterov
2013-06-18 19:22 ` [PATCH 3/3] tracing/perf: Avoid perf_trace_buf_*() in perf_trace_##call() when possible Oleg Nesterov
2013-06-18 20:02 ` Steven Rostedt
2013-06-19 18:12 ` Oleg Nesterov
2013-06-19 18:24 ` Steven Rostedt
2013-06-19 12:10 ` [PATCH 0/3] tracing/perf: perf_trace_buf/perf_xxx hacks Peter Zijlstra
2013-06-19 15:28 ` Oleg Nesterov
2013-06-19 17:51 ` Oleg Nesterov [this message]
2013-06-19 18:50 ` David Ahern
2013-06-19 19:58 ` Oleg Nesterov
2013-06-20 18:23 ` Steven Rostedt
2013-06-20 18:35 ` David Ahern
2013-06-20 18:47 ` Steven Rostedt
2013-06-20 18:53 ` David Ahern
2013-06-20 18:53 ` Steven Rostedt
2013-06-20 22:20 ` Steven Rostedt
2013-07-18 3:06 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130619175139.GA20454@redhat.com \
--to=oleg@redhat.com \
--cc=fweisbec@gmail.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.