diff options
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index adce442dd603..9ee976dc395b 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -61,8 +61,6 @@ static int cleanup_scripting(void) | |||
61 | 61 | ||
62 | static char const *input_name = "perf.data"; | 62 | static char const *input_name = "perf.data"; |
63 | 63 | ||
64 | static u64 sample_type; | ||
65 | |||
66 | static int process_sample_event(event_t *event, struct perf_session *session) | 64 | static int process_sample_event(event_t *event, struct perf_session *session) |
67 | { | 65 | { |
68 | struct sample_data data; | 66 | struct sample_data data; |
@@ -73,7 +71,7 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
73 | data.cpu = -1; | 71 | data.cpu = -1; |
74 | data.period = 1; | 72 | data.period = 1; |
75 | 73 | ||
76 | event__parse_sample(event, sample_type, &data); | 74 | event__parse_sample(event, session->sample_type, &data); |
77 | 75 | ||
78 | dump_printf("(IP, %d): %d/%d: %p period: %Ld\n", | 76 | dump_printf("(IP, %d): %d/%d: %p period: %Ld\n", |
79 | event->header.misc, | 77 | event->header.misc, |
@@ -88,7 +86,7 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
88 | return -1; | 86 | return -1; |
89 | } | 87 | } |
90 | 88 | ||
91 | if (sample_type & PERF_SAMPLE_RAW) { | 89 | if (session->sample_type & PERF_SAMPLE_RAW) { |
92 | /* | 90 | /* |
93 | * FIXME: better resolve from pid from the struct trace_entry | 91 | * FIXME: better resolve from pid from the struct trace_entry |
94 | * field, although it should be the same than this perf | 92 | * field, although it should be the same than this perf |
@@ -103,11 +101,9 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
103 | return 0; | 101 | return 0; |
104 | } | 102 | } |
105 | 103 | ||
106 | static int sample_type_check(u64 type, struct perf_session *session __used) | 104 | static int sample_type_check(struct perf_session *session) |
107 | { | 105 | { |
108 | sample_type = type; | 106 | if (!(session->sample_type & PERF_SAMPLE_RAW)) { |
109 | |||
110 | if (!(sample_type & PERF_SAMPLE_RAW)) { | ||
111 | fprintf(stderr, | 107 | fprintf(stderr, |
112 | "No trace sample to read. Did you call perf record " | 108 | "No trace sample to read. Did you call perf record " |
113 | "without -R?"); | 109 | "without -R?"); |