[00/10] perf symbols: Improve dso__synthesize_plt_symbols()

Message ID 20230120123456.12449-1-adrian.hunter@intel.com
Headers
Series perf symbols: Improve dso__synthesize_plt_symbols() |

Message

Adrian Hunter Jan. 20, 2023, 12:34 p.m. UTC
  Hi

This is the first of 2 patchsets to improve dso__synthesize_plt_symbols().
This patchset is really preparation for the 2nd patchset, which focuses
on getting rid of unknown symbols that show up in Intel PT traces.
The 2nd patchset is still under development.

These patches are small and staightforward. Only the new Symbols test is
slightly interesting because it provides a way to see what symbols
perf discovers for any given dso. The test fails initially, but
should pass after patch 7 "perf symbols: Add symbol for .plt header".


Adrian Hunter (10):
      perf test: Add Symbols test
      perf symbols: Factor out get_plt_sizes()
      perf symbols: Check plt_entry_size is not zero
      perf symbols: Add dso__find_symbol_nocache()
      perf symbols: Slightly simplify 'err' usage in dso__synthesize_plt_symbols()
      perf symbols: Do not check ss->dynsym twice
      perf symbols: Add symbol for .plt header
      perf symbols: Allow for .plt entries with no symbol
      perf symbols: Combine handling for SHT_RELA and SHT_REL
      perf symbols: Check SHT_RELA and SHT_REL type earlier

 tools/perf/Documentation/perf-test.txt |   3 +
 tools/perf/tests/Build                 |   1 +
 tools/perf/tests/builtin-test.c        |   3 +
 tools/perf/tests/symbols.c             | 150 ++++++++++++++++++++++++++
 tools/perf/tests/tests.h               |   3 +
 tools/perf/util/symbol-elf.c           | 190 +++++++++++++++++----------------
 tools/perf/util/symbol.c               |   5 +
 tools/perf/util/symbol.h               |   1 +
 8 files changed, 262 insertions(+), 94 deletions(-)
 create mode 100644 tools/perf/tests/symbols.c


Regards
Adrian
  

Comments

Arnaldo Carvalho de Melo Jan. 20, 2023, 2:11 p.m. UTC | #1
Em Fri, Jan 20, 2023 at 02:34:46PM +0200, Adrian Hunter escreveu:
> Hi
> 
> This is the first of 2 patchsets to improve dso__synthesize_plt_symbols().
> This patchset is really preparation for the 2nd patchset, which focuses
> on getting rid of unknown symbols that show up in Intel PT traces.
> The 2nd patchset is still under development.
> 
> These patches are small and staightforward. Only the new Symbols test is
> slightly interesting because it provides a way to see what symbols
> perf discovers for any given dso. The test fails initially, but
> should pass after patch 7 "perf symbols: Add symbol for .plt header".

Looks nice, I've test build, one by one and used the test with a
different --dso, etc. I'll keep it today locally for further container
tests and to give time to others to look at it, I'll have it in
tmp.perf/core soon.

- Arnaldo
 
> 
> Adrian Hunter (10):
>       perf test: Add Symbols test
>       perf symbols: Factor out get_plt_sizes()
>       perf symbols: Check plt_entry_size is not zero
>       perf symbols: Add dso__find_symbol_nocache()
>       perf symbols: Slightly simplify 'err' usage in dso__synthesize_plt_symbols()
>       perf symbols: Do not check ss->dynsym twice
>       perf symbols: Add symbol for .plt header
>       perf symbols: Allow for .plt entries with no symbol
>       perf symbols: Combine handling for SHT_RELA and SHT_REL
>       perf symbols: Check SHT_RELA and SHT_REL type earlier
> 
>  tools/perf/Documentation/perf-test.txt |   3 +
>  tools/perf/tests/Build                 |   1 +
>  tools/perf/tests/builtin-test.c        |   3 +
>  tools/perf/tests/symbols.c             | 150 ++++++++++++++++++++++++++
>  tools/perf/tests/tests.h               |   3 +
>  tools/perf/util/symbol-elf.c           | 190 +++++++++++++++++----------------
>  tools/perf/util/symbol.c               |   5 +
>  tools/perf/util/symbol.h               |   1 +
>  8 files changed, 262 insertions(+), 94 deletions(-)
>  create mode 100644 tools/perf/tests/symbols.c
> 
> 
> Regards
> Adrian
  
Ian Rogers Jan. 21, 2023, 5:53 p.m. UTC | #2
On Fri, Jan 20, 2023 at 4:35 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> Hi
>
> This is the first of 2 patchsets to improve dso__synthesize_plt_symbols().
> This patchset is really preparation for the 2nd patchset, which focuses
> on getting rid of unknown symbols that show up in Intel PT traces.
> The 2nd patchset is still under development.
>
> These patches are small and staightforward. Only the new Symbols test is
> slightly interesting because it provides a way to see what symbols
> perf discovers for any given dso. The test fails initially, but
> should pass after patch 7 "perf symbols: Add symbol for .plt header".
>
>
> Adrian Hunter (10):
>       perf test: Add Symbols test
>       perf symbols: Factor out get_plt_sizes()
>       perf symbols: Check plt_entry_size is not zero
>       perf symbols: Add dso__find_symbol_nocache()
>       perf symbols: Slightly simplify 'err' usage in dso__synthesize_plt_symbols()
>       perf symbols: Do not check ss->dynsym twice
>       perf symbols: Add symbol for .plt header
>       perf symbols: Allow for .plt entries with no symbol
>       perf symbols: Combine handling for SHT_RELA and SHT_REL
>       perf symbols: Check SHT_RELA and SHT_REL type earlier

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

>  tools/perf/Documentation/perf-test.txt |   3 +
>  tools/perf/tests/Build                 |   1 +
>  tools/perf/tests/builtin-test.c        |   3 +
>  tools/perf/tests/symbols.c             | 150 ++++++++++++++++++++++++++
>  tools/perf/tests/tests.h               |   3 +
>  tools/perf/util/symbol-elf.c           | 190 +++++++++++++++++----------------
>  tools/perf/util/symbol.c               |   5 +
>  tools/perf/util/symbol.h               |   1 +
>  8 files changed, 262 insertions(+), 94 deletions(-)
>  create mode 100644 tools/perf/tests/symbols.c
>
>
> Regards
> Adrian
  
Arnaldo Carvalho de Melo Jan. 22, 2023, 9:11 p.m. UTC | #3
Em Sat, Jan 21, 2023 at 09:53:53AM -0800, Ian Rogers escreveu:
> On Fri, Jan 20, 2023 at 4:35 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
> >
> > Hi
> >
> > This is the first of 2 patchsets to improve dso__synthesize_plt_symbols().
> > This patchset is really preparation for the 2nd patchset, which focuses
> > on getting rid of unknown symbols that show up in Intel PT traces.
> > The 2nd patchset is still under development.
> >
> > These patches are small and staightforward. Only the new Symbols test is
> > slightly interesting because it provides a way to see what symbols
> > perf discovers for any given dso. The test fails initially, but
> > should pass after patch 7 "perf symbols: Add symbol for .plt header".
> >
> >
> > Adrian Hunter (10):
> >       perf test: Add Symbols test
> >       perf symbols: Factor out get_plt_sizes()
> >       perf symbols: Check plt_entry_size is not zero
> >       perf symbols: Add dso__find_symbol_nocache()
> >       perf symbols: Slightly simplify 'err' usage in dso__synthesize_plt_symbols()
> >       perf symbols: Do not check ss->dynsym twice
> >       perf symbols: Add symbol for .plt header
> >       perf symbols: Allow for .plt entries with no symbol
> >       perf symbols: Combine handling for SHT_RELA and SHT_REL
> >       perf symbols: Check SHT_RELA and SHT_REL type earlier
 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, added to the tested patches, will push to perf/core shortly.

- Arnaldo