Commit 6ba29fb
perf callchain: Make brtype_stat in callchain_list optional
struct callchain_list is 352bytes in size, 232 of which are
brtype_stat. brtype_stat is only used for certain callchain_list
items so make it optional, allocating when necessary. So that
printing doesn't need to deal with an optional brtype_stat, pass
an empty/zero version.
Before:
```
struct callchain_list {
u64 ip; /* 0 8 */
struct map_symbol ms; /* 8 24 */
struct {
_Bool unfolded; /* 32 1 */
_Bool has_children; /* 33 1 */
}; /* 32 2 */
/* XXX 6 bytes hole, try to pack */
u64 branch_count; /* 40 8 */
u64 from_count; /* 48 8 */
u64 predicted_count; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
u64 abort_count; /* 64 8 */
u64 cycles_count; /* 72 8 */
u64 iter_count; /* 80 8 */
u64 iter_cycles; /* 88 8 */
struct branch_type_stat brtype_stat; /* 96 232 */
/* --- cacheline 5 boundary (320 bytes) was 8 bytes ago --- */
const char * srcline; /* 328 8 */
struct list_head list; /* 336 16 */
/* size: 352, cachelines: 6, members: 13 */
/* sum members: 346, holes: 1, sum holes: 6 */
/* last cacheline: 32 bytes */
};
```
After:
```
struct callchain_list {
u64 ip; /* 0 8 */
struct map_symbol ms; /* 8 24 */
struct {
_Bool unfolded; /* 32 1 */
_Bool has_children; /* 33 1 */
}; /* 32 2 */
/* XXX 6 bytes hole, try to pack */
u64 branch_count; /* 40 8 */
u64 from_count; /* 48 8 */
u64 predicted_count; /* 56 8 */
/* --- cacheline 1 boundary (64 bytes) --- */
u64 abort_count; /* 64 8 */
u64 cycles_count; /* 72 8 */
u64 iter_count; /* 80 8 */
u64 iter_cycles; /* 88 8 */
struct branch_type_stat * brtype_stat; /* 96 8 */
const char * srcline; /* 104 8 */
struct list_head list; /* 112 16 */
/* size: 128, cachelines: 2, members: 13 */
/* sum members: 122, holes: 1, sum holes: 6 */
};
```
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: James Clark <james.clark@arm.com>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: liuwenyu <liuwenyu7@huawei.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Song Liu <song@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Yanteng Si <siyanteng@loongson.cn>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20231024222353.3024098-10-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>1 parent d47d876 commit 6ba29fb
2 files changed
Lines changed: 34 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
606 | 614 | | |
607 | 615 | | |
608 | 616 | | |
609 | 617 | | |
610 | 618 | | |
611 | 619 | | |
612 | 620 | | |
613 | | - | |
| 621 | + | |
614 | 622 | | |
615 | 623 | | |
616 | 624 | | |
617 | 625 | | |
618 | 626 | | |
619 | 627 | | |
620 | 628 | | |
621 | | - | |
| 629 | + | |
| 630 | + | |
622 | 631 | | |
623 | 632 | | |
624 | 633 | | |
| |||
652 | 661 | | |
653 | 662 | | |
654 | 663 | | |
| 664 | + | |
655 | 665 | | |
656 | 666 | | |
657 | 667 | | |
| |||
762 | 772 | | |
763 | 773 | | |
764 | 774 | | |
765 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
766 | 783 | | |
767 | 784 | | |
768 | 785 | | |
769 | 786 | | |
770 | 787 | | |
771 | 788 | | |
772 | 789 | | |
773 | | - | |
| 790 | + | |
774 | 791 | | |
775 | 792 | | |
776 | 793 | | |
777 | 794 | | |
778 | 795 | | |
779 | 796 | | |
780 | 797 | | |
781 | | - | |
| 798 | + | |
| 799 | + | |
782 | 800 | | |
783 | 801 | | |
784 | 802 | | |
| |||
1026 | 1044 | | |
1027 | 1045 | | |
1028 | 1046 | | |
| 1047 | + | |
1029 | 1048 | | |
1030 | 1049 | | |
1031 | 1050 | | |
| |||
1447 | 1466 | | |
1448 | 1467 | | |
1449 | 1468 | | |
| 1469 | + | |
| 1470 | + | |
1450 | 1471 | | |
1451 | 1472 | | |
1452 | 1473 | | |
1453 | 1474 | | |
1454 | 1475 | | |
| 1476 | + | |
1455 | 1477 | | |
1456 | 1478 | | |
1457 | 1479 | | |
| |||
1463 | 1485 | | |
1464 | 1486 | | |
1465 | 1487 | | |
1466 | | - | |
| 1488 | + | |
1467 | 1489 | | |
1468 | 1490 | | |
1469 | 1491 | | |
| |||
1476 | 1498 | | |
1477 | 1499 | | |
1478 | 1500 | | |
| 1501 | + | |
1479 | 1502 | | |
1480 | 1503 | | |
1481 | 1504 | | |
1482 | 1505 | | |
1483 | 1506 | | |
1484 | 1507 | | |
1485 | 1508 | | |
| 1509 | + | |
1486 | 1510 | | |
1487 | 1511 | | |
1488 | 1512 | | |
| |||
1569 | 1593 | | |
1570 | 1594 | | |
1571 | 1595 | | |
| 1596 | + | |
1572 | 1597 | | |
1573 | 1598 | | |
1574 | 1599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments