diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 10849a079026..ad613ea51434 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -865,7 +865,7 @@ iter_prepare_cumulative_entry(struct hist_entry_iter *iter, * cumulated only one time to prevent entries more than 100% * overhead. */ - he_cache = malloc(sizeof(*he_cache) * (iter->max_stack + 1)); + he_cache = malloc(sizeof(*he_cache) * (callchain_cursor.nr + 1)); if (he_cache == NULL) return -ENOMEM; @@ -1030,8 +1030,6 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al, if (err) return err; - iter->max_stack = max_stack_depth; - err = iter->ops->prepare_entry(iter, al); if (err) goto out; diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index a440a04a29ff..159d616e170b 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h @@ -102,7 +102,6 @@ struct hist_entry_iter { int curr; bool hide_unresolved; - int max_stack; struct perf_evsel *evsel; struct perf_sample *sample;