linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@linaro.org>
To: Ian Rogers <irogers@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] perf test: Introduce script for java symbol testing
Date: Sat, 13 Aug 2022 11:08:22 +0800	[thread overview]
Message-ID: <20220813030822.GE74978@leoy-huanghe> (raw)
In-Reply-To: <CAP-5=fUJxMz0C61Y1qwptc+M6rT=J3ztvguB+9bJBaQrYEQZ3w@mail.gmail.com>

On Fri, Aug 12, 2022 at 02:08:43PM -0700, Ian Rogers wrote:

[...]

> > > +if [ -e "$PWD/tools/perf/libperf-jvmti.so" ]; then
> > > +     LIBJVMTI=$PWD/tools/perf/libperf-jvmti.so
> >
> >
> > Will this only work if we do a:
> >
> > make -C tools/perf

Yes, I think so.

> >
> > ?
> 
> Perhaps, I'm not sure on the correct way to detect the install location.
> The only similar example I know of is:
> https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/tests/builtin-test.c?h=perf/core#n308

Yes, I refered the code in this link.

If user works under Linux source folder, the test will search lib in
the folder $LINUX or $LINUX/tools/perf; and it searchs the installed
libperf-jvmti.so in the folder "$PREFIX/lib64" or "$PREFIX/lib".

I think I can add a more path for searching system lib (e.g. the
libperf-jvmti.so is under /usr/lib/linux-tools-xxx/):

  elif [ -e "/usr/lib/linux-tools-$(uname -a | awk '{ print $3 }' | sed -r 's/-generic//')/libperf-jvmti.so" ]; then
       LIBJVMTI= /usr/lib/linux-tools-$(uname -a | awk '{ print $3 }' | sed -r 's/-generic//')/libperf-jvmti.so

> > +elif [ -e "$PWD/libperf-jvmti.so" ]; then
> > > +     LIBJVMTI=$PWD/libperf-jvmti.so
> > > +elif [ -e "$PREFIX/lib64/libperf-jvmti.so" ]; then
> > > +     LIBJVMTI=$PREFIX/lib64/libperf-jvmti.so
> > > +elif [ -e "$PREFIX/lib/libperf-jvmti.so" ]; then
> > > +     LIBJVMTI=$PREFIX/lib/libperf-jvmti.so
> > > +else
> > > +     echo "Fail to find libperf-jvmti.so"
> > > +     exit 1
> >
> 
> JVMTI is a build option so this should probably be "exit 2" for skip.

Sure, will fix.

Thanks,
Leo

      parent reply	other threads:[~2022-08-13  3:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06  3:34 [PATCH 0/2] perf test: Add test for java symbol Leo Yan
2022-08-06  3:34 ` [PATCH 1/2] perf subcmd: Set environment variable "PREFIX" Leo Yan
2022-08-06  3:34 ` [PATCH 2/2] perf test: Introduce script for java symbol testing Leo Yan
2022-08-12 19:47   ` Arnaldo Carvalho de Melo
     [not found]     ` <CAP-5=fUJxMz0C61Y1qwptc+M6rT=J3ztvguB+9bJBaQrYEQZ3w@mail.gmail.com>
2022-08-13  3:08       ` Leo Yan [this message]

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=20220813030822.GE74978@leoy-huanghe \
    --to=leo.yan@linaro.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).