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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Oct 2020 12:25:17 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Michael Petlan <mpetlan@...hat.com>,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/9] perf tools: Add build id shell test

On Thu, Oct 01, 2020 at 11:25:34AM +0200, Jiri Olsa wrote:
> On Wed, Sep 30, 2020 at 07:00:05PM -0700, Ian Rogers wrote:
> > On Wed, Sep 30, 2020 at 10:15 AM Jiri Olsa <jolsa@...nel.org> wrote:
> > >
> > > Adding test for build id cache that adds binary
> > > with sha1 and md5 build ids and verifies it's
> > > added properly.
> > >
> > > The test updates build id cache with perf record
> > > and perf buildid-cache -a.
> > >
> > > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> > 
> > Acked-by: Ian Rogers <irogers@...gle.com>
> > 
> > This is great! If I build perf and test from the build directory the
> > test gets run. If I build using O=/tmp/perf and run from that
> > directory then ./tests/shell isn't found and the test doesn't run.
> > Similarly the install directory doesn't contain the executables and so
> > the test is skipped. Is there any way to get the test running in these
> > other scenarios?
> 
> ok, if there's already some way to get the build path I did not see that
> I'll check and add something if it's missing

would the patch below work for you?

thanks,
jirka


---
diff --git a/tools/perf/tests/shell/buildid.sh b/tools/perf/tests/shell/buildid.sh
index 57fcd28bc4bd..dd9f9c306c34 100755
--- a/tools/perf/tests/shell/buildid.sh
+++ b/tools/perf/tests/shell/buildid.sh
@@ -2,12 +2,23 @@
 # build id cache operations
 # SPDX-License-Identifier: GPL-2.0
 
+ex_md5=buildid-ex-md5
+ex_sha1=buildid-ex-sha1
+
 # skip if there are no test binaries
 if [ ! -x buildid-ex-sha1 -a ! -x buildid-ex-md5 ]; then
-	echo "failed: no test binaries"
-	exit 2
+	ex_dir=$(dirname `which perf`)
+	ex_md5=${ex_dir}/buildid-ex-md5
+	ex_sha1=${ex_dir}/buildid-ex-sha1
+
+	if [ ! -x ${ex_sha1} -a ! -x ${ex_md5} ]; then
+		echo "failed: no test binaries"
+		exit 2
+	fi
 fi
 
+echo "test binaries: ${ex_sha1} ${ex_md5}"
+
 # skip if there's no readelf
 if [ ! -x `which readelf` ]; then
 	echo "failed: no readelf, install binutils"
@@ -80,11 +91,11 @@ test_record()
 }
 
 # add binaries manual via perf buildid-cache -a
-test_add buildid-ex-sha1
-test_add buildid-ex-md5
+test_add ${ex_sha1}
+test_add ${ex_md5}
 
 # add binaries via perf record post processing
-test_record buildid-ex-sha1
-test_record buildid-ex-md5
+test_record ${ex_sha1}
+test_record ${ex_md5}
 
 exit ${err}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ