path: root/tools/perf/builtin-record.c
diff options
authorKan Liang <>2015-01-05 13:23:04 -0500
committerIngo Molnar <>2015-02-18 17:16:17 +0100
commitaad2b21c151273fa7abc419dac51a980eff1dd17 (patch)
tree6408263bd2daf71567178e4fe07d094de934414c /tools/perf/builtin-record.c
parent2c44b1936bb3b135a3fac8b3493394d42e51cf70 (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 <> Signed-off-by: Kan Liang <> Signed-off-by: Peter Zijlstra (Intel) <> Cc: Adrian Hunter <> Cc: Anshuman Khandual <> Cc: Arnaldo Carvalho de Melo <> Cc: Cody P Schafer <> Cc: David Ahern <> Cc: Don Zickus <> Cc: Jacob Shin <> Cc: Jiri Olsa <> Cc: Linus Torvalds <> Cc: Masanari Iida <> Cc: Namhyung Kim <> Cc: Paul Mackerras <> Cc: Rodrigo Campos <> Cc: Stephane Eranian <> Cc: Sukadev Bhattiprolu <> Link: Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'tools/perf/builtin-record.c')
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:
static void callchain_debug(void)
- static const char *str[CALLCHAIN_MAX] = { "NONE", "FP", "DWARF" };
+ static const char *str[CALLCHAIN_MAX] = { "NONE", "FP", "DWARF", "LBR" };
pr_debug("callchain: type %s\n", str[callchain_param.record_mode]);
@@ -751,9 +751,9 @@ static struct record record = {
#define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
-const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf";
+const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf lbr";
-const char record_callchain_help[] = CALLCHAIN_HELP "fp";
+const char record_callchain_help[] = CALLCHAIN_HELP "fp lbr";