Adrian Hunter
5ef506130c
perf top: Add --branch-history option
...
Add --branch-history option, to act the same as that option does for
perf report.
Example:
$ cat tcallf.c
volatile a = 10000, b = 100000, c;
__attribute__((noinline)) f2()
{
c = a / b;
}
__attribute__((noinline)) f1()
{
f2();
f2();
}
main()
{
while (1)
f1();
}
$ gcc -w -g -o tcallf tcallf.c
$ ./tcallf &
[1] 29409
$ perf top -e cycles:u -t $(pidof tcallf) --stdio --no-children --branch-history
PerfTop: 3819 irqs/sec kernel: 0.0% exact: 0.0% lost: 0/0 drop: 0/0 [4000Hz cycles:u], (target_tid: 29409)
--------------------------------------------------------------------------------------------------------------------
49.01% tcallf.c:5 [.] f2 tcallf
|
|--24.91%--f2 tcallf.c:4
| |
| |--17.14%--f1 tcallf.c:11 (cycles:1)
| | f1 tcallf.c:11
| | f2 tcallf.c:6 (cycles:3)
| | f2 tcallf.c:4
| | f1 tcallf.c:10 (cycles:2)
| | f1 tcallf.c:9
| | main tcallf.c:16 (cycles:1)
| | main tcallf.c:16
| | main tcallf.c:16 (cycles:1)
| | main tcallf.c:16
| | f1 tcallf.c:12 (cycles:1)
| | f1 tcallf.c:12
| | f2 tcallf.c:6 (cycles:3)
| | f2 tcallf.c:4
| | f1 tcallf.c:11 (cycles:1 iter:1 avg_cycles:12)
| | f1 tcallf.c:11
| | f2 tcallf.c:6 (cycles:3 iter:1 avg_cycles:12)
| | f2 tcallf.c:4
| | f1 tcallf.c:10 (cycles:2 iter:1 avg_cycles:12)
| |
| --7.78%--f1 tcallf.c:10 (cycles:2)
| f1 tcallf.c:9
| main tcallf.c:16 (cycles:1)
| main tcallf.c:16
| main tcallf.c:16 (cycles:1)
| main tcallf.c:16
| f1 tcallf.c:12 (cycles:1)
| f1 tcallf.c:12
| f2 tcallf.c:6 (cycles:3)
| f2 tcallf.c:4
| f1 tcallf.c:11 (cycles:1)
| f1 tcallf.c:11
| f2 tcallf.c:6 (cycles:3)
| f2 tcallf.c:4
| f1 tcallf.c:10 (cycles:2 iter:1 avg_cycles:12)
| f1 tcallf.c:9
| main tcallf.c:16 (cycles:1 iter:1 avg_cycles:12)
| main tcallf.c:16
| main tcallf.c:16 (cycles:1 iter:1 avg_cycles:12)
...
$ pkill tcallf
[1]+ Terminated ./tcallf
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20230330131833.12864-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-04-04 09:39:56 -03:00
..
2016-07-04 20:27:27 -03:00
2022-10-25 17:40:48 -03:00
2019-09-27 09:26:14 -03:00
2018-04-26 13:47:10 -03:00
2021-08-02 09:56:17 -03:00
2018-10-24 15:29:50 -03:00
2019-03-19 16:52:04 -03:00
2021-08-02 09:56:17 -03:00
2019-06-05 09:47:57 -03:00
2021-02-11 12:54:27 -03:00
2022-08-11 18:50:17 -03:00
2022-08-11 18:50:17 -03:00
2015-08-21 11:34:10 -03:00
2022-08-27 11:55:17 -03:00
2020-03-11 11:00:33 -03:00
2023-02-17 11:02:44 -03:00
2021-09-27 09:32:28 -03:00
2023-01-02 12:34:06 -03:00
2023-04-04 09:39:56 -03:00
2022-04-14 08:54:03 -03:00
2023-01-23 10:00:47 -03:00
2022-01-15 17:41:25 -03:00
2022-07-18 16:35:34 -03:00
2023-02-16 09:33:45 -03:00
2023-04-04 09:39:56 -03:00
2021-02-11 10:19:52 -03:00
2021-04-29 10:30:58 -03:00
2022-10-27 16:37:26 -03:00
2022-07-20 11:08:13 -03:00
2021-03-06 16:54:26 -03:00
2022-03-22 17:45:39 -03:00
2022-10-04 08:55:22 -03:00
2023-02-17 11:02:44 -03:00
2021-08-10 11:05:21 -03:00
2021-03-06 16:54:26 -03:00
2021-10-08 16:10:02 -03:00
2023-03-15 16:53:43 -03:00
2022-07-26 16:31:54 -03:00
2023-02-02 16:32:19 -03:00
2023-02-08 10:33:32 -03:00
2023-01-27 15:00:34 -03:00
2023-01-19 09:49:59 -03:00
2023-03-15 11:08:36 -03:00
2023-04-04 09:39:56 -03:00
2020-01-06 11:46:09 -03:00
2023-02-02 16:32:19 -03:00
2023-02-02 16:32:19 -03:00
2023-02-06 14:57:50 -03:00
2023-02-19 08:10:15 -03:00
2023-01-22 18:09:56 -03:00
2017-11-16 14:50:06 -03:00
2023-04-04 09:39:56 -03:00
2021-03-06 16:54:26 -03:00
2018-04-02 13:52:23 -03:00
2019-11-06 15:43:05 -03:00
2022-06-24 13:18:55 -03:00
2022-04-14 08:54:03 -03:00
2016-09-01 09:44:13 -03:00
2020-05-28 10:03:26 -03:00
2019-07-02 16:08:16 -03:00
2023-02-19 08:10:15 -03:00