Re: [PATCH v2 2/2] perf test: Introduce script for java symbol testing
From: Leo Yan
Date: Tue Sep 20 2022 - 21:33:46 EST
Hi Namhyung,
On Tue, Sep 20, 2022 at 02:47:05PM -0700, Namhyung Kim wrote:
[...]
> > +if [ -e "$PWD/tools/perf/libperf-jvmti.so" ]; then
> > + LIBJVMTI=$PWD/tools/perf/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
> > +if [ -e "/usr/lib/linux-tools-$(uname -a | awk '{ print $3 }' | sed -r 's/-generic//')/libperf-jvmti.so" ]; then
>
> s/if/elif/ ?
Ouch, will fix.
> > + LIBJVMTI=/usr/lib/linux-tools-$(uname -a | awk '{ print $3 }' | sed -r 's/-generic//')/libperf-jvmti.so
> > +else
> > + echo "Fail to find libperf-jvmti.so"
> > + # JVMTI is a build option, skip the test if fail to find lib
> > + exit 2
> > +fi
> > +
> > +cat <<EOF | perf record -k 1 -o $PERF_DATA jshell -s -J-agentpath:$LIBJVMTI
>
> Wouldn't it check if jshell is available first?
Indeed. Will check jshell and skip the testing if jshell doesn't
exist.
Thanks for reviewing.
Leo