aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-12-08 05:50:24 -0500
committerIngo Molnar <mingo@kernel.org>2014-12-08 05:50:24 -0500
commit2a2662bf88e693d477ef08351d03934f7bc0b51c (patch)
treecef243df159cc12ada7e97998a253df7c0abb2a2 /tools/perf/builtin-record.c
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
parent36748b9518a2437beffe861b47dff6d12b736b3f (diff)
Merge branch 'perf/core-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into perf/hw_breakpoints
Pull AMD range breakpoints support from Frederic Weisbecker: " - Extend breakpoint tools and core to support address range through perf event with initial backend support for AMD extended breakpoints. Syntax is: perf record -e mem:addr/len:type For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512) perf record -e mem:0x1000/512:w - Clean up a bit breakpoint code validation It has been acked by Jiri and Oleg. " Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 2583a9b04317..8648c6d3003d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -200,6 +200,17 @@ static int process_buildids(struct record *rec)
200 if (size == 0) 200 if (size == 0)
201 return 0; 201 return 0;
202 202
203 /*
204 * During this process, it'll load kernel map and replace the
205 * dso->long_name to a real pathname it found. In this case
206 * we prefer the vmlinux path like
207 * /lib/modules/3.16.4/build/vmlinux
208 *
209 * rather than build-id path (in debug directory).
210 * $HOME/.debug/.build-id/f0/6e17aa50adf4d00b88925e03775de107611551
211 */
212 symbol_conf.ignore_vmlinux_buildid = true;
213
203 return __perf_session__process_events(session, start, 214 return __perf_session__process_events(session, start,
204 size - start, 215 size - start,
205 size, &build_id__mark_dso_hit_ops); 216 size, &build_id__mark_dso_hit_ops);
@@ -680,11 +691,12 @@ static int perf_record_config(const char *var, const char *value, void *cb)
680 return perf_default_config(var, value, cb); 691 return perf_default_config(var, value, cb);
681} 692}
682 693
683static const char * const record_usage[] = { 694static const char * const __record_usage[] = {
684 "perf record [<options>] [<command>]", 695 "perf record [<options>] [<command>]",
685 "perf record [<options>] -- <command> [<options>]", 696 "perf record [<options>] -- <command> [<options>]",
686 NULL 697 NULL
687}; 698};
699const char * const *record_usage = __record_usage;
688 700
689/* 701/*
690 * XXX Ideally would be local to cmd_record() and passed to a record__new 702 * XXX Ideally would be local to cmd_record() and passed to a record__new
@@ -725,7 +737,7 @@ const char record_callchain_help[] = CALLCHAIN_HELP "fp";
725 * perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record', 737 * perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
726 * using pipes, etc. 738 * using pipes, etc.
727 */ 739 */
728const struct option record_options[] = { 740struct option __record_options[] = {
729 OPT_CALLBACK('e', "event", &record.evlist, "event", 741 OPT_CALLBACK('e', "event", &record.evlist, "event",
730 "event selector. use 'perf list' to list available events", 742 "event selector. use 'perf list' to list available events",
731 parse_events_option), 743 parse_events_option),
@@ -799,9 +811,13 @@ const struct option record_options[] = {
799 "sample transaction flags (special events only)"), 811 "sample transaction flags (special events only)"),
800 OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread, 812 OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
801 "use per-thread mmaps"), 813 "use per-thread mmaps"),
814 OPT_BOOLEAN('I', "intr-regs", &record.opts.sample_intr_regs,
815 "Sample machine registers on interrupt"),
802 OPT_END() 816 OPT_END()
803}; 817};
804 818
819struct option *record_options = __record_options;
820
805int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) 821int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
806{ 822{
807 int err = -ENOMEM; 823 int err = -ENOMEM;