aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-record.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 072aaf0369f8..68a9be0d1513 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -43,6 +43,7 @@ static int call_graph = 0;
43static int verbose = 0; 43static int verbose = 0;
44static int inherit_stat = 0; 44static int inherit_stat = 0;
45static int no_samples = 0; 45static int no_samples = 0;
46static int sample_address = 0;
46 47
47static long samples; 48static long samples;
48static struct timeval last_read; 49static struct timeval last_read;
@@ -405,6 +406,9 @@ static void create_counter(int counter, int cpu, pid_t pid)
405 if (inherit_stat) 406 if (inherit_stat)
406 attr->inherit_stat = 1; 407 attr->inherit_stat = 1;
407 408
409 if (sample_address)
410 attr->sample_type |= PERF_SAMPLE_ADDR;
411
408 if (call_graph) 412 if (call_graph)
409 attr->sample_type |= PERF_SAMPLE_CALLCHAIN; 413 attr->sample_type |= PERF_SAMPLE_CALLCHAIN;
410 414
@@ -649,6 +653,8 @@ static const struct option options[] = {
649 "be more verbose (show counter open errors, etc)"), 653 "be more verbose (show counter open errors, etc)"),
650 OPT_BOOLEAN('s', "stat", &inherit_stat, 654 OPT_BOOLEAN('s', "stat", &inherit_stat,
651 "per thread counts"), 655 "per thread counts"),
656 OPT_BOOLEAN('d', "data", &sample_address,
657 "Sample addresses"),
652 OPT_BOOLEAN('n', "no-samples", &no_samples, 658 OPT_BOOLEAN('n', "no-samples", &no_samples,
653 "don't sample"), 659 "don't sample"),
654 OPT_END() 660 OPT_END()