Skip to contentSkip to conversation

perf script: Print callchains and symbols if they exist

PATCH In review David Ahern 2 participants 2 messages Nov 15, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf script: Print callchains and symbols if they exist

The intent of perf-script is to dump the events and information in the file. H/W, S/W and raw events all dump callchains if they are present; might as well make that the default for tracepoints too.

Cc Frederic Weisbecker <[email protected]>
---
 tools/perf/builtin-script.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/builtin-script.c +3 -1
index baf17989a216..6f96f8414047 100644
@@ -99,7 +99,9 @@ static struct {
 
 		.fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
 				  PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
-				  PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE,
+				  PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE |
+			      PERF_OUTPUT_IP | PERF_OUTPUT_SYM |
+				  PERF_OUTPUT_DSO,
 	},
 
 	[PERF_TYPE_RAW] = {
Signature · 1 line
1.8.3.4 (Apple Git-47)
#1 lore raw

2013/11/15 David Ahern <[email protected]>:

Quoted 16 lines

The intent of perf-script is to dump the events and information in the file. H/W, S/W and raw events all dump callchains if they are present; might as well make that the default for tracepoints too.

Cc Frederic Weisbecker <[email protected]>
---
 tools/perf/builtin-script.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/builtin-script.c +0 -0
index baf17989a216..6f96f8414047 100644

tools/perf/builtin-script.c static struct { · line 104

Quoted 7 lines
tools/perf/builtin-script.c +3 -1
@@ -99,7 +99,9 @@ static struct {
 
                .fields = PERF_OUTPUT_COMM | PERF_OUTPUT_TID |
                                  PERF_OUTPUT_CPU | PERF_OUTPUT_TIME |
-                                 PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE,
+                                 PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE |
+                             PERF_OUTPUT_IP | PERF_OUTPUT_SYM |
+                                 PERF_OUTPUT_DSO,

Right it's important to dump callchains on tracepoint by default.

DSO are not important though because tracepoints always happen in the kernel anyway. Although there is uprobes now hmm....

Same for ip/sym, most of the time the ip where the event happened is not that relevant because it's often called from a same helper. If SYM is required to dump callchains, I suggest that we only enable SYM when callchains are present. Or have a seperate PERF_OUTPOUT symbol for that may be.

Thanks.