@@ -476,13 +476,6 @@ static int hist_entry__init(struct hist_entry *he,
476
476
he -> branch_info -> to .ms .map = map__get (he -> branch_info -> to .ms .map );
477
477
}
478
478
479
- if (he -> mem_info ) {
480
- mem_info__iaddr (he -> mem_info )-> ms .map =
481
- map__get (mem_info__iaddr (he -> mem_info )-> ms .map );
482
- mem_info__daddr (he -> mem_info )-> ms .map =
483
- map__get (mem_info__daddr (he -> mem_info )-> ms .map );
484
- }
485
-
486
479
if (hist_entry__has_callchains (he ) && symbol_conf .use_callchain )
487
480
callchain_init (he -> callchain );
488
481
@@ -574,7 +567,6 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template,
574
567
he = NULL ;
575
568
}
576
569
}
577
-
578
570
return he ;
579
571
}
580
572
@@ -747,7 +739,7 @@ __hists__add_entry(struct hists *hists,
747
739
.filtered = symbol__parent_filter (sym_parent ) | al -> filtered ,
748
740
.hists = hists ,
749
741
.branch_info = bi ,
750
- .mem_info = mi ,
742
+ .mem_info = mem_info__get ( mi ) ,
751
743
.kvm_info = ki ,
752
744
.block_info = block_info ,
753
745
.transaction = sample -> transaction ,
@@ -836,15 +828,15 @@ iter_prepare_mem_entry(struct hist_entry_iter *iter, struct addr_location *al)
836
828
if (mi == NULL )
837
829
return - ENOMEM ;
838
830
839
- iter -> priv = mi ;
831
+ iter -> mi = mi ;
840
832
return 0 ;
841
833
}
842
834
843
835
static int
844
836
iter_add_single_mem_entry (struct hist_entry_iter * iter , struct addr_location * al )
845
837
{
846
838
u64 cost ;
847
- struct mem_info * mi = iter -> priv ;
839
+ struct mem_info * mi = iter -> mi ;
848
840
struct hists * hists = evsel__hists (iter -> evsel );
849
841
struct perf_sample * sample = iter -> sample ;
850
842
struct hist_entry * he ;
@@ -891,12 +883,7 @@ iter_finish_mem_entry(struct hist_entry_iter *iter,
891
883
err = hist_entry__append_callchain (he , iter -> sample );
892
884
893
885
out :
894
- /*
895
- * We don't need to free iter->priv (mem_info) here since the mem info
896
- * was either already freed in hists__findnew_entry() or passed to a
897
- * new hist entry by hist_entry__new().
898
- */
899
- iter -> priv = NULL ;
886
+ mem_info__zput (iter -> mi );
900
887
901
888
iter -> he = NULL ;
902
889
return err ;
@@ -915,7 +902,7 @@ iter_prepare_branch_entry(struct hist_entry_iter *iter, struct addr_location *al
915
902
iter -> curr = 0 ;
916
903
iter -> total = sample -> branch_stack -> nr ;
917
904
918
- iter -> priv = bi ;
905
+ iter -> bi = bi ;
919
906
return 0 ;
920
907
}
921
908
@@ -929,7 +916,7 @@ iter_add_single_branch_entry(struct hist_entry_iter *iter __maybe_unused,
929
916
static int
930
917
iter_next_branch_entry (struct hist_entry_iter * iter , struct addr_location * al )
931
918
{
932
- struct branch_info * bi = iter -> priv ;
919
+ struct branch_info * bi = iter -> bi ;
933
920
int i = iter -> curr ;
934
921
935
922
if (bi == NULL )
@@ -958,7 +945,7 @@ iter_add_next_branch_entry(struct hist_entry_iter *iter, struct addr_location *a
958
945
int i = iter -> curr ;
959
946
int err = 0 ;
960
947
961
- bi = iter -> priv ;
948
+ bi = iter -> bi ;
962
949
963
950
if (iter -> hide_unresolved && !(bi [i ].from .ms .sym && bi [i ].to .ms .sym ))
964
951
goto out ;
@@ -987,7 +974,7 @@ static int
987
974
iter_finish_branch_entry (struct hist_entry_iter * iter ,
988
975
struct addr_location * al __maybe_unused )
989
976
{
990
- zfree (& iter -> priv );
977
+ zfree (& iter -> bi );
991
978
iter -> he = NULL ;
992
979
993
980
return iter -> curr >= iter -> total ? 0 : -1 ;
@@ -1055,7 +1042,7 @@ iter_prepare_cumulative_entry(struct hist_entry_iter *iter,
1055
1042
if (he_cache == NULL )
1056
1043
return - ENOMEM ;
1057
1044
1058
- iter -> priv = he_cache ;
1045
+ iter -> he_cache = he_cache ;
1059
1046
iter -> curr = 0 ;
1060
1047
1061
1048
return 0 ;
@@ -1068,7 +1055,7 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
1068
1055
struct evsel * evsel = iter -> evsel ;
1069
1056
struct hists * hists = evsel__hists (evsel );
1070
1057
struct perf_sample * sample = iter -> sample ;
1071
- struct hist_entry * * he_cache = iter -> priv ;
1058
+ struct hist_entry * * he_cache = iter -> he_cache ;
1072
1059
struct hist_entry * he ;
1073
1060
int err = 0 ;
1074
1061
@@ -1126,7 +1113,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
1126
1113
{
1127
1114
struct evsel * evsel = iter -> evsel ;
1128
1115
struct perf_sample * sample = iter -> sample ;
1129
- struct hist_entry * * he_cache = iter -> priv ;
1116
+ struct hist_entry * * he_cache = iter -> he_cache ;
1130
1117
struct hist_entry * he ;
1131
1118
struct hist_entry he_tmp = {
1132
1119
.hists = evsel__hists (evsel ),
@@ -1192,7 +1179,9 @@ static int
1192
1179
iter_finish_cumulative_entry (struct hist_entry_iter * iter ,
1193
1180
struct addr_location * al __maybe_unused )
1194
1181
{
1195
- zfree (& iter -> priv );
1182
+ mem_info__zput (iter -> mi );
1183
+ zfree (& iter -> bi );
1184
+ zfree (& iter -> he_cache );
1196
1185
iter -> he = NULL ;
1197
1186
1198
1187
return 0 ;
0 commit comments