[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1497534989-29231-4-git-send-email-eranian@google.com>
Date: Thu, 15 Jun 2017 06:56:27 -0700
From: Stephane Eranian <eranian@...gle.com>
To: linux-kernel@...r.kernel.org
Cc: acme@...hat.com, peterz@...radead.org, mingo@...e.hu,
ak@...ux.intel.com, kan.liang@...el.com, jolsa@...hat.com
Subject: [PATCH 3/5] perf/tools: add support for PERF_SAMPLE_SKID_IP
This patch adds the support code to handle the PERF_SAMPLE_SKID_IP
record type.
Signed-off-by: Stephane Eranian <eranian@...gle.com>
---
tools/include/uapi/linux/perf_event.h | 4 +++-
tools/perf/perf.h | 1 +
tools/perf/util/event.h | 1 +
tools/perf/util/evsel.c | 11 ++++++++++-
tools/perf/util/session.c | 3 +++
5 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index b1c0b187acfe..0ebb6bee75a9 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -139,8 +139,9 @@ enum perf_event_sample_format {
PERF_SAMPLE_IDENTIFIER = 1U << 16,
PERF_SAMPLE_TRANSACTION = 1U << 17,
PERF_SAMPLE_REGS_INTR = 1U << 18,
+ PERF_SAMPLE_SKID_IP = 1U << 19,
- PERF_SAMPLE_MAX = 1U << 19, /* non-ABI */
+ PERF_SAMPLE_MAX = 1U << 20, /* non-ABI */
};
/*
@@ -791,6 +792,7 @@ enum perf_event_type {
* { u64 transaction; } && PERF_SAMPLE_TRANSACTION
* { u64 abi; # enum perf_sample_regs_abi
* u64 regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
+ * { u64 skid_ip; } && PERF_SAMPLE_SKID_IP
* };
*/
PERF_RECORD_SAMPLE = 9,
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 806c216a1078..64ce89a61f8c 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -57,6 +57,7 @@ struct record_opts {
bool tail_synthesize;
bool overwrite;
bool ignore_missing_thread;
+ bool skid_ip;
unsigned int freq;
unsigned int mmap_pages;
unsigned int auxtrace_mmap_pages;
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 7c3fa1c8cbcd..f19bf5e5696c 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -199,6 +199,7 @@ struct perf_sample {
u32 cpu;
u32 raw_size;
u64 data_src;
+ u64 skid_ip;
u32 flags;
u16 insn_len;
u8 cpumode;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index e4f7902d5afa..08d71e83bd07 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -937,6 +937,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
if (opts->sample_weight)
perf_evsel__set_sample_bit(evsel, WEIGHT);
+ if (opts->skid_ip)
+ perf_evsel__set_sample_bit(evsel, SKID_IP);
+
attr->task = track;
attr->mmap = track;
attr->mmap2 = track && !perf_missing_features.mmap2;
@@ -1319,7 +1322,7 @@ static void __p_sample_type(char *buf, size_t size, u64 value)
bit_name(PERIOD), bit_name(STREAM_ID), bit_name(RAW),
bit_name(BRANCH_STACK), bit_name(REGS_USER), bit_name(STACK_USER),
bit_name(IDENTIFIER), bit_name(REGS_INTR), bit_name(DATA_SRC),
- bit_name(WEIGHT),
+ bit_name(WEIGHT), bit_name(SKID_IP),
{ .name = NULL, }
};
#undef bit_name
@@ -2043,6 +2046,12 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
}
}
+ data->skid_ip = 0;
+ if (type & PERF_SAMPLE_SKID_IP) {
+ data->skid_ip = *array;
+ array++;
+ }
+
return 0;
}
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 7dc1096264c5..0bfc1051c708 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1123,6 +1123,9 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event,
if (sample_type & PERF_SAMPLE_READ)
sample_read__printf(sample, evsel->attr.read_format);
+
+ if (sample_type & PERF_SAMPLE_SKID_IP)
+ printf("... skid_ip: %" PRIu64 "\n", sample->skid_ip);
}
static struct machine *machines__find_for_cpumode(struct machines *machines,
--
2.13.1.518.g3df882009-goog
Powered by blists - more mailing lists