diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-stat.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 9805e03ab163..7f568244662b 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -184,11 +184,18 @@ static int create_perf_stat_counter(struct perf_evsel *evsel) | |||
184 | * like tracepoints. Clear it up for counting. | 184 | * like tracepoints. Clear it up for counting. |
185 | */ | 185 | */ |
186 | attr->sample_period = 0; | 186 | attr->sample_period = 0; |
187 | |||
187 | /* | 188 | /* |
188 | * But set sample_type to PERF_SAMPLE_IDENTIFIER, which should be harmless | 189 | * But set sample_type to PERF_SAMPLE_IDENTIFIER, which should be harmless |
189 | * while avoiding that older tools show confusing messages. | 190 | * while avoiding that older tools show confusing messages. |
191 | * | ||
192 | * However for pipe sessions we need to keep it zero, | ||
193 | * because script's perf_evsel__check_attr is triggered | ||
194 | * by attr->sample_type != 0, and we can't run it on | ||
195 | * stat sessions. | ||
190 | */ | 196 | */ |
191 | attr->sample_type = PERF_SAMPLE_IDENTIFIER; | 197 | if (!(STAT_RECORD && perf_stat.file.is_pipe)) |
198 | attr->sample_type = PERF_SAMPLE_IDENTIFIER; | ||
192 | 199 | ||
193 | /* | 200 | /* |
194 | * Disabling all counters initially, they will be enabled | 201 | * Disabling all counters initially, they will be enabled |