lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 6 Oct 2015 21:55:01 +0200 From: Jiri Olsa <jolsa@...nel.org> To: Arnaldo Carvalho de Melo <acme@...nel.org> Cc: lkml <linux-kernel@...r.kernel.org>, David Ahern <dsahern@...il.com>, Ingo Molnar <mingo@...nel.org>, Namhyung Kim <namhyung@...nel.org>, Peter Zijlstra <a.p.zijlstra@...llo.nl>, "Liang, Kan" <kan.liang@...el.com> Subject: [PATCH 22/56] perf tools: Add perf_event__fprintf_attr_update function To display attr_update event for raw dump. Link: http://lkml.kernel.org/n/tip-ch2nor544486ppvwscqg55ik@git.kernel.org Signed-off-by: Jiri Olsa <jolsa@...nel.org> --- tools/perf/util/header.c | 25 +++++++++++++++++++++++++ tools/perf/util/header.h | 1 + 2 files changed, 26 insertions(+) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 2009f1fd1188..f35e8355cb1f 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2760,6 +2760,31 @@ perf_event__synthesize_attr_update_name(struct perf_tool *tool, return err; } +size_t perf_event__fprintf_attr_update(union perf_event *event, FILE *fp) +{ + struct attr_update_event *ev = &event->attr_update; + size_t ret; + + ret = fprintf(fp, "\n... id: %" PRIu64 "\n", ev->id); + + switch (ev->type) { + case PERF_ATTR_UPDATE__SCALE: + ret += fprintf(fp, "... scale: %f\n", ev->scale); + break; + case PERF_ATTR_UPDATE__UNIT: + ret += fprintf(fp, "... unit: %s\n", ev->str); + break; + case PERF_ATTR_UPDATE__NAME: + ret += fprintf(fp, "... name: %s\n", ev->str); + break; + default: + ret += fprintf(fp, "... unknown type\n"); + break; + } + + return ret; +} + int perf_event__synthesize_attrs(struct perf_tool *tool, struct perf_session *session, perf_event__handler_t process) diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index cb538ade38d3..d39fd61db4c0 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -119,6 +119,7 @@ int perf_event__process_attr(struct perf_tool *tool, union perf_event *event, int perf_event__process_attr_update(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_evlist **pevlist); +size_t perf_event__fprintf_attr_update(union perf_event *event, FILE *fp); int perf_event__synthesize_tracing_data(struct perf_tool *tool, int fd, struct perf_evlist *evlist, -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists