mbox series

[v1,0/6] maps memory improvements and fixes

Message ID 20240206033320.2657716-1-irogers@google.com (mailing list archive)
Headers show
Series maps memory improvements and fixes | expand

Message

Ian Rogers Feb. 6, 2024, 3:33 a.m. UTC
First 6 patches from:
https://lore.kernel.org/lkml/20240202061532.1939474-1-irogers@google.com/

Ian Rogers (6):
  perf maps: Switch from rbtree to lazily sorted array for addresses
  perf maps: Get map before returning in maps__find
  perf maps: Get map before returning in maps__find_by_name
  perf maps: Get map before returning in maps__find_next_entry
  perf maps: Hide maps internals
  perf maps: Locking tidy up of nr_maps

 tools/perf/arch/x86/tests/dwarf-unwind.c |    1 +
 tools/perf/tests/maps.c                  |    3 +
 tools/perf/tests/thread-maps-share.c     |    8 +-
 tools/perf/tests/vmlinux-kallsyms.c      |   10 +-
 tools/perf/util/bpf-event.c              |    1 +
 tools/perf/util/callchain.c              |    2 +-
 tools/perf/util/event.c                  |    4 +-
 tools/perf/util/machine.c                |   34 +-
 tools/perf/util/map.c                    |    1 +
 tools/perf/util/maps.c                   | 1296 ++++++++++++++--------
 tools/perf/util/maps.h                   |   65 +-
 tools/perf/util/probe-event.c            |    1 +
 tools/perf/util/symbol-elf.c             |    4 +-
 tools/perf/util/symbol.c                 |   31 +-
 tools/perf/util/thread.c                 |    2 +-
 tools/perf/util/unwind-libunwind-local.c |    2 +-
 tools/perf/util/unwind-libunwind.c       |    7 +-
 17 files changed, 899 insertions(+), 573 deletions(-)

Comments

Namhyung Kim Feb. 7, 2024, 4:54 p.m. UTC | #1
Hi Ian,

On Mon, Feb 5, 2024 at 7:33 PM Ian Rogers <irogers@google.com> wrote:
>
> First 6 patches from:
> https://lore.kernel.org/lkml/20240202061532.1939474-1-irogers@google.com/
>
> Ian Rogers (6):
>   perf maps: Switch from rbtree to lazily sorted array for addresses
>   perf maps: Get map before returning in maps__find
>   perf maps: Get map before returning in maps__find_by_name
>   perf maps: Get map before returning in maps__find_next_entry
>   perf maps: Hide maps internals
>   perf maps: Locking tidy up of nr_maps

This fails to build with NO_LIBUNWIND=1

util/unwind-libdw.c: In function ‘unwind__get_entries’:
util/unwind-libdw.c:266:70: error: invalid use of undefined type ‘struct maps’
  266 |                 .machine        =
RC_CHK_ACCESS(thread__maps(thread))->machine,

Thanks,
Namhyung


>
>  tools/perf/arch/x86/tests/dwarf-unwind.c |    1 +
>  tools/perf/tests/maps.c                  |    3 +
>  tools/perf/tests/thread-maps-share.c     |    8 +-
>  tools/perf/tests/vmlinux-kallsyms.c      |   10 +-
>  tools/perf/util/bpf-event.c              |    1 +
>  tools/perf/util/callchain.c              |    2 +-
>  tools/perf/util/event.c                  |    4 +-
>  tools/perf/util/machine.c                |   34 +-
>  tools/perf/util/map.c                    |    1 +
>  tools/perf/util/maps.c                   | 1296 ++++++++++++++--------
>  tools/perf/util/maps.h                   |   65 +-
>  tools/perf/util/probe-event.c            |    1 +
>  tools/perf/util/symbol-elf.c             |    4 +-
>  tools/perf/util/symbol.c                 |   31 +-
>  tools/perf/util/thread.c                 |    2 +-
>  tools/perf/util/unwind-libunwind-local.c |    2 +-
>  tools/perf/util/unwind-libunwind.c       |    7 +-
>  17 files changed, 899 insertions(+), 573 deletions(-)
>
> --
> 2.43.0.594.gd9cf4e227d-goog
>
Ian Rogers Feb. 7, 2024, 5:49 p.m. UTC | #2
On Wed, Feb 7, 2024 at 8:54 AM Namhyung Kim <namhyung@kernel.org> wrote:
>
> Hi Ian,
>
> On Mon, Feb 5, 2024 at 7:33 PM Ian Rogers <irogers@google.com> wrote:
> >
> > First 6 patches from:
> > https://lore.kernel.org/lkml/20240202061532.1939474-1-irogers@google.com/
> >
> > Ian Rogers (6):
> >   perf maps: Switch from rbtree to lazily sorted array for addresses
> >   perf maps: Get map before returning in maps__find
> >   perf maps: Get map before returning in maps__find_by_name
> >   perf maps: Get map before returning in maps__find_next_entry
> >   perf maps: Hide maps internals
> >   perf maps: Locking tidy up of nr_maps
>
> This fails to build with NO_LIBUNWIND=1
>
> util/unwind-libdw.c: In function ‘unwind__get_entries’:
> util/unwind-libdw.c:266:70: error: invalid use of undefined type ‘struct maps’
>   266 |                 .machine        =
> RC_CHK_ACCESS(thread__maps(thread))->machine,

Thanks Namhyung, will fix in v2.

Ian

> Thanks,
> Namhyung
>
>
> >
> >  tools/perf/arch/x86/tests/dwarf-unwind.c |    1 +
> >  tools/perf/tests/maps.c                  |    3 +
> >  tools/perf/tests/thread-maps-share.c     |    8 +-
> >  tools/perf/tests/vmlinux-kallsyms.c      |   10 +-
> >  tools/perf/util/bpf-event.c              |    1 +
> >  tools/perf/util/callchain.c              |    2 +-
> >  tools/perf/util/event.c                  |    4 +-
> >  tools/perf/util/machine.c                |   34 +-
> >  tools/perf/util/map.c                    |    1 +
> >  tools/perf/util/maps.c                   | 1296 ++++++++++++++--------
> >  tools/perf/util/maps.h                   |   65 +-
> >  tools/perf/util/probe-event.c            |    1 +
> >  tools/perf/util/symbol-elf.c             |    4 +-
> >  tools/perf/util/symbol.c                 |   31 +-
> >  tools/perf/util/thread.c                 |    2 +-
> >  tools/perf/util/unwind-libunwind-local.c |    2 +-
> >  tools/perf/util/unwind-libunwind.c       |    7 +-
> >  17 files changed, 899 insertions(+), 573 deletions(-)
> >
> > --
> > 2.43.0.594.gd9cf4e227d-goog
> >