From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: rostedt@goodmis.org, LKML <linux-kernel@vger.kernel.org>,
Li Zefan <lizf@cn.fujitsu.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH v2] tracing: shrink max latency ringbuffer if unnecessary
Date: Thu, 01 Jul 2010 17:26:28 +0800 [thread overview]
Message-ID: <4C2C5F44.7010006@cn.fujitsu.com> (raw)
In-Reply-To: <20100701104554.DA2D.A69D9226@jp.fujitsu.com>
KOSAKI Motohiro wrote:
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
> kernel/trace/trace.c | 39 ++++++++++++++++++++++++++++++------
> kernel/trace/trace.h | 1 +
> kernel/trace/trace_irqsoff.c | 3 ++
> kernel/trace/trace_sched_wakeup.c | 2 +
> 4 files changed, 38 insertions(+), 7 deletions(-)
>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com
> -
> + if (current_trace && current_trace->use_max_tr) {
> + /*
> + * We don't free the ring buffer. instead, resize it because
> + * The max_tr ring buffer has some state (e.g. ring->clock) and
> + * we want preserve it.
> + */
> + ring_buffer_resize(max_tr.buffer, 1);
> + max_tr.entries = 1;
> + }
> destroy_trace_option_files(topts);
>
> current_trace = t;
>
> topts = create_trace_option_files(current_trace);
I think we can skip the two resize when current_trace->use_max_tr==1 && t->use_max_tr==1
> + if (current_trace->use_max_tr) {
> + ret = ring_buffer_resize(max_tr.buffer, global_trace.entries);
> + if (ret < 0)
> + goto out;
> + max_tr.entries = global_trace.entries;
> + }
>
> if (t->init) {
> ret = tracer_init(t, tr);
Does we need to shrink it when tracer_init() fails?
Although tracer_init() hardly fails, and there is no bad effect even we don't shrink it.
next prev parent reply other threads:[~2010-07-01 9:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-30 3:06 [PATCH] tracing: shrink max latency ringbuffer if unnecessary KOSAKI Motohiro
2010-07-01 1:40 ` Steven Rostedt
2010-07-01 5:34 ` [PATCH v2] " KOSAKI Motohiro
2010-07-01 9:26 ` Lai Jiangshan [this message]
2010-07-01 11:48 ` KOSAKI Motohiro
2010-07-23 12:10 ` [tip:perf/core] tracing: Shrink " tip-bot for KOSAKI Motohiro
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=4C2C5F44.7010006@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=fweisbec@gmail.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox