Skip to contentSkip to conversation

Teach perf script about PERF_TYPE_RAW

PATCH New Arun Sharma 1 participant 1 message Mar 22, 2011 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Teach perf script about PERF_TYPE_RAW

Useful for getting stack traces for hardware events not handled by PERF_TYPE_HARDWARE.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tom Zanussi <[email protected]>
---
 tools/perf/builtin-script.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
tools/perf/builtin-script.c +7 -1
index 9f5fc54..97c66df 100644
@@ -61,6 +61,10 @@ static u64 output_fields[PERF_TYPE_MAX] = {
 	[PERF_TYPE_TRACEPOINT] = PERF_OUTPUT_COMM | PERF_OUTPUT_TID | \
 				 PERF_OUTPUT_CPU | PERF_OUTPUT_TIME | \
 				 PERF_OUTPUT_EVNAME | PERF_OUTPUT_TRACE,
+
+	[PERF_TYPE_RAW] = PERF_OUTPUT_COMM | PERF_OUTPUT_TID | \
+			  PERF_OUTPUT_CPU | PERF_OUTPUT_TIME | \
+			  PERF_OUTPUT_EVNAME | PERF_OUTPUT_SYM,
 };
 
 static bool output_set_by_user;
@@ -481,6 +485,8 @@ static int parse_output_fields(const struct option *opt __used,
 		type = PERF_TYPE_SOFTWARE;
 	else if (!strcmp(tok, "trace"))
 		type = PERF_TYPE_TRACEPOINT;
+	else if (!strcmp(tok, "raw"))
+		type = PERF_TYPE_RAW;
 	else {
 		fprintf(stderr, "Invalid event type in field string.");
 		return -EINVAL;
@@ -836,7 +842,7 @@ static const struct option options[] = {
 	OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
 		    "Look for files with symbols relative to this directory"),
 	OPT_CALLBACK('f', "fields", NULL, "str",
-		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace. Fields: comm,tid,pid,time,cpu,event,trace,sym",
+		     "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,sym",
 		     parse_output_fields),
 
 	OPT_END()
Signature · 9 lines
1.7.4


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar