Implement lbr-as-callgraph v10

From: Andi Kleen
Date: Fri Sep 26 2014 - 19:37:54 EST

This has been reviewed before. Any change to merge it now?

[Rebase. Fix one conflict with an earlier tip change]
[Just a repost after a rebase]
[Even more review feedback and some bugs addressed.]
[Only port to changes in perf/core. No other changes.]
[Rebase to latest perf/core]
[Another rebase. No changes]

This patchkit implements lbr-as-callgraphs in per freport,
as an alternative way to present LBR information.

Current perf report does a histogram over the branch edges,
which is useful to look at basic blocks, but doesn't tell
you anything about the larger control flow behaviour.

This patchkit adds a new option --branch-history that
adds the branch paths to the callgraph history instead.

This allows to reason about individual branch paths leading
to specific samples.

Also available at
git:// perf/lbr-callgraph7

- rebased on perf/core
- fix various issues
- rename the option to --branch-history
- various fixes to display the information more concise
- White space changes
- Consolidate some patches
- Update some descriptions
- Fix various display problems
- Unknown srcline is now printed as symbol+offset
- Refactor some code to address review feedback
- Merge with latest tip
- Fix missing srcline display in stdio hist output.
- Rename functions
- Fix gtk build problem
- Fix crash without -g
- Improve error messages
- Improve srcline display in various ways
- Port to latest perf/core
- Really port to latest perf/core
- Rebased on 3.16-rc1
- Rebase on 3.17-rc* tip/perf/core
- Rebase to tip/perf/core.
- Add missing check to make --branch-history work again
with latest tip.

Example output:

% perf record -b -g ./tsrc/tcall
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.044 MB (~1923 samples) ]
% perf report --branch-history
54.91% tcall.c:6 [.] f2 tcall
|--65.53%-- f2 tcall.c:5
| |
| |--70.83%-- f1 tcall.c:11
| | f1 tcall.c:10
| | main tcall.c:18
| | main tcall.c:18
| | main tcall.c:17
| | main tcall.c:17
| | f1 tcall.c:13
| | f1 tcall.c:13
| | f2 tcall.c:7
| | f2 tcall.c:5
| | f1 tcall.c:12
| | f1 tcall.c:12
| | f2 tcall.c:7
| | f2 tcall.c:5
| | f1 tcall.c:11

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at