Re: [PATCH 09/25] perf tools: Add support to read build id from compressed elf

Jiri Olsa
2020-11-28T22:23:37Z

On Thu, Nov 26, 2020 at 02:46:20PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Nov 26, 2020 at 06:00:10PM +0100, Jiri Olsa escreveu:
> > Adding support to decompress file before reading build id.
> >
> > Adding filename__read_build_id and change its current
> > versions to read_build_id.
> >
> > Shutting down stderr output of perf list in the shell test:
> > 82: Check open filename arg using perf trace + vfs_getname : Ok
> >
> > because with decompression code in the place we the
> > filename__read_build_id function is more verbose in case
> > of error and the test did not account for that.
>
> There are two patches here, right? Also the test output shows it after,
> before is missing, showing what the test wasn't accounting for.

hum, I'm not sure I understand, the test fails because the change
introduced more terminal output, so I think it needs to be together

>
> - Arnaldo
>
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> > .../tests/shell/trace+probe_vfs_getname.sh | 2 +-
> > tools/perf/util/symbol-elf.c | 37 ++++++++++++++++++-
> > 2 files changed, 36 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
> > index 11cc2af13f2b..3660fcc02fef 100755
> > --- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh
> > +++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh
> > @@ -20,7 +20,7 @@ skip_if_no_perf_trace || exit 2
> > file=$(mktemp /tmp/temporary_file.XXXXX)
> >
> > trace_open_vfs_getname() {
> > - evts=$(echo $(perf list syscalls:sys_enter_open* 2>&1 | egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')
> > + evts=$(echo $(perf list syscalls:sys_enter_open* >&1 2>/dev/nul | egrep 'open(at)? ' | sed -r 's/.*sys_enter_([a-z]+) +\[.*$/\1/') | sed 's/ /,/')

and one extra 'l' missing in /dev/nul ;-) also perhaps the >&1 is superfluous

jirka