lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 16 Jun 2022 00:12:10 +0200
From:   Jiri Olsa <olsajiri@...il.com>
To:     Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc:     Jiri Olsa <olsajiri@...il.com>,
        Andrii Nakryiko <andrii.nakryiko@...il.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        "linux-perf-use." <linux-perf-users@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCHv4 bpf-next 0/2] perf tools: Fix prologue generation

On Wed, Jun 15, 2022 at 09:36:34PM +0200, Jiri Olsa wrote:
> On Wed, Jun 15, 2022 at 12:27:03PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Sun, Jun 12, 2022 at 06:25:09PM +0200, Jiri Olsa escreveu:
> > > so the problem is that we prepend init proglogue instructions
> > > for each program not just for the one that needs it, so it will
> > > mismatch later on.. the fix below makes it work for me
> > 
> > > Arnaldo,
> > > I squashed and pushed the change below changes to my bpf/depre
> > > branch, could you please retest?
> > 
> > Before:
> > 
> > [acme@...co perf-urgent]$ git log --oneline -5
> > e2cf9d315f90670f (HEAD -> perf/urgent, five/perf/urgent) perf test topology: Use !strncmp(right platform) to fix guest PPC comparision check
> > 42e4fb08ff987b50 perf test: Record only user callchains on the "Check Arm64 callgraphs are complete in fp mode" test
> > 819d5c3cf75d0f95 perf beauty: Update copy of linux/socket.h with the kernel sources
> > ebdc02b3ece8238b perf test: Fix variable length array undefined behavior in bp_account
> > 8ff58c35adb7f118 libperf evsel: Open shouldn't leak fd on failure
> > [acme@...co perf-urgent]$ sudo su -
> > [root@...co ~]# perf -v
> > perf version 5.19.rc2.ge2cf9d315f90
> > [root@...co ~]# perf test bpf
> >  40: LLVM search and compile                                         :
> >  40.1: Basic BPF llvm compile                                        : Ok
> >  40.3: Compile source for BPF prologue generation                    : Ok
> >  40.4: Compile source for BPF relocation                             : Ok
> >  42: BPF filter                                                      :
> >  42.1: Basic BPF filtering                                           : Ok
> >  42.2: BPF pinning                                                   : Ok
> >  42.3: BPF prologue generation                                       : Ok
> >  63: Test libpfm4 support                                            :
> >  96: perf stat --bpf-counters test                                   : Ok
> > [root@...co ~]#
> > 
> > After your first patch:
> > 
> > [acme@...co perf-urgent]$ git log --oneline -5 jolsa/bpf/depre
> > 9317b879db422632 (jolsa/bpf/depre) perf tools: Rework prologue generation code
> > 4d40831f29f2c9ad perf tools: Register fallback libbpf section handler
> > f913ad6559e337b4 libbpf: Fix is_pow_of_2
> > f175ece2e3436748 selftests/bpf: Fix tc_redirect_dtime
> > 7b711e721234f475 bpf, test_run: Remove unnecessary prog type checks
> > [acme@...co perf-urgent]$ git cherry-pick 4d40831f29f2c9ad
> > [perf/urgent ab39fb6880b57507] perf tools: Register fallback libbpf section handler
> >  Author: Jiri Olsa <jolsa@...nel.org>
> >  Date: Thu Apr 21 15:22:25 2022 +0200
> >  1 file changed, 65 insertions(+), 11 deletions(-)
> > [acme@...co perf-urgent]$
> > [acme@...co perf-urgent]$ alias m='rm -rf ~/libexec/perf-core/ ; perf stat -e cycles:u,instructions:u make -k BUILD_BPF_SKEL=1 PYTHON=python3 O=/tmp/build/perf-urgent -C tools/perf install-bin && perf test python'
> > [acme@...co perf-urgent]$ rm -rf /tmp/build/perf-urgent ; mkdir -p /tmp/build/perf-urgent ; m
> > <SNIP>
> >  19: 'import perf' in python                                         : Ok
> > [acme@...co perf-urgent]$
> > [acme@...co perf-urgent]$ sudo su -
> > [sudo] password for acme:
> > [root@...co ~]# perf test bpf
> >  40: LLVM search and compile                                         :
> >  40.1: Basic BPF llvm compile                                        : Ok
> >  40.3: Compile source for BPF prologue generation                    : Ok
> >  40.4: Compile source for BPF relocation                             : Ok
> >  42: BPF filter                                                      :
> >  42.1: Basic BPF filtering                                           : Ok
> >  42.2: BPF pinning                                                   : Ok
> >  42.3: BPF prologue generation                                       : FAILED!
> >  63: Test libpfm4 support                                            :
> >  96: perf stat --bpf-counters test                                   : Ok
> > [root@...co ~]#
> > 
> > perf test -v bpf later, lets see if landing the second patch fixes
> > things and this bisection problem is justified:
> > 
> > [acme@...co perf-urgent]$ git log --oneline -5 jolsa/bpf/depre
> > 9317b879db422632 (jolsa/bpf/depre) perf tools: Rework prologue generation code
> > 4d40831f29f2c9ad perf tools: Register fallback libbpf section handler
> > f913ad6559e337b4 libbpf: Fix is_pow_of_2
> > f175ece2e3436748 selftests/bpf: Fix tc_redirect_dtime
> > 7b711e721234f475 bpf, test_run: Remove unnecessary prog type checks
> > [acme@...co perf-urgent]$ git remote update jolsa
> > Fetching jolsa
> > [acme@...co perf-urgent]$ git cherry-pick 9317b879db422632
> > [perf/urgent 9a36c7c94e1f596d] perf tools: Rework prologue generation code
> >  Author: Jiri Olsa <jolsa@...nel.org>
> >  Date: Mon May 9 22:46:20 2022 +0200
> >  1 file changed, 110 insertions(+), 18 deletions(-)
> > [acme@...co perf-urgent]$
> > [acme@...co perf-urgent]$ rm -rf /tmp/build/perf-urgent ; mkdir -p /tmp/build/perf-urgent ; m
> > <SNIP>
> >  19: 'import perf' in python                                         : Ok
> > [acme@...co perf-urgent]$ sudo su -
> > [root@...co ~]# perf test bpf
> >  40: LLVM search and compile                                         :
> >  40.1: Basic BPF llvm compile                                        : Ok
> >  40.3: Compile source for BPF prologue generation                    : Ok
> >  40.4: Compile source for BPF relocation                             : Ok
> >  42: BPF filter                                                      :
> >  42.1: Basic BPF filtering                                           : Ok
> >  42.2: BPF pinning                                                   : Ok
> >  42.3: BPF prologue generation                                       : Ok
> >  63: Test libpfm4 support                                            :
> >  96: perf stat --bpf-counters test                                   : Ok
> > [root@...co ~]#
> > 
> > So it works in the end, can it be made to work after the first step? I
> > didn't check that.
> 
> heya,
> so the first patch is preparation and the last one is the real fix
> 
> at the moment it does not work without this change, so I don't
> think it's a problem for the bisect, is it?

ah I just checked that thing worked before :)) ok.. I think the only
way here is to squash them together.. doesn't look that bad

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ