* [PATCH 2/3] perf: Support setting the disassembler style
2011-09-15 21:31 [PATCH 1/3] perf: Make perf stat/record print fatal signals of the target program Andi Kleen
@ 2011-09-15 21:31 ` Andi Kleen
2011-09-16 14:27 ` Arnaldo Carvalho de Melo
2011-09-15 21:31 ` [PATCH 3/3] perf: Clarify -c help text Andi Kleen
1 sibling, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2011-09-15 21:31 UTC (permalink / raw)
To: acme; +Cc: linux-kernel, fweisbec, eranian, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Add -M option to report/annotate to pass directly to objdump.
This allows to use -M intel for intel style disassembler syntax,
which is useful for people who are very used to the Intel syntax.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/Documentation/perf-annotate.txt | 3 +++
tools/perf/Documentation/perf-report.txt | 3 +++
tools/perf/builtin-annotate.c | 2 ++
tools/perf/builtin-report.c | 2 ++
tools/perf/util/annotate.c | 6 +++++-
tools/perf/util/annotate.h | 2 ++
6 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 85c5f02..4a42c31 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -72,6 +72,9 @@ OPTIONS
CPUs are specified with -: 0-2. Default is to report samples on all
CPUs.
+-M::
+--disassembler-style=:: Set disassembler style for objdump.
+
SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-report[1]
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 04253c0..0407c8c 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -134,6 +134,9 @@ OPTIONS
CPUs are specified with -: 0-2. Default is to report samples on all
CPUs.
+-m::
+--disassembler-style=:: Set disassembler style for objdump.
+
SEE ALSO
--------
linkperf:perf-stat[1]
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 555aefd..5b0a0ac 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -267,6 +267,8 @@ static const struct option options[] = {
OPT_BOOLEAN('P', "full-paths", &full_paths,
"Don't shorten the displayed pathnames"),
OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
+ OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
+ "Specify disassembler style (e.g. -M intel for intel syntax)"),
OPT_END()
};
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index d7ff277..a0673ee 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -487,6 +487,8 @@ static const struct option options[] = {
OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
"Look for files with symbols relative to this directory"),
OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
+ OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
+ "Specify disassembler style (e.g. -M intel for intel syntax)"),
OPT_END()
};
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index e01af2b..6495966 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -16,6 +16,8 @@
#include "annotate.h"
#include <pthread.h>
+const char *disassembler_style;
+
int symbol__annotate_init(struct map *map __used, struct symbol *sym)
{
struct annotation *notes = symbol__annotation(sym);
@@ -323,8 +325,10 @@ fallback:
dso, dso->long_name, sym, sym->name);
snprintf(command, sizeof(command),
- "objdump --start-address=0x%016" PRIx64
+ "objdump %s%s --start-address=0x%016" PRIx64
" --stop-address=0x%016" PRIx64 " -dS -C %s|grep -v %s|expand",
+ disassembler_style ? "-M " : "",
+ disassembler_style ? disassembler_style : "",
map__rip_2objdump(map, sym->start),
map__rip_2objdump(map, sym->end),
symfs_filename, filename);
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index c2c2868..6ede128 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -100,4 +100,6 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
int refresh);
#endif
+extern const char *disassembler_style;
+
#endif /* __PERF_ANNOTATE_H */
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] perf: Clarify -c help text
2011-09-15 21:31 [PATCH 1/3] perf: Make perf stat/record print fatal signals of the target program Andi Kleen
2011-09-15 21:31 ` [PATCH 2/3] perf: Support setting the disassembler style Andi Kleen
@ 2011-09-15 21:31 ` Andi Kleen
1 sibling, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2011-09-15 21:31 UTC (permalink / raw)
To: acme; +Cc: linux-kernel, fweisbec, eranian, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Clarify what perf record/top -c actually does in the help text.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/Documentation/perf-record.txt | 6 +++---
tools/perf/Documentation/perf-top.txt | 2 +-
tools/perf/builtin-record.c | 2 +-
tools/perf/builtin-top.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 5a520f8..f636cc8 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -72,9 +72,9 @@ OPTIONS
--force::
Overwrite existing data file. (deprecated)
--c::
---count=::
- Event period to sample.
+-cN::
+--count=N::
+ Sample event every N occurrences.
-o::
--output=::
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index f6eb1cd..b6043b0 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -23,7 +23,7 @@ OPTIONS
-c <count>::
--count=<count>::
- Event period to sample.
+ Sample event every COUNT occurrences.
-C <cpu-list>::
--cpu=<cpu>::
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 042117f..22a9a27 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -761,7 +761,7 @@ const struct option record_options[] = {
"list of cpus to monitor"),
OPT_BOOLEAN('f', "force", &force,
"overwrite existing data file (deprecated)"),
- OPT_U64('c', "count", &user_interval, "event period to sample"),
+ OPT_U64('c', "count", &user_interval, "sample every COUNTS events"),
OPT_STRING('o', "output", &output_name, "file",
"output file name"),
OPT_BOOLEAN('i', "no-inherit", &no_inherit,
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index a43433f..79bfb5d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -992,7 +992,7 @@ static const struct option options[] = {
"event selector. use 'perf list' to list available events",
parse_events_option),
OPT_INTEGER('c', "count", &default_interval,
- "event period to sample"),
+ "sample event every N occurrences"),
OPT_INTEGER('p', "pid", &top.target_pid,
"profile events on existing process id"),
OPT_INTEGER('t', "tid", &top.target_tid,
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread