summaryrefslogtreecommitdiff
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-30 00:13:56 +0300
committerIngo Molnar <mingo@kernel.org>2017-08-30 00:13:56 +0300
commit1b2f76d77a277bb70d38ad0991ed7f16bbc115a9 (patch)
treeb02f9b167b1c1b9df860f480b45523c70ef52acf /tools/perf/util/session.c
parent5da382eb6ea37e2c49ef521c636d73f6ecc3fa81 (diff)
parentb2f7605076d6cdd68162c42c34caadafbbe4c69f (diff)
downloadlinux-1b2f76d77a277bb70d38ad0991ed7f16bbc115a9.tar.xz
Merge tag 'perf-core-for-mingo-4.14-20170829' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: - Fix remote HITM detection for Skylake in 'perf c2c' (Jiri Olsa) - Fixes for the handling of PERF_RECORD_READ records (Jiri Olsa) - Fix kprobes blackist symbol lookup in 'perf probe' (Li Bin) - The PLT header and entry sizes are not the same in !x86, fix it for ARM and AARCH64 (Li Bin) - Beautify pkey_{alloc,free,mprotect} arguments in 'perf trace' (Arnaldo Carvalho de Melo) - Fix CC, AR, LD external definition, allow flex and bison to be externally defined and other related Makefile fixes (David Carrillo-Cisneros) - Sync CPU features kernel ABI headers with tooling headers (Arnaldo Carvalho de Melo) - Fix path to PMU formats in 'perf stat' documentation (Jack Henschel) - Fix static build with newer toolchains (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index dc453f84a14c..ac863691605f 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1127,6 +1127,30 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event,
sample_read__printf(sample, evsel->attr.read_format);
}
+static void dump_read(struct perf_evsel *evsel, union perf_event *event)
+{
+ struct read_event *read_event = &event->read;
+ u64 read_format;
+
+ if (!dump_trace)
+ return;
+
+ printf(": %d %d %s %" PRIu64 "\n", event->read.pid, event->read.tid,
+ evsel ? perf_evsel__name(evsel) : "FAIL",
+ event->read.value);
+
+ read_format = evsel->attr.read_format;
+
+ if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
+ printf("... time enabled : %" PRIu64 "\n", read_event->time_enabled);
+
+ if (read_format & PERF_FORMAT_TOTAL_TIME_RUNNING)
+ printf("... time running : %" PRIu64 "\n", read_event->time_running);
+
+ if (read_format & PERF_FORMAT_ID)
+ printf("... id : %" PRIu64 "\n", read_event->id);
+}
+
static struct machine *machines__find_for_cpumode(struct machines *machines,
union perf_event *event,
struct perf_sample *sample)
@@ -1271,6 +1295,7 @@ static int machines__deliver_event(struct machines *machines,
evlist->stats.total_lost_samples += event->lost_samples.lost;
return tool->lost_samples(tool, event, sample, machine);
case PERF_RECORD_READ:
+ dump_read(evsel, event);
return tool->read(tool, event, sample, evsel, machine);
case PERF_RECORD_THROTTLE:
return tool->throttle(tool, event, sample, machine);