diff options
author | Kan Liang <kan.liang@intel.com> | 2015-01-05 13:23:04 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-02-18 11:16:17 -0500 |
commit | aad2b21c151273fa7abc419dac51a980eff1dd17 (patch) | |
tree | 6408263bd2daf71567178e4fe07d094de934414c /tools/perf/builtin-record.c | |
parent | 2c44b1936bb3b135a3fac8b3493394d42e51cf70 (diff) |
perf tools: Enable LBR call stack support
Currently, there are two call chain recording options, fp and dwarf.
Haswell has a new feature that utilizes the existing LBR facility to
record call chains. Kernel side LBR support code provides this as a
third option to record call chains. This patch enables the lbr call
stack support on the tooling side.
LBR call stack has some limitations:
- It reuses current LBR facility, so LBR call stack and branch record
can not be enabled at the same time.
- It is only available for user-space callchains.
However, it also offers some advantages:
- LBR call stack can work on user apps which don't have frame-pointers
or dwarf debug info compiled. It is a good alternative when nothing
else works.
Tested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Jacob Shin <jacob.w.shin@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masanari Iida <standby24x7@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Rodrigo Campos <rodrigo@sdfg.com.ar>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1420482185-29830-2-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 404ab3434052..d0d02a811ecd 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -658,7 +658,7 @@ error: | |||
658 | 658 | ||
659 | static void callchain_debug(void) | 659 | static void callchain_debug(void) |
660 | { | 660 | { |
661 | static const char *str[CALLCHAIN_MAX] = { "NONE", "FP", "DWARF" }; | 661 | static const char *str[CALLCHAIN_MAX] = { "NONE", "FP", "DWARF", "LBR" }; |
662 | 662 | ||
663 | pr_debug("callchain: type %s\n", str[callchain_param.record_mode]); | 663 | pr_debug("callchain: type %s\n", str[callchain_param.record_mode]); |
664 | 664 | ||
@@ -751,9 +751,9 @@ static struct record record = { | |||
751 | #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: " | 751 | #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: " |
752 | 752 | ||
753 | #ifdef HAVE_DWARF_UNWIND_SUPPORT | 753 | #ifdef HAVE_DWARF_UNWIND_SUPPORT |
754 | const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf"; | 754 | const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf lbr"; |
755 | #else | 755 | #else |
756 | const char record_callchain_help[] = CALLCHAIN_HELP "fp"; | 756 | const char record_callchain_help[] = CALLCHAIN_HELP "fp lbr"; |
757 | #endif | 757 | #endif |
758 | 758 | ||
759 | /* | 759 | /* |