Skip to contentSkip to conversation

tracing: various fixes

GIT PULL New Steven Rostedt 4 participants 11 messages Oct 17, 2011 – Oct 18, 2011 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Ingo,

Please pull the latest tip/perf/core tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/core

Head SHA1: 436fc280261dcfce5af38f08b89287750dc91cd2

Geunsik Lim (1):
ftrace: Fix README to state tracing_on to start/stop tracing

Steven Rostedt (1):
tracing: Fix returning of duplicate data after EOF in trace_pipe_raw

----

 kernel/trace/trace.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 ftrace: Fix README to state tracing_on to start/stop tracing

From: Geunsik Lim <[email protected]>

tracing_enabled option is deprecated.
To start/stop tracing, write to /sys/kernel/debug/tracing/tracing_on without tracing_enabled. This patch is based on Linux 3.1.0-rc1

---
 kernel/trace/trace.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace.c +2 -2
index f86efe9..cea1605 100644
@@ -2720,9 +2720,9 @@ static const char readme_msg[] =
 	"# cat /sys/kernel/debug/tracing/trace_options\n"
 	"noprint-parent nosym-offset nosym-addr noverbose\n"
 	"# echo print-parent > /sys/kernel/debug/tracing/trace_options\n"
-	"# echo 1 > /sys/kernel/debug/tracing/tracing_enabled\n"
+	"# echo 1 > /sys/kernel/debug/tracing/tracing_on\n"
 	"# cat /sys/kernel/debug/tracing/trace > /tmp/trace.txt\n"
-	"# echo 0 > /sys/kernel/debug/tracing/tracing_enabled\n"
+	"# echo 0 > /sys/kernel/debug/tracing/tracing_on\n"
 ;
 
 static ssize_t
Signature · 1 line
1.7.6.3
author maintainer
#2 lore raw

PATCH 2/2 tracing: Fix returning of duplicate data after EOF in trace_pipe_raw

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The trace_pipe_raw handler holds a cached page from the time the file is opened to the time it is closed. The cached page is used to handle the case of the user space buffer being smaller than what was read from the ring buffer. The left over buffer is held in the cache so that the next read will continue where the data left off.

After EOF is returned (no more data in the buffer), the index of the cached page is set to zero. If a user app reads the page again after EOF, the check in the buffer will see that the cached page is less than page size and will return the cached page again. This will cause reading the trace_pipe_raw again after EOF to return duplicate data, making the output look like the time went backwards but instead data is just repeated.

The fix is to not reset the index right after all data is read from the cache, but to reset it after all data is read and more data exists in the ring buffer.

---
 kernel/trace/trace.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace.c +2 -2
index cea1605..b24a72d 100644
@@ -3903,8 +3903,6 @@ tracing_buffers_read(struct file *filp, char __user *ubuf,
 	if (info->read < PAGE_SIZE)
 		goto read;
 
-	info->read = 0;
-
 	trace_access_lock(info->cpu);
 	ret = ring_buffer_read_page(info->tr->buffer,
 				    &info->spare,
@@ -3914,6 +3912,8 @@ tracing_buffers_read(struct file *filp, char __user *ubuf,
 	if (ret < 0)
 		return 0;
 
+	info->read = 0;
+
 read:
 	size = PAGE_SIZE - info->read;
 	if (size > count)
Signature · 1 line
1.7.6.3
#3 lore raw
In reply to Steven Rostedt
Quoted 14 lines · Steven Rostedt

Ingo,

Please pull the latest tip/perf/core tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/core

Head SHA1: 436fc280261dcfce5af38f08b89287750dc91cd2

Geunsik Lim (1):
ftrace: Fix README to state tracing_on to start/stop tracing

Quoted 6 lines

Steven Rostedt (1):
tracing: Fix returning of duplicate data after EOF in trace_pipe_raw

----

 kernel/trace/trace.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Pulled, thanks Steve.

How about the m32r build fix? I think we should apply it to perf/core if everyone else was fine with your fix.

Thanks,

Ingo

author maintainer
#4 lore raw
Quoted 2 lines · Ingo Molnar

How about the m32r build fix? I think we should apply it to perf/core if everyone else was fine with your fix.

Hmm, I saw a notice that Andrew pulled it into his -mm tree. Is it going that way?

Thanks!

-- Steve

#5 lore raw
Quoted 7 lines · Steven Rostedt
Quoted 2 lines · Ingo Molnar

How about the m32r build fix? I think we should apply it to perf/core if everyone else was fine with your fix.

Hmm, I saw a notice that Andrew pulled it into his -mm tree. Is it going that way?

No. It must go into perf/core to not open up a wide bisection breakage window. So please apply if it everyone is happy with it.

Thanks,

Ingo

author maintainer
#6 lore raw
Quoted 4 lines · Ingo Molnar
Quoted 2 lines · Steven Rostedt

On Mon, 2011-10-17 at 20:54 +0200, Ingo Molnar wrote:

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

How about the m32r build fix? I think we should apply it to perf/core if everyone else was fine with your fix.

Hmm, I saw a notice that Andrew pulled it into his -mm tree. Is it going that way?

No. It must go into perf/core to not open up a wide bisection breakage window. So please apply if it everyone is happy with it.

I could add it, but we should have an Acked-by from Hirokazu Takata.

I would also be interested in knowing if the latest kernel is running on any m32r hardware at the moment? There doesn't look to be much development on the m32r arch.

-- Steve

author maintainer
#9 lore raw
Quoted 9 lines · David Rientjes
Quoted 7 lines · Steven Rostedt
Quoted 1 line

I could add it, but we should have an Acked-by from Hirokazu Takata.

Here's the patch I'm referring to:

https://lkml.org/lkml/2011/10/13/259

Quoted 8 lines
Quoted 2 lines

Thanks!

This patch makes my m32r cross-compiler happy, so for that:

although the "Link:" field in that patch doesn't work for me.

OK, I'll add it with your Ack and a Cc to Hirokazu.

As for the link, it will work again when kernel.org has that operational again.

The Link: format is:

You can also find this at:

http://marc.info/?i=<message-id>

which would give you:

http://marc.info/[email protected]

-- Steve

#10 lore raw

Thank you.

-- Takata

From: Steven Rostedt <[email protected]>
Subject: Re: [PATCH 0/2] [GIT PULL][v3.2] tracing: various fixes
Date: Mon, 17 Oct 2011 20:09:49 -0400

Quoted 39 lines · David Rientjes
Quoted 9 lines · Steven Rostedt
Quoted 8 lines
Quoted 2 lines

I could add it, but we should have an Acked-by from Hirokazu Takata.

Here's the patch I'm referring to:

https://lkml.org/lkml/2011/10/13/259

Quoted 8 lines
Quoted 2 lines

Thanks!

This patch makes my m32r cross-compiler happy, so for that:

although the "Link:" field in that patch doesn't work for me.

OK, I'll add it with your Ack and a Cc to Hirokazu.

As for the link, it will work again when kernel.org has that operational again.

The Link: format is:

You can also find this at:

http://marc.info/?i=<message-id>

which would give you:

http://marc.info/[email protected]

-- Steve