[PATCH 64/68] perf header: Display feature name on write failure
From: Arnaldo Carvalho de Melo
Date: Tue Oct 11 2016 - 13:39:27 EST
From: Jiri Olsa <jolsa@xxxxxxxxxx>
Display name of feature instead of just the number
during recording data.
Before:
failed to write feature 13
Now:
failed to write feature HEADER_CPU_TOPOLOGY
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-k9d9trozi5kkx737cy8n5xh5@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/header.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 59b67aefa8b2..43ded20f1edf 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2290,7 +2290,7 @@ static int do_write_feat(int fd, struct perf_header *h, int type,
err = feat_ops[type].write(fd, h, evlist);
if (err < 0) {
- pr_debug("failed to write feature %d\n", type);
+ pr_debug("failed to write feature %s\n", feat_ops[type].name);
/* undo anything written */
lseek(fd, (*p)->offset, SEEK_SET);
--
2.7.4