Skip to contentSkip to conversation

perf header: Display missing features

tip:perf/core tip-bot for Jiri Olsa 1 participant 1 message Oct 24, 2016 perf events

lore
Share & tools
lore

tip-bot for Jiri Olsa

author merge bot
#0 lore raw
Commit-ID:  aabae165759994d1b9bca1fac7759f1d8bef5dad
Gitweb:     http://git.kernel.org/tip/aabae165759994d1b9bca1fac7759f1d8bef5dad
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 10 Oct 2016 09:35:50 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 24 Oct 2016 11:07:34 -0300

perf header: Display missing features

Display missing features in header info, like:

  $ perf report --header-only
  # ========
  # captured on: Mon Oct 10 09:39:47 2016
  ...
  # missing features: HEADER_TRACING_DATA HEADER_CPU_TOPOLOGY ...

To help in diagnosing problems.

---
 tools/perf/util/header.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tools/perf/util/header.c +9 -1
index 05f5627..d6310c6 100644
@@ -2251,7 +2251,7 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full)
 	struct perf_header *header = &session->header;
 	int fd = perf_data_file__fd(session->file);
 	struct stat st;
-	int ret;
+	int ret, bit;
 
 	hd.fp = fp;
 	hd.full = full;
@@ -2264,6 +2264,14 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full)
 
 	perf_header__process_sections(header, fd, &hd,
 				      perf_file_section__fprintf_info);
+
+	fprintf(fp, "# missing features: ");
+	for_each_clear_bit(bit, header->adds_features, HEADER_LAST_FEATURE) {
+		if (bit)
+			fprintf(fp, "%s ", feat_ops[bit].name);
+	}
+
+	fprintf(fp, "\n");
 	return 0;
 }