I wrote a two part article on theory and practice of Last Branch
Records using Linux perf. They were published on LWN.
This includes the background (what is a last branch record and why
branch sampling), what you can use it for in perf, like hot path
profiling, frame pointerless callgraphs, or automatic micro benchmarks,
and also other uses like continuous compiler feedback.
The articles are now freely available: