From: Frederic Weisbecker <fweisbec@gmail.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 5/6] tracing: reduce latency and remove percpu trace_seq
Date: Wed, 20 Jan 2010 20:22:27 +0100 [thread overview]
Message-ID: <20100120192225.GC6194@nowhere> (raw)
In-Reply-To: <4B55607E.8070403@cn.fujitsu.com>
On Tue, Jan 19, 2010 at 03:34:22PM +0800, Lai Jiangshan wrote:
>
> __print_flags() and __print_symbolic() use percpu trace_seq:
>
> 1) Its memory is preallocated, it wastes memory when we don't use tracing.
> 2) It wastes memory for multi-cpus system.
> 3) It disables preemption when it executes its core routine
> "trace_seq_printf(s, "%s: ", #call);" and introduce latency
> for more important process.
>
> So we move this trace_seq to struct trace_iterator.
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index be9ece5..348500d 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -12,9 +12,6 @@ struct dentry;
>
> #define FTRACE_SEQ_BUFSIZE PAGE_SIZE
>
> -DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq);
> -DECLARE_PER_CPU(unsigned char[FTRACE_SEQ_BUFSIZE], ftrace_event_buffer);
> -
> struct trace_print_flags {
> unsigned long mask;
> const char *name;
> @@ -60,6 +57,10 @@ struct trace_iterator {
> struct trace_seq seq;
> unsigned char buffer[FTRACE_SEQ_BUFSIZE];
>
> + /* trace_seq for __print_flags() and __print_symbolic() */
> + struct trace_seq tmp_seq;
> + unsigned char tmp_buffer[FTRACE_SEQ_BUFSIZE];
Well, I don't like much that because it's a temporary buffer
in trace iter only used by few events.
But the problem is indeed tricky.
May be should we use a kmalloc in raw_output?
We could pass a trace_seq without buffer in ftrace_print_flags_seq
which can alloc the buffer and then free it after?
next prev parent reply other threads:[~2010-01-20 19:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-19 7:34 [PATCH 5/6] tracing: reduce latency and remove percpu trace_seq Lai Jiangshan
2010-01-20 19:22 ` Frederic Weisbecker [this message]
2010-01-26 3:07 ` Lai Jiangshan
2010-01-30 21:24 ` Frederic Weisbecker
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=20100120192225.GC6194@nowhere \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--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