aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2013-01-24 10:10:31 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-04-01 11:15:59 -0400
commitd6be9ad6c960f43800a6f118932bc8a5a4eadcd1 (patch)
tree4b3a888665a729d2ccfd06c9bab532aaa7955e44 /kernel
parentc3feedf2aaf9ac8bad6f19f5d21e4ee0b4b87e9c (diff)
perf: Add generic memory sampling interface
This patch adds PERF_SAMPLE_DATA_SRC. PERF_SAMPLE_DATA_SRC collects the data source, i.e., where did the data associated with the sampled instruction come from. Information is stored in a perf_mem_data_src structure. It contains opcode, mem level, tlb, snoop, lock information, subject to availability in hardware. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: peterz@infradead.org Cc: ak@linux.intel.com Cc: acme@redhat.com Cc: jolsa@redhat.com Cc: namhyung.kim@lge.com Link: http://lkml.kernel.org/r/1359040242-8269-8-git-send-email-eranian@google.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 9e3edb272b3e..77c96d18c23a 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -982,6 +982,9 @@ static void perf_event__header_size(struct perf_event *event)
982 if (sample_type & PERF_SAMPLE_READ) 982 if (sample_type & PERF_SAMPLE_READ)
983 size += event->read_size; 983 size += event->read_size;
984 984
985 if (sample_type & PERF_SAMPLE_DATA_SRC)
986 size += sizeof(data->data_src.val);
987
985 event->header_size = size; 988 event->header_size = size;
986} 989}
987 990
@@ -4199,6 +4202,9 @@ void perf_output_sample(struct perf_output_handle *handle,
4199 4202
4200 if (sample_type & PERF_SAMPLE_WEIGHT) 4203 if (sample_type & PERF_SAMPLE_WEIGHT)
4201 perf_output_put(handle, data->weight); 4204 perf_output_put(handle, data->weight);
4205
4206 if (sample_type & PERF_SAMPLE_DATA_SRC)
4207 perf_output_put(handle, data->data_src.val);
4202} 4208}
4203 4209
4204void perf_prepare_sample(struct perf_event_header *header, 4210void perf_prepare_sample(struct perf_event_header *header,