Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp325160pxk; Thu, 1 Oct 2020 03:27:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEL1QNqKbBOnEJG/7OZDcdaDWAA2g8C3zgZXXDNoVkLE4vMVQR3KS/tU8QjtKJefIxcoN5 X-Received: by 2002:aa7:da10:: with SMTP id r16mr7629124eds.333.1601548022311; Thu, 01 Oct 2020 03:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601548022; cv=none; d=google.com; s=arc-20160816; b=tkSEodEEYLQ1laKQCL1qeTCTX/lAYILsvTplJlj4xYWkUQEqwXESytnc3QS5SDWg50 B/vgCxDs2R+H59rpCbdx/q5rcFNNkP9xH9IUodHYzA+QyJ8LjVgSGAfV2JFD4P3wvLfT 7Zmug/Z1QesUIncsnblGcc5pZkIWgYTee6UYcQ+nRsaw7Slh5gTR0C0Ro8fcJ9LqbJYg qU/E+gICeMHi84EJVbVHeICS9lQNAA/AznGWSR4JWhAfzC9lUEnjirh8A4u9mpg9i9dh uDRb8+uCNkUWy+FCxBU454hh8BxCE42ErEFcoBZFuy/uPGWyhYZcqFNEyRfQMCtI4dWN 9oaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iMHq4W3FFlmuZXN1AAYUBjJey9b4v21DrESV0WQsAwk=; b=B4UlKX6XpbLrWecegOphGP7hT9yN0tl+vfybBni1HuB29SO5X6FwFm1KspbpoTPji3 AnirC1kDsf9loednyAEbk0KvOKHCT9LX+I/EkDIH0g9eUov/guGZpxMftESx7PHQwCMu 1PlAA5TcaftsIHfiI+Uh+SlYHJ4cLnoR7YsZj/8pYFzdz53bwbFoSRoAubOgkoQbevpI 65dnQXgVPC7tmRX8o28xTa0SIGGOD1v7a3WSUo3Tvd6Bxy1WrjGZpQRm+xp+Y7M1mPRP MkAzfAK27JEHrPTn+YhPB8Yk0kAv+jq8oG2+9Ff5zUoQW+Ua2Y4zcUCXdkuVPszeanBO 80AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TYUTYFPf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si3168924ejz.557.2020.10.01.03.26.34; Thu, 01 Oct 2020 03:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TYUTYFPf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731934AbgJAKZb (ORCPT + 99 others); Thu, 1 Oct 2020 06:25:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49595 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbgJAKZb (ORCPT ); Thu, 1 Oct 2020 06:25:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601547929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iMHq4W3FFlmuZXN1AAYUBjJey9b4v21DrESV0WQsAwk=; b=TYUTYFPfcasXTIDzfW39mf9t5BgsN9xYQIoRu4rH3wuJMjeY9R5A8Cc0mDzPXU3X8HI6zY bwjQx1t+iQGvb5ieBldd8Iq0/ZLuw6dEJh8VoWM8gDWZjnonpTnQ9FBn1GNtE8iqmX2IAU 9FeCMAfXBWcYsLHoYLeUF+wpfejtKGw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-4DOucC4hPbKdx8l4F5ZGwQ-1; Thu, 01 Oct 2020 06:25:24 -0400 X-MC-Unique: 4DOucC4hPbKdx8l4F5ZGwQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1ADA7802B5C; Thu, 1 Oct 2020 10:25:23 +0000 (UTC) Received: from krava (ovpn-115-79.ams2.redhat.com [10.36.115.79]) by smtp.corp.redhat.com (Postfix) with SMTP id 9ABB55D9D3; Thu, 1 Oct 2020 10:25:19 +0000 (UTC) Date: Thu, 1 Oct 2020 12:25:17 +0200 From: Jiri Olsa To: Ian Rogers Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Stephane Eranian Subject: Re: [PATCH 1/9] perf tools: Add build id shell test Message-ID: <20201001102517.GC3999500@krava> References: <20200930171512.3986425-1-jolsa@kernel.org> <20200930171512.3986425-2-jolsa@kernel.org> <20201001092530.GB3999500@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201001092530.GB3999500@krava> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > > > > Acked-by: Ian Rogers > > > > 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}