All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: "Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco)" 
	<dzagorui@cisco.com>
Cc: "jolsa@redhat.com" <jolsa@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"alexander.shishkin@linux.intel.com" 
	<alexander.shishkin@linux.intel.com>,
	"namhyung@kernel.org" <namhyung@kernel.org>
Subject: Re: [PATCH v8 2/3] perf tests: avoid storing an absolute path in perf binary
Date: Fri, 28 May 2021 09:48:19 -0300	[thread overview]
Message-ID: <YLDmk2l37WL16VQh@kernel.org> (raw)
In-Reply-To: <BY5PR11MB40243EB953DC674006115729D9229@BY5PR11MB4024.namprd11.prod.outlook.com>

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@toolbox 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@toolbox perf]$ perf test python
> > 19: 'import perf' in python                                         : FAILED!
> > ⬢[acme@toolbox 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

  reply	other threads:[~2021-05-28 12:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 11:15 [PATCH v8 1/3] perf report: compile tips.txt in perf binary Denys Zagorui
2021-05-24 11:15 ` [PATCH v8 2/3] perf tests: avoid storing an absolute path " Denys Zagorui
2021-05-27 16:53   ` Arnaldo Carvalho de Melo
2021-05-28 11:13     ` Denys Zagorui -X (dzagorui - GLOBALLOGIC INC at Cisco)
2021-05-28 12:48       ` Arnaldo Carvalho de Melo [this message]
2021-05-24 11:15 ` [PATCH v8 3/3] perf parse-events: add bison --file-prefix-map option Denys Zagorui
2021-05-25  4:34 ` [PATCH v8 1/3] perf report: compile tips.txt in perf binary Namhyung Kim
2021-05-26 11:54 ` Jiri Olsa
2021-05-26 12:46   ` Arnaldo Carvalho de Melo
2021-05-26 12:41 ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLDmk2l37WL16VQh@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dzagorui@cisco.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.