From: Steven Rostedt <rostedt@goodmis.org>
To: Pekka Paalanen <pq@iki.fi>
Cc: "Ingo Molnar" <mingo@elte.hu>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Linux Kernel" <linux-kernel@vger.kernel.org>,
"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
"Pavel Roskin" <proski@gnu.org>
Subject: Re: [PATCH 5/7] mmiotrace: handle TRACE_PRINT entries.
Date: Tue, 16 Sep 2008 16:11:20 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.1.10.0809161609520.7650@gandalf.stny.rr.com> (raw)
In-Reply-To: <20080916220227.4db173f5@daedalus.pq.iki.fi>
On Tue, 16 Sep 2008, Pekka Paalanen wrote:
> From 6a458e250857907e16cb16799392fccbfd5f0f4a Mon Sep 17 00:00:00 2001
> From: Pekka Paalanen <pq@iki.fi>
> Date: Sun, 17 Aug 2008 18:15:13 +0300
> Subject: [PATCH] mmiotrace: handle TRACE_PRINT entries.
>
> Also make trace_seq_print_cont() non-static, and add a newline if the
> seq buffer can't hold all data.
>
> Signed-off-by: Pekka Paalanen <pq@iki.fi>
> ---
> kernel/trace/trace.c | 31 +++++++++++--------------------
> kernel/trace/trace.h | 19 +++++++++++++++++++
> kernel/trace/trace_mmiotrace.c | 23 +++++++++++++++++++++++
> 3 files changed, 53 insertions(+), 20 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 406de9c..7e7154f 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -200,23 +200,6 @@ unsigned long nsecs_to_usecs(unsigned long nsecs)
> }
>
> /*
> - * trace_flag_type is an enumeration that holds different
> - * states when a trace occurs. These are:
> - * IRQS_OFF - interrupts were disabled
> - * NEED_RESCED - reschedule is requested
> - * HARDIRQ - inside an interrupt handler
> - * SOFTIRQ - inside a softirq handler
> - * CONT - multiple entries hold the trace item
> - */
> -enum trace_flag_type {
> - TRACE_FLAG_IRQS_OFF = 0x01,
> - TRACE_FLAG_NEED_RESCHED = 0x02,
> - TRACE_FLAG_HARDIRQ = 0x04,
> - TRACE_FLAG_SOFTIRQ = 0x08,
> - TRACE_FLAG_CONT = 0x10,
> -};
> -
> -/*
> * TRACE_ITER_SYM_MASK masks the options in trace_flags that
> * control the output of kernel symbols.
> */
> @@ -1517,12 +1500,16 @@ lat_print_timestamp(struct trace_seq *s, unsigned long long abs_usecs,
>
> static const char state_to_char[] = TASK_STATE_TO_CHAR_STR;
>
> -static void
> -trace_seq_print_cont(struct trace_seq *s, struct trace_iterator *iter)
> +/*
> + * The message is supposed to contain an ending newline.
> + * If the printing stops prematurely, try to add a newline of our own.
> + */
> +void trace_seq_print_cont(struct trace_seq *s, struct trace_iterator *iter)
> {
> struct trace_array *tr = iter->tr;
> struct trace_array_cpu *data = tr->data[iter->cpu];
> struct trace_entry *ent;
> + bool ok = true;
hmm, since when did the kernel have type bool?
>
> ent = trace_entry_idx(tr, data, iter, iter->cpu);
> if (!ent || ent->type != TRACE_CONT) {
> @@ -1531,10 +1518,14 @@ trace_seq_print_cont(struct trace_seq *s, struct trace_iterator *iter)
> }
>
> do {
> - trace_seq_printf(s, "%s", ent->cont.buf);
> + if (ok)
> + ok = (trace_seq_printf(s, "%s", ent->cont.buf) > 0);
> __trace_iterator_increment(iter, iter->cpu);
> ent = trace_entry_idx(tr, data, iter, iter->cpu);
> } while (ent && ent->type == TRACE_CONT);
> +
> + if (!ok)
> + trace_seq_putc(s, '\n');
> }
>
-- Steve
next prev parent reply other threads:[~2008-09-16 20:11 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-24 21:42 [Patch] Tracing/ftrace: Adds a marker to allow user comments Frédéric Weisbecker
2008-08-25 8:44 ` Ingo Molnar
2008-08-25 13:59 ` Frédéric Weisbecker
2008-08-25 16:38 ` Steven Rostedt
2008-08-25 17:52 ` Frédéric Weisbecker
2008-08-27 9:59 ` Frédéric Weisbecker
2008-08-27 18:21 ` Pekka Paalanen
2008-08-28 9:44 ` Ingo Molnar
2008-08-28 16:03 ` Frédéric Weisbecker
2008-08-28 10:04 ` Frédéric Weisbecker
2008-08-28 18:42 ` Pekka Paalanen
2008-09-04 16:20 ` Frédéric Weisbecker
2008-09-04 17:30 ` Pekka Paalanen
2008-09-04 18:11 ` Steven Rostedt
2008-09-06 11:39 ` Frédéric Weisbecker
2008-09-06 13:49 ` Pekka Paalanen
2008-09-15 19:47 ` Tracing/ftrace: trouble with trace_entries and trace_pipe Pekka Paalanen
2008-09-15 21:14 ` Steven Rostedt
2008-09-16 18:01 ` Pekka Paalanen
2008-09-17 12:41 ` Frédéric Weisbecker
2008-09-17 17:36 ` Pekka Paalanen
2008-09-16 18:54 ` [PATCH 1/7] x86 mmiotrace: fix a rare memory leak Pekka Paalanen
2008-09-16 18:56 ` [PATCH 2/7] ftrace: move mmiotrace functions out of trace.c Pekka Paalanen
2008-09-16 18:58 ` [PATCH 3/7] ftrace: add trace_vprintk() Pekka Paalanen
2008-09-16 20:06 ` Steven Rostedt
2008-09-17 11:42 ` Ingo Molnar
2008-09-16 19:00 ` [PATCH 4/7] x86 mmiotrace: implement mmiotrace_printk() Pekka Paalanen
2008-09-16 19:02 ` [PATCH 5/7] mmiotrace: handle TRACE_PRINT entries Pekka Paalanen
2008-09-16 20:11 ` Steven Rostedt [this message]
2008-09-16 21:24 ` Pekka Paalanen
2008-09-16 19:03 ` [PATCH 6/7] mmiotrace: remove left-over marker cruft Pekka Paalanen
2008-09-16 19:06 ` [PATCH 7/7] ftrace: inject markers via trace_marker file Pekka Paalanen
2008-09-16 8:57 ` Tracing/ftrace: trouble with trace_entries and trace_pipe Frédéric Weisbecker
2008-09-07 14:11 ` [Patch] Tracing/ftrace: Adds a marker to allow user comments Pekka Paalanen
2008-09-07 17:29 ` Steven Rostedt
2008-09-08 17:19 ` Pekka Paalanen
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=alpine.DEB.1.10.0809161609520.7650@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=a.p.zijlstra@chello.nl \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pq@iki.fi \
--cc=proski@gnu.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
all inboxes | Powered by JetHome®