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]
Message-ID: <YLDmk2l37WL16VQh@kernel.org>
Date:   Fri, 28 May 2021 09:48:19 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     "Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco)" 
        <dzagorui@...co.com>
Cc:     "jolsa@...hat.com" <jolsa@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "namhyung@...nel.org" <namhyung@...nel.org>
Subject: Re: [PATCH v8 2/3] perf tests: avoid storing an absolute path in
 perf binary

Em Fri, May 28, 2021 at 11:13:09AM +0000, Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco) escreveu:
> 
> > I noticed this is failing the test, nothing is being appended. I'll
> > investigate later. Can you try to reproduce this? I build perf with:
> 
> Maybe this test should fail.

I don't think so :-)

> Path is being appended only if perf is invoked from the build
> directory (basically if there is python dir near perf binary this path
> will be added to sys.path)

And that is ok for a developer, but I agree with you, we shouldn't have
such hardcoded build directories in a production binary.

> I'm not sure if install-bin task installs perf.so to system i mean
> before this patch python binary contains an absolute path to its build
> directory and if this build dir is deleted this test also will fail.

That is what is happening, yes.

> Maybe we should use export PYTHONPATH=<build dir>/python for such test

Agreed, can you cook up a patch that does that in the Makefile that
runs the 'perf python' in tools/perf/tests/?

One other suggestion: When the test fails, say when we run 'perf test
python' directly, it could check if PYTHONPATH is set and if not, warn
the user, something like:

⬢[acme@...lbox perf]$ perf test python
19: 'import perf' in python                                         : FAILED! (Please set the PYTHONPATH env variable)
 
> Thanks,
> Denys
> 
> > alias m='perf stat -e cycles:u,instructions:u make -k CORESIGHT=1 BUILD_BPF_SKEL=1 PYTHON=python3 O=/tmp/build/perf -C tools/perf install-bin && perf test python'
> > 
> >
> > ⬢[acme@...lbox perf]$ perf test python
> > 19: 'import perf' in python                                         : FAILED!
> > ⬢[acme@...lbox perf]$ perf test -v python
> > Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc
> > 19: 'import perf' in python                                         :

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ