Skip to contentSkip to conversation

perf: let trace write to stderr by default

PATCH In review Milian Wolff 2 participants 4 messages Aug 4, 2015 – Aug 5, 2015 1 message not in the archive perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: let trace write to stderr by default

See attached trivial patch which brings trace a bit closer to strace.

I've never published a patch to the Kernel yet, I hope it's OK as-is. I can amend it at will if you have any requests to the style.

Cheers

Signature · 3 lines
Milian Wolff
[email protected]
http://milianw.de

From 188476d65bab17ad99f5bdf65294160ef2d5f49b Mon Sep 17 00:00:00 2001
From: Milian Wolff <[email protected]>
Date: Tue, 4 Aug 2015 18:30:52 +0200
Subject: [PATCH] perf: let trace write to stderr by default

Without this patch, it is cumbersome to read the trace output but ignoring the normal, potentially verbose, output of the debuggee. One common example is doing something like the following:

perf trace -s find /tmp > /dev/null

Without this patch, the trace summary will be lost. Now, it will still be printed at the end. This behavior is also applied by strace.

---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-trace.c +1 -1
index 39ad4d0..d183d88 100644
@@ -2778,7 +2778,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
 			.mmap_pages    = UINT_MAX,
 			.proc_map_timeout  = 500,
 		},
-		.output = stdout,
+		.output = stderr,
 		.show_comm = true,
 		.trace_syscalls = true,
 	};
Signature · 1 line
2.5.0

A message that is not in the archive (sent off-list or not yet received): CA+JHD92yJxikRUQ57Hb+C4pZ12gcFAn6paWenbAY5FbwtgQFDg@mail.gmail.com

#2 lore raw
Quoted 10 lines · On Tuesday 04 August 2015 13:50:14 Arnaldo Carvalho de Melo wrote:
Quoted 3 lines · Milian Wolff

See attached trivial patch which brings trace a bit closer to strace.

I've never published a patch to the Kernel yet, I hope it's OK as-is. I

can

Quoted 1 line

amend it at will if you have any requests to the style

Start by not using attachments :-)

:)

From 188476d65bab17ad99f5bdf65294160ef2d5f49b Mon Sep 17 00:00:00 2001
From: Milian Wolff <[email protected]>
Date: Tue, 4 Aug 2015 18:30:52 +0200
Subject: [PATCH] perf: let trace write to stderr by default

Without this patch, it is cumbersome to read the trace output but ignoring the normal, potentially verbose, output of the debuggee. One common example is doing something like the following:

perf trace -s find /tmp > /dev/null

Without this patch, the trace summary will be lost. Now, it will still be printed at the end. This behavior is also applied by strace.

---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-trace.c +0 -0
index 39ad4d0..d183d88 100644
@@ -2778,7 +2778,7 @@ int cmd_trace(int argc, const char **argv, const char 

*prefix __maybe_unused)
.mmap_pages = UINT_MAX,
.proc_map_timeout = 500,
},
- .output = stdout,
+ .output = stderr,
.show_comm = true,
.trace_syscalls = true,
};

Signature · 6 lines
2.5.0

-- 
Milian Wolff
[email protected]
http://milianw.de
#3 lore raw

Em Tue, Aug 04, 2015 at 07:14:22PM +0200, Milian Wolff escreveu:

Quoted 6 lines · On Tuesday 04 August 2015 13:50:14 Arnaldo Carvalho de Melo wrote:
Quoted 5 lines · Milian Wolff
Quoted 3 lines

See attached trivial patch which brings trace a bit closer to strace.

I've never published a patch to the Kernel yet, I hope it's OK as-is. I

Quoted 7 lines
Quoted 5 lines

can

Quoted 1 line

amend it at will if you have any requests to the style

Start by not using attachments :-)

:)

Second step, read Documentation/email-clients.txt, you are using Kmail and it is mangling the patches, I'll apply the patch by hand this time.

- Arnaldo

Quoted 38 lines
Quoted 1 line

From 188476d65bab17ad99f5bdf65294160ef2d5f49b Mon Sep 17 00:00:00 2001

From: Milian Wolff <[email protected]>
Date: Tue, 4 Aug 2015 18:30:52 +0200
Subject: [PATCH] perf: let trace write to stderr by default

Without this patch, it is cumbersome to read the trace output but ignoring the normal, potentially verbose, output of the debuggee. One common example is doing something like the following:

perf trace -s find /tmp > /dev/null

Without this patch, the trace summary will be lost. Now, it will still be printed at the end. This behavior is also applied by strace.

---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-trace.c +1 -1
index 39ad4d0..d183d88 100644
@@ -2778,7 +2778,7 @@ int cmd_trace(int argc, const char **argv, const char 
 *prefix __maybe_unused)
 			.mmap_pages    = UINT_MAX,
 			.proc_map_timeout  = 500,
 		},
-		.output = stdout,
+		.output = stderr,
 		.show_comm = true,
 		.trace_syscalls = true,

};

Signature · 6 lines
2.5.0

-- 
Milian Wolff
[email protected]
http://milianw.de
#4 lore raw

Em Wed, Aug 05, 2015 at 04:50:06PM -0300, Arnaldo Carvalho de Melo escreveu:

Quoted 9 lines

Em Tue, Aug 04, 2015 at 07:14:22PM +0200, Milian Wolff escreveu:

Quoted 8 lines · On Tuesday 04 August 2015 13:50:14 Arnaldo Carvalho de Melo wrote:
Quoted 7 lines · Milian Wolff
Quoted 3 lines

See attached trivial patch which brings trace a bit closer to strace.

I've never published a patch to the Kernel yet, I hope it's OK as-is. I

can

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

amend it at will if you have any requests to the style

Start by not using attachments :-)

:)

Second step, read Documentation/email-clients.txt, you are using Kmail and it is mangling the patches, I'll apply the patch by hand this time.

And don't forget to read Documentation/SubmittingPatches, you forgot the Signed-off-by part as well. It is simple stuff, so I'll not add it, keep your authorship and sign it off myself.

Quoted 40 lines

- Arnaldo

Quoted 38 lines
Quoted 1 line

From 188476d65bab17ad99f5bdf65294160ef2d5f49b Mon Sep 17 00:00:00 2001

From: Milian Wolff <[email protected]>
Date: Tue, 4 Aug 2015 18:30:52 +0200
Subject: [PATCH] perf: let trace write to stderr by default

Without this patch, it is cumbersome to read the trace output but ignoring the normal, potentially verbose, output of the debuggee. One common example is doing something like the following:

perf trace -s find /tmp > /dev/null

Without this patch, the trace summary will be lost. Now, it will still be printed at the end. This behavior is also applied by strace.

---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-trace.c +1 -1
index 39ad4d0..d183d88 100644
@@ -2778,7 +2778,7 @@ int cmd_trace(int argc, const char **argv, const char 
 *prefix __maybe_unused)
 			.mmap_pages    = UINT_MAX,
 			.proc_map_timeout  = 500,
 		},
-		.output = stdout,
+		.output = stderr,
 		.show_comm = true,
 		.trace_syscalls = true,

};

Signature · 6 lines
2.5.0

-- 
Milian Wolff
[email protected]
http://milianw.de