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 linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 5 Nov 2012 14:50:51 +0100 From: Stephane Eranian <eranian@...gle.com> To: linux-kernel@...r.kernel.org Cc: peterz@...radead.org, mingo@...e.hu, ak@...ux.intel.com, acme@...hat.com, jolsa@...hat.com, namhyung.kim@....com Subject: [PATCH v2 04/16] perf: add minimal support for PERF_SAMPLE_WEIGHT Ensure we grab the weight from raw sample struct and that we can dump it via perf report -D. Signed-off-by: Stephane Eranian <eranian@...gle.com> --- tools/perf/util/event.h | 1 + tools/perf/util/evsel.c | 5 +++++ tools/perf/util/session.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 0d573ff..cf52977 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -90,6 +90,7 @@ struct perf_sample { u64 period; u32 cpu; u32 raw_size; + u64 weight; void *raw_data; struct ip_callchain *callchain; struct branch_stack *branch_stack; diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 618d411..b6f3697 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1020,6 +1020,11 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, } } + if (type & PERF_SAMPLE_WEIGHT) { + data->weight= *array; + array++; + } + return 0; } diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 15abe40..962c04f 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1006,6 +1006,9 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event, if (sample_type & PERF_SAMPLE_STACK_USER) stack_user__printf(&sample->user_stack); + + if (sample_type & PERF_SAMPLE_WEIGHT) + printf(" ... weight: %"PRIu64"\n", sample->weight); } static struct machine * -- 1.7.9.5 -- 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