public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] tracing: lost events changes
@ 2010-04-14 13:00 Jiri Olsa
  2010-04-14 13:00 ` [PATCH 1/2] tracing: adding lost-events option Jiri Olsa
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jiri Olsa @ 2010-04-14 13:00 UTC (permalink / raw)
  To: mingo, rostedt, fweisbec; +Cc: linux-kernel

hi,

I noticed LOST EVENTS messages in the iterator "trace" file.
According to the comment from commit bc21b478 this won't work.

<comment>
    Note, it does not work with the iterator "trace" file, since it requires
    the use of consuming the page from the ring buffer to determine how many
    events were lost, which the iterator does not do.
</comment>

I'm not sure the attached fix (2/2) is on the right place,
but stops the LOST EVENTS display for iterator "trace" file.

I also added option to control the LOST EVENTS display (1/2) if needed.

attached patches:
- 1/2 - adding lost-events option
- 2/2 - supress lost events message for iterator "trace"


wbr,
jirka
---
 kernel/trace/trace.c |   24 ++++++++++++++----------
 kernel/trace/trace.h |    1 +
 2 files changed, 15 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] tracing: adding lost-events option
  2010-04-14 13:00 [PATCH 0/2] tracing: lost events changes Jiri Olsa
@ 2010-04-14 13:00 ` Jiri Olsa
  2010-04-14 13:00 ` [PATCH 2/2] tracing: supress lost events message for iterator "trace" Jiri Olsa
  2010-04-14 15:11 ` [PATCH 0/2] tracing: lost events changes Steven Rostedt
  2 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2010-04-14 13:00 UTC (permalink / raw)
  To: mingo, rostedt, fweisbec; +Cc: linux-kernel, Jiri Olsa

hi,

adding option for control LOST EVENTS message output.

wbr,
jirka


Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 kernel/trace/trace.c |    7 +++++--
 kernel/trace/trace.h |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 60f3b62..bf00438 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -332,7 +332,7 @@ static DECLARE_WAIT_QUEUE_HEAD(trace_wait);
 /* trace_flags holds trace_options default values */
 unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK |
 	TRACE_ITER_ANNOTATE | TRACE_ITER_CONTEXT_INFO | TRACE_ITER_SLEEP_TIME |
-	TRACE_ITER_GRAPH_TIME;
+	TRACE_ITER_GRAPH_TIME | TRACE_ITER_LOST_EVENTS;
 
 static int trace_stop_count;
 static DEFINE_SPINLOCK(tracing_start_lock);
@@ -416,6 +416,7 @@ static const char *trace_options[] = {
 	"latency-format",
 	"sleep-time",
 	"graph-time",
+	"lost-events",
 	NULL
 };
 
@@ -2040,9 +2041,11 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter)
 {
 	enum print_line_t ret;
 
-	if (iter->lost_events)
+	if ((trace_flags & TRACE_ITER_LOST_EVENTS) &&
+	    (iter->lost_events)) {
 		trace_seq_printf(&iter->seq, "CPU:%d [LOST %lu EVENTS]\n",
 				 iter->cpu, iter->lost_events);
+	}
 
 	if (iter->trace && iter->trace->print_line) {
 		ret = iter->trace->print_line(iter);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index bec2c97..4607b43 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -606,6 +606,7 @@ enum trace_iterator_flags {
 	TRACE_ITER_LATENCY_FMT		= 0x20000,
 	TRACE_ITER_SLEEP_TIME		= 0x40000,
 	TRACE_ITER_GRAPH_TIME		= 0x80000,
+	TRACE_ITER_LOST_EVENTS		= 0x100000,
 };
 
 /*
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] tracing: supress lost events message for iterator "trace"
  2010-04-14 13:00 [PATCH 0/2] tracing: lost events changes Jiri Olsa
  2010-04-14 13:00 ` [PATCH 1/2] tracing: adding lost-events option Jiri Olsa
@ 2010-04-14 13:00 ` Jiri Olsa
  2010-04-14 15:11 ` [PATCH 0/2] tracing: lost events changes Steven Rostedt
  2 siblings, 0 replies; 6+ messages in thread
From: Jiri Olsa @ 2010-04-14 13:00 UTC (permalink / raw)
  To: mingo, rostedt, fweisbec; +Cc: linux-kernel, Jiri Olsa

hi,

I noticed LOST EVENTS messages in the iterator "trace" file.
According to the comment from commit bc21b478 this won't work.

<comment>
    Note, it does not work with the iterator "trace" file, since it requires
    the use of consuming the page from the ring buffer to determine how many
    events were lost, which the iterator does not do.
</comment>

The change supress the LOST EVENTS message for iterator "trace".

wbr,
jirka


Signed-off-by: Jiri Olsa <jolsa@redhat.com>
---
 kernel/trace/trace.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index bf00438..536e573 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1630,10 +1630,11 @@ struct trace_entry *trace_find_next_entry(struct trace_iterator *iter,
 }
 
 /* Find the next real entry, and increment the iterator to the next entry */
-static void *find_next_entry_inc(struct trace_iterator *iter)
+static void *find_next_entry_inc(struct trace_iterator *iter,
+				 unsigned long *missing_events)
 {
 	iter->ent = __find_next_entry(iter, &iter->cpu,
-				      &iter->lost_events, &iter->ts);
+				      missing_events, &iter->ts);
 
 	if (iter->ent)
 		trace_iterator_increment(iter);
@@ -1665,12 +1666,12 @@ static void *s_next(struct seq_file *m, void *v, loff_t *pos)
 		return NULL;
 
 	if (iter->idx < 0)
-		ent = find_next_entry_inc(iter);
+		ent = find_next_entry_inc(iter, NULL);
 	else
 		ent = iter;
 
 	while (ent && iter->idx < i)
-		ent = find_next_entry_inc(iter);
+		ent = find_next_entry_inc(iter, NULL);
 
 	iter->pos = *pos;
 
@@ -3187,7 +3188,7 @@ waitagain:
 
 	trace_event_read_lock();
 	trace_access_lock(iter->cpu_file);
-	while (find_next_entry_inc(iter) != NULL) {
+	while (find_next_entry_inc(iter, &iter->lost_events) != NULL) {
 		enum print_line_t ret;
 		int len = iter->seq.len;
 
@@ -3270,7 +3271,7 @@ tracing_fill_pipe_page(size_t rem, struct trace_iterator *iter)
 		if (ret != TRACE_TYPE_NO_CONSUME)
 			trace_consume(iter);
 		rem -= count;
-		if (!find_next_entry_inc(iter))	{
+		if (!find_next_entry_inc(iter, &iter->lost_events))	{
 			rem = 0;
 			iter->ent = NULL;
 			break;
@@ -3323,7 +3324,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
 	if (ret <= 0)
 		goto out_err;
 
-	if (!iter->ent && !find_next_entry_inc(iter)) {
+	if (!iter->ent && !find_next_entry_inc(iter, &iter->lost_events)) {
 		ret = -EFAULT;
 		goto out_err;
 	}
@@ -4460,7 +4461,7 @@ static void __ftrace_dump(bool disable_tracing)
 		iter.iter_flags |= TRACE_FILE_LAT_FMT;
 		iter.pos = -1;
 
-		if (find_next_entry_inc(&iter) != NULL) {
+		if (find_next_entry_inc(&iter, &iter.lost_events) != NULL) {
 			int ret;
 
 			ret = print_trace_line(&iter);
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: lost events changes
  2010-04-14 13:00 [PATCH 0/2] tracing: lost events changes Jiri Olsa
  2010-04-14 13:00 ` [PATCH 1/2] tracing: adding lost-events option Jiri Olsa
  2010-04-14 13:00 ` [PATCH 2/2] tracing: supress lost events message for iterator "trace" Jiri Olsa
@ 2010-04-14 15:11 ` Steven Rostedt
  2010-04-14 16:00   ` Ingo Molnar
  2 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2010-04-14 15:11 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: mingo, fweisbec, linux-kernel, Lai Jiangshan

On Wed, 2010-04-14 at 15:00 +0200, Jiri Olsa wrote:
> hi,
> 
> I noticed LOST EVENTS messages in the iterator "trace" file.
> According to the comment from commit bc21b478 this won't work.
> 
> <comment>
>     Note, it does not work with the iterator "trace" file, since it requires
>     the use of consuming the page from the ring buffer to determine how many
>     events were lost, which the iterator does not do.
> </comment>
> 
> I'm not sure the attached fix (2/2) is on the right place,
> but stops the LOST EVENTS display for iterator "trace" file.
> 

This has already been fixed by Lai:

http://marc.info/?l=linux-kernel&m=127045871922996

And I asked Ingo to pull it here:

http://marc.info/?l=linux-kernel&m=127048065715829

> I also added option to control the LOST EVENTS display (1/2) if needed.

Hmm, I'm not sure we want to control it. It is very useful information.

Thanks,

-- Steve

> 
> attached patches:
> - 1/2 - adding lost-events option
> - 2/2 - supress lost events message for iterator "trace"
> 
> 
> wbr,
> jirka
> ---
>  kernel/trace/trace.c |   24 ++++++++++++++----------
>  kernel/trace/trace.h |    1 +
>  2 files changed, 15 insertions(+), 10 deletions(-)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: lost events changes
  2010-04-14 15:11 ` [PATCH 0/2] tracing: lost events changes Steven Rostedt
@ 2010-04-14 16:00   ` Ingo Molnar
  2010-04-14 16:15     ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2010-04-14 16:00 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Jiri Olsa, fweisbec, linux-kernel, Lai Jiangshan


* Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 2010-04-14 at 15:00 +0200, Jiri Olsa wrote:
> > hi,
> > 
> > I noticed LOST EVENTS messages in the iterator "trace" file.
> > According to the comment from commit bc21b478 this won't work.
> > 
> > <comment>
> >     Note, it does not work with the iterator "trace" file, since it requires
> >     the use of consuming the page from the ring buffer to determine how many
> >     events were lost, which the iterator does not do.
> > </comment>
> > 
> > I'm not sure the attached fix (2/2) is on the right place,
> > but stops the LOST EVENTS display for iterator "trace" file.
> > 
> 
> This has already been fixed by Lai:
> 
> http://marc.info/?l=linux-kernel&m=127045871922996
> 
> And I asked Ingo to pull it here:
> 
> http://marc.info/?l=linux-kernel&m=127048065715829

Yeah - i pulled it earlier today and pushed it out about two hours ago.

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] tracing: lost events changes
  2010-04-14 16:00   ` Ingo Molnar
@ 2010-04-14 16:15     ` Steven Rostedt
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2010-04-14 16:15 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Jiri Olsa, fweisbec, linux-kernel, Lai Jiangshan

On Wed, 2010-04-14 at 18:00 +0200, Ingo Molnar wrote:
\
> > This has already been fixed by Lai:
> > 
> > http://marc.info/?l=linux-kernel&m=127045871922996
> > 
> > And I asked Ingo to pull it here:
> > 
> > http://marc.info/?l=linux-kernel&m=127048065715829
> 
> Yeah - i pulled it earlier today and pushed it out about two hours ago.

Thanks Ingo!

-- Steve



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-14 16:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14 13:00 [PATCH 0/2] tracing: lost events changes Jiri Olsa
2010-04-14 13:00 ` [PATCH 1/2] tracing: adding lost-events option Jiri Olsa
2010-04-14 13:00 ` [PATCH 2/2] tracing: supress lost events message for iterator "trace" Jiri Olsa
2010-04-14 15:11 ` [PATCH 0/2] tracing: lost events changes Steven Rostedt
2010-04-14 16:00   ` Ingo Molnar
2010-04-14 16:15     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox