Commit d561e17
perf hist: Avoid 'struct hist_entry_iter' mem_info memory leak
'struct mem_info' is reference counted while 'struct branch_info' and
he_cache (struct hist_entry **) are not.
Break apart the priv field in 'struct hist_entry_iter' so that we can
know which values are owned by the iter and do the appropriate free or
put.
Move hide_unresolved to marginally shrink the size of the now grown
struct.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ben Gainey <ben.gainey@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Li Dong <lidong@vivo.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Paran Lee <p4ranlee@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Sun Haiyong <sunhaiyong@loongson.cn>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Yanteng Si <siyanteng@loongson.cn>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240507183545.1236093-9-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>1 parent 1a8c2e0 commit d561e17
2 files changed
Lines changed: 19 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | 479 | | |
487 | 480 | | |
488 | 481 | | |
| |||
574 | 567 | | |
575 | 568 | | |
576 | 569 | | |
577 | | - | |
578 | 570 | | |
579 | 571 | | |
580 | 572 | | |
| |||
747 | 739 | | |
748 | 740 | | |
749 | 741 | | |
750 | | - | |
| 742 | + | |
751 | 743 | | |
752 | 744 | | |
753 | 745 | | |
| |||
836 | 828 | | |
837 | 829 | | |
838 | 830 | | |
839 | | - | |
| 831 | + | |
840 | 832 | | |
841 | 833 | | |
842 | 834 | | |
843 | 835 | | |
844 | 836 | | |
845 | 837 | | |
846 | 838 | | |
847 | | - | |
| 839 | + | |
848 | 840 | | |
849 | 841 | | |
850 | 842 | | |
| |||
891 | 883 | | |
892 | 884 | | |
893 | 885 | | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
| 886 | + | |
900 | 887 | | |
901 | 888 | | |
902 | 889 | | |
| |||
915 | 902 | | |
916 | 903 | | |
917 | 904 | | |
918 | | - | |
| 905 | + | |
919 | 906 | | |
920 | 907 | | |
921 | 908 | | |
| |||
929 | 916 | | |
930 | 917 | | |
931 | 918 | | |
932 | | - | |
| 919 | + | |
933 | 920 | | |
934 | 921 | | |
935 | 922 | | |
| |||
958 | 945 | | |
959 | 946 | | |
960 | 947 | | |
961 | | - | |
| 948 | + | |
962 | 949 | | |
963 | 950 | | |
964 | 951 | | |
| |||
987 | 974 | | |
988 | 975 | | |
989 | 976 | | |
990 | | - | |
| 977 | + | |
991 | 978 | | |
992 | 979 | | |
993 | 980 | | |
| |||
1055 | 1042 | | |
1056 | 1043 | | |
1057 | 1044 | | |
1058 | | - | |
| 1045 | + | |
1059 | 1046 | | |
1060 | 1047 | | |
1061 | 1048 | | |
| |||
1068 | 1055 | | |
1069 | 1056 | | |
1070 | 1057 | | |
1071 | | - | |
| 1058 | + | |
1072 | 1059 | | |
1073 | 1060 | | |
1074 | 1061 | | |
| |||
1126 | 1113 | | |
1127 | 1114 | | |
1128 | 1115 | | |
1129 | | - | |
| 1116 | + | |
1130 | 1117 | | |
1131 | 1118 | | |
1132 | 1119 | | |
| |||
1192 | 1179 | | |
1193 | 1180 | | |
1194 | 1181 | | |
1195 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1196 | 1185 | | |
1197 | 1186 | | |
1198 | 1187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | 135 | | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
141 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
0 commit comments