[V2,0/9] perf symbols: Improve dso__synthesize_plt_symbols() for x86

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

Message

Adrian Hunter Jan. 31, 2023, 1:16 p.m. UTC
  Hi

This is version 2 of the second of 2 patchsets to improve
dso__synthesize_plt_symbols().
This patchset focuses on getting rid of unknown symbols that show up in
Intel PT traces.

x86 has 2 more plt's, namely .plt.sec and .plt.got, so support is added for
synthesizing symbols for them.  Special handing is needed for IFUNC symbols,
and it is also possible to have a .plt for static executables, so support is
added for that.


Changes in V2:

    perf symbols: Add support for x86 .plt.sec
        Amend commit message and example about -z plt

    perf symbols: Get symbols for .plt.got for x86-64
        Fix get_plt_got_name() not to segfault with EM_386


Adrian Hunter (9):
      perf symbols: Correct plt entry sizes for x86
      perf symbols: Add support for x86 .plt.sec
      perf symbols: Sort plt relocations for x86
      perf symbols: Record whether a symbol is an alias for an IFUNC symbol
      perf symbols: Add support for IFUNC symbols for x86_64
      perf symbols: Allow for .plt without header
      perf symbols: Allow for static executables with .plt
      perf symbols: Start adding support for .plt.got for x86
      perf symbols: Get symbols for .plt.got for x86-64

 tools/perf/util/symbol-elf.c | 365 ++++++++++++++++++++++++++++++++++++++++---
 tools/perf/util/symbol.c     |   4 +
 tools/perf/util/symbol.h     |   2 +
 tools/perf/util/symsrc.h     |   1 +
 4 files changed, 350 insertions(+), 22 deletions(-)


Regards
Adrian
  

Comments

Namhyung Kim Feb. 1, 2023, 6:59 a.m. UTC | #1
Hi Adrian,

On Tue, Jan 31, 2023 at 5:16 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> Hi
>
> This is version 2 of the second of 2 patchsets to improve
> dso__synthesize_plt_symbols().
> This patchset focuses on getting rid of unknown symbols that show up in
> Intel PT traces.
>
> x86 has 2 more plt's, namely .plt.sec and .plt.got, so support is added for
> synthesizing symbols for them.  Special handing is needed for IFUNC symbols,
> and it is also possible to have a .plt for static executables, so support is
> added for that.
>
>
> Changes in V2:
>
>     perf symbols: Add support for x86 .plt.sec
>         Amend commit message and example about -z plt
>
>     perf symbols: Get symbols for .plt.got for x86-64
>         Fix get_plt_got_name() not to segfault with EM_386
>
>
> Adrian Hunter (9):
>       perf symbols: Correct plt entry sizes for x86
>       perf symbols: Add support for x86 .plt.sec
>       perf symbols: Sort plt relocations for x86
>       perf symbols: Record whether a symbol is an alias for an IFUNC symbol
>       perf symbols: Add support for IFUNC symbols for x86_64
>       perf symbols: Allow for .plt without header
>       perf symbols: Allow for static executables with .plt
>       perf symbols: Start adding support for .plt.got for x86
>       perf symbols: Get symbols for .plt.got for x86-64

Reviewed-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


>
>  tools/perf/util/symbol-elf.c | 365 ++++++++++++++++++++++++++++++++++++++++---
>  tools/perf/util/symbol.c     |   4 +
>  tools/perf/util/symbol.h     |   2 +
>  tools/perf/util/symsrc.h     |   1 +
>  4 files changed, 350 insertions(+), 22 deletions(-)
>
>
> Regards
> Adrian
  
Arnaldo Carvalho de Melo Feb. 2, 2023, 12:46 a.m. UTC | #2
Em Tue, Jan 31, 2023 at 10:59:58PM -0800, Namhyung Kim escreveu:
> Hi Adrian,
> 
> On Tue, Jan 31, 2023 at 5:16 AM Adrian Hunter <adrian.hunter@intel.com> wrote:
> >
> > Hi
> >
> > This is version 2 of the second of 2 patchsets to improve
> > dso__synthesize_plt_symbols().
> > This patchset focuses on getting rid of unknown symbols that show up in
> > Intel PT traces.
> >
> > x86 has 2 more plt's, namely .plt.sec and .plt.got, so support is added for
> > synthesizing symbols for them.  Special handing is needed for IFUNC symbols,
> > and it is also possible to have a .plt for static executables, so support is
> > added for that.
> >
> >
> > Changes in V2:
> >
> >     perf symbols: Add support for x86 .plt.sec
> >         Amend commit message and example about -z plt
> >
> >     perf symbols: Get symbols for .plt.got for x86-64
> >         Fix get_plt_got_name() not to segfault with EM_386
> >
> >
> > Adrian Hunter (9):
> >       perf symbols: Correct plt entry sizes for x86
> >       perf symbols: Add support for x86 .plt.sec
> >       perf symbols: Sort plt relocations for x86
> >       perf symbols: Record whether a symbol is an alias for an IFUNC symbol
> >       perf symbols: Add support for IFUNC symbols for x86_64
> >       perf symbols: Allow for .plt without header
> >       perf symbols: Allow for static executables with .plt
> >       perf symbols: Start adding support for .plt.got for x86
> >       perf symbols: Get symbols for .plt.got for x86-64
> 
> Reviewed-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied.

- Arnaldo

 
> Thanks,
> Namhyung
> 
> 
> >
> >  tools/perf/util/symbol-elf.c | 365 ++++++++++++++++++++++++++++++++++++++++---
> >  tools/perf/util/symbol.c     |   4 +
> >  tools/perf/util/symbol.h     |   2 +
> >  tools/perf/util/symsrc.h     |   1 +
> >  4 files changed, 350 insertions(+), 22 deletions(-)
> >
> >
> > Regards
> > Adrian