Messages in this thread | | | From | Namhyung Kim <> | Date | Tue, 27 Feb 2024 21:21:26 -0800 | Subject | Re: [PATCH 1/4] perf annotate: Add a hashmap for symbol histogram |
| |
On Tue, Feb 27, 2024 at 5:20 PM Ian Rogers <irogers@google.com> wrote: > > On Tue, Feb 27, 2024 at 4:52 PM Namhyung Kim <namhyung@kernel.org> wrote: > > > > Now symbol histogram uses an array to save per-offset sample counts. > > But it wastes a lot of memory if the symbol has a few samples only. > > Add a hashmap to save values only for actual samples. > > > > For now, it has duplicate histogram (one in the existing array and > > another in the new hash map). Once it can convert to use the hash > > in all places, we can get rid of the array later. > > > > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > > --- [SNIP] > > diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h > > index 94435607c958..a2b0c8210740 100644 > > --- a/tools/perf/util/annotate.h > > +++ b/tools/perf/util/annotate.h > > @@ -12,6 +12,7 @@ > > #include "symbol_conf.h" > > #include "mutex.h" > > #include "spark.h" > > +#include "hashmap.h" > > nit: This could just be a forward reference to keep the number of > header files down.
Sounds good. Will fix in v2.
Thanks for your review! Namhyung
| |