Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp610622pxk; Thu, 1 Oct 2020 10:00:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVdjNMYWPW7EtFxIl4XpMsABgXMoZKIX0z/iPTPkykvhgSBWlSW7XXrQ9fGgOMqxM2106H X-Received: by 2002:a50:fb0e:: with SMTP id d14mr9745012edq.172.1601571602150; Thu, 01 Oct 2020 10:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601571602; cv=none; d=google.com; s=arc-20160816; b=N8jUhPETo3SzUwqnZnHYpNZmYKb/qGaoVjWnZ0M5LNnlfkl9aR3rjwGdL/zukBn45j JXuJd+y30RF+4S0a1TCUpTM3vdu6CQvNz4WsJS0b2O0FZqxOCQAKWx437cq0ozzScX/i 9qdN7CtDxbbsCD9RZcN4Pl6kLDAvnSpp4g/vHT6YUVqBhrZAKRR/Rn5ktTyQgsi6aLUR Zfz5gcQM5hMbZ/MiOAXJsuz/vM0OipOoQ2ll3ss8cLGnr29W8rea7jXRYpO21pa1TJSF 4BxjcrkHzzqH1iY7lqMeP1STlkbagxB93zlNwCoZqpM4ty6q9wrfezoLEkKH5o89uIAS pc6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=04b8qKJemsp+OZHSsPknzFEwjnTI950R60M+0aR7dvI=; b=07vs0UFLyX981Qn2ZPIyqzf5/622KEzbKwbDMWgnrb1HB925erf4bRefQILvo2HnCX PxB0aSYVr1H/y+cIsQTorIMUyBOAMAG6VNS587j8jzQ2TswVzclRlrLG14wTRbzQVCWY FXet+5Z2JQnTarBU6AMgJ36NSqK9bhD3qQc+G+BTFrWUjGOzKhKDiytPM7fxpcHtuT/0 GqIl5qPG2eSHwRR5lzQzzEptx/Ih40IVu9vC/EEttOuw8E+3sVYcryvQSh0tyJuC6cZj hyqUge+uorX6XKaHdg1CNtYXblaq9TOAvvjTnHGY2Nyz1c5TRGJNBa8fKEe84HkG+wjE LjzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gxe/UpQi"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si4002462ejk.375.2020.10.01.09.59.39; Thu, 01 Oct 2020 10:00: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=@google.com header.s=20161025 header.b="gxe/UpQi"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732507AbgJAQ6h (ORCPT + 99 others); Thu, 1 Oct 2020 12:58:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732096AbgJAQ6h (ORCPT ); Thu, 1 Oct 2020 12:58:37 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2E21C0613D0 for ; Thu, 1 Oct 2020 09:58:36 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id y15so3920186wmi.0 for ; Thu, 01 Oct 2020 09:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=04b8qKJemsp+OZHSsPknzFEwjnTI950R60M+0aR7dvI=; b=gxe/UpQivnd0eSGnbQnycHIu+NI+9Xwnbm6zBWBhDwJAmY4/d7G+GrUwll7XVMbQPi 73xK/fZlGO55LMKY0m+BiV1lvGClhJ+rAuLTRw6YRdCcwJtDldDinQXbJg899/zLJDXj JVAZU27otkoZsege+R+NZ6KZhhFTrlTiHShR8UGqzxVYGq/SCLoxkx07nb2wAGabEqjd vfgJbN07vOuKgxjd7L5o3GpJak1qqdRrgJz4ym/9XH3M7zzb88JsRStF/+ZoLSDMPyJN Y0RXyfZOFDqt7zBBdVtPoZXuQNQqt/Yoh28So5b1jebRIXox7+oI27N9HJbuBvs7tHBG n0Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=04b8qKJemsp+OZHSsPknzFEwjnTI950R60M+0aR7dvI=; b=umHfLQwkE3xywUNrjJQgxdOE1zreimwvL6KGS1p8BJKUL426AMb32iRJKC0gJ8AyBD aNmF1s3TILCgTIdbGgd19CA2S+7kM9Jc5tQ8eYTjtdy6ccpaYNyeudzRTGBjMQlrn5U5 Et63Yedu/hYYC+zoyAEMDdF4/wqWJW/v6Y+OopPx2AiLgTBOMyp5VdtQ4DOAGLbxPO1B kBb9ScHDNfwRP/Y5I6rwuf+qhdKj4h7VH1yla/s2zbwmjvwcp9uWpC3VA4/RPOYJcfiG Dxaa7Y5UVTw9mK75Ba3yOX4UYUrvt1ji3a5xQ5sELvRtcparKPcm/0ilEaiZGU4NZCiB vqCA== X-Gm-Message-State: AOAM533Nzpz8YSF9Dr+ZoayKLKVJPryQSvXwO9HOiuRuqkzNXMYwmwAX Os5RLC9IwmQgUMFFaSYjGKo9YLga7bQHK8mCcyG8HQ== X-Received: by 2002:a7b:cf21:: with SMTP id m1mr971181wmg.124.1601571515134; Thu, 01 Oct 2020 09:58:35 -0700 (PDT) MIME-Version: 1.0 References: <20200930171512.3986425-1-jolsa@kernel.org> <20200930171512.3986425-2-jolsa@kernel.org> <20201001092530.GB3999500@krava> <20201001102517.GC3999500@krava> In-Reply-To: <20201001102517.GC3999500@krava> From: Ian Rogers Date: Thu, 1 Oct 2020 09:58:23 -0700 Message-ID: Subject: Re: [PATCH 1/9] perf tools: Add build id shell test To: Jiri Olsa Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 1, 2020 at 3:25 AM Jiri Olsa wrote: > > 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! I'm ok with the patch as is, this addition also looks good. I think the ideal we should aim for is perf test passing from the installed location. I appreciate this change is setting up groundwork that other tests could build upon. I'd particularly like a shell test to run the libperf tests, it should be little more than just running the executables. The build/install set up and the paths are the difficult part. Thanks, Ian > 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} >