diff options
-rw-r--r-- | tools/perf/util/evsel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f664a22b5fea..04fddddc6b6f 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -2158,8 +2158,13 @@ int perf_evsel__fprintf(struct perf_evsel *evsel, | |||
2158 | printed += perf_event_attr__fprintf(fp, &evsel->attr, | 2158 | printed += perf_event_attr__fprintf(fp, &evsel->attr, |
2159 | __print_attr__fprintf, &first); | 2159 | __print_attr__fprintf, &first); |
2160 | } else if (details->freq) { | 2160 | } else if (details->freq) { |
2161 | printed += comma_fprintf(fp, &first, " sample_freq=%" PRIu64, | 2161 | const char *term = "sample_freq"; |
2162 | (u64)evsel->attr.sample_freq); | 2162 | |
2163 | if (!evsel->attr.freq) | ||
2164 | term = "sample_period"; | ||
2165 | |||
2166 | printed += comma_fprintf(fp, &first, " %s=%" PRIu64, | ||
2167 | term, (u64)evsel->attr.sample_freq); | ||
2163 | } | 2168 | } |
2164 | out: | 2169 | out: |
2165 | fputc('\n', fp); | 2170 | fputc('\n', fp); |