Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp39941imn; Wed, 3 Aug 2022 18:41:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR6M4yzFr8n7jSP2PJuBhgitQgyfp0DJURvM4NB/azw7pdcKqaGo81y0TDCXtHBut9Nk3xsx X-Received: by 2002:a17:90b:224e:b0:1f4:ebed:16f6 with SMTP id hk14-20020a17090b224e00b001f4ebed16f6mr7740210pjb.17.1659577290351; Wed, 03 Aug 2022 18:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659577290; cv=none; d=google.com; s=arc-20160816; b=kqgTz0h/3qbHiQ4E92N7S51fgykK/l5Qoau5VUAs+8Nx2DWEk5kkazw7/BKXYtzsRC 5qsJGEZ9oftYtLqnoaha0jZUAg+ODH8Fl9CRhKvs5mRk1B4+LePfwQKSCRRRHFLqVj9w quRcBx9lrHMHl7lZYOKeP3RbiDulhZMfEzf0j8Tg9JQdqNO/vkOL48mjSQ/Z3C/45h00 EAd7Y5vg+PEPqC60G5+7WSrBTP/ktcFJ5aLFq1VLd+Yy1aHxT3m4g7BMnmMigONZPFa+ LpIKGQC6Gd4MR9LY8BuDOSwGMlvJoAiYLok5RNN1LbO1FKtLNsI1dIMTQXMCitzBZVd4 hmYg== 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=qmHsy1Q+Qy+99H5+YhBfxvmg0PPmS0+X89adjUkkWlw=; b=hcRddASaJmfoLtREtIeGfasmIOBcVppQ38rTDdVBfGTfTlXOWgIXvkxOPKFrJejeU5 v66GBefblNAZFQ9Z+y4WoYA2Up/raLCuUbfjT2JI3yPk77obaAa0VGpAXBjLZ6OAjnI/ A0Nu77IdTSOZYTuBLK2S7NFvhXP0hy3/moZuzwacsr6gWIU8cAbSths79f7LyvGhQ4yV UPlLJ/rATIa361MuKBZ9gRsm/xtkaO1g8uV21Lc+6zGg7DrtrAQUWacO1os+gW1+62D8 MeHajF+KJG6KZ0FQ10UFXkO6BGBSBdRKgL4z7u2nddR9ny8LWhh0QW3kKuKUjxmvh4SW sfnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egbM4Eii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g19-20020a170902869300b0016d4e5ca5fbsi3570247plo.308.2022.08.03.18.41.15; Wed, 03 Aug 2022 18:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egbM4Eii; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237316AbiHDBWJ (ORCPT + 99 others); Wed, 3 Aug 2022 21:22:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbiHDBWH (ORCPT ); Wed, 3 Aug 2022 21:22:07 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F29C422DA for ; Wed, 3 Aug 2022 18:22:04 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id t2-20020a17090a4e4200b001f21572f3a4so4007808pjl.0 for ; Wed, 03 Aug 2022 18:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qmHsy1Q+Qy+99H5+YhBfxvmg0PPmS0+X89adjUkkWlw=; b=egbM4EiiUdEHQLRS/2yKD3DZ4MP6J9Mk1CGfB35ObRvvaaY6IXA66MG5k8Qo55AoFs ctp2C1vQhACDvBI2UdPJIsPWnHsfa6snU+TpTRTXpUawVLctXjdsvlVZtyyKeMNMTomD 2QqWB7Z4P0NKlmmKTl9t/ucTIMsYOnM7pxLC0w9ze8hlBAO4kBRZCLYHw2xMHU9v8WqL /XmPuuOXl2hDMKw+VCoysvzcCJw8/gP2/pIYmZLAaqVPxwz4TJzQzzWIaGqKc/OURk1n sh9NGRs8rWpVYk8I7sYI4QCFHbDJcfBnkHDH5JS9y43lSKvdtC9zq5/lu5YX3XDrupNv jHEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qmHsy1Q+Qy+99H5+YhBfxvmg0PPmS0+X89adjUkkWlw=; b=Nft8j2fTCnod0N6W0sOzwhVbIqqJ0dnM4XVqch4SGM3DUN9x7pjBg8s2+z4zKe4f/x XPH2zg2DuzMsfSGWOdllmOH75LCpCdtXk2j8S1WEBYHC2qfuwLnqxmDweDJ+yNCghEWL FCDf7yrmLQzvR/qcmhxDiV91PcI53byOKft4xsJbh5s5vl2kTuI/m1d25vNyJoYr8sQw lZUIs05v4C0vHqgmjPwR+/Nxf5xOHmpbNXjz0m7BzNh8je9LOR9OV4ZX8VPrAjiQ8xq5 AsOxe63J469GF1bi6IeKYK1KiKmyCOqs0gV2CV5o4X1k+kEvb0XRkSJVMJQ0TvXrzb0j 0cCA== X-Gm-Message-State: ACgBeo0Hk2OjJm7F7eX0GFl/3pRvGnzE5+5qTpmbVfqmJBzOM7TR/4Rw VMs1g7znN5arwRFlvovNYrGXeA== X-Received: by 2002:a17:903:185:b0:16c:3af7:dbc8 with SMTP id z5-20020a170903018500b0016c3af7dbc8mr28798986plg.147.1659576123297; Wed, 03 Aug 2022 18:22:03 -0700 (PDT) Received: from leoy-ThinkPad-X240s (173.242.113.38.16clouds.com. [173.242.113.38]) by smtp.gmail.com with ESMTPSA id n6-20020a170903110600b0016f09d217c1sm2685227plh.281.2022.08.03.18.22.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 18:22:02 -0700 (PDT) Date: Thu, 4 Aug 2022 09:21:58 +0800 From: Leo Yan To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users , LKML , Stephane Eranian Subject: Re: [PATCH] perf symbol: Fail to read phdr workaround Message-ID: <20220804012158.GC133193@leoy-ThinkPad-X240s> References: <20220731164923.691193-1-irogers@google.com> <20220801015259.GA101027@leoy-ThinkPad-X240s> <20220803152527.GA133193@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 03, 2022 at 05:26:39PM -0700, Ian Rogers wrote: [...] > > The question is how we can specify the path for the lib > > libperf-jvmti.so in the testing script? > > > > If we can run the test case from the root folder of Linux kernel > > source code, the lib libperf-jvmti.so can be found in the folder > > $linux/tools/perf, but for the integration testing the lib should be > > placed in an installed folder. Any suggestion if we have exited > > way to specify the path for libperf-jvmti.so, or need to introduce a > > new shell envorinment variable for the lib path? > > There is a hack in 'perf test' where we assume a few paths to tests: > https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/tests/builtin-test.c?h=perf/core#n308 > so in this case we could look in the same directory. There is also a > #define for PERF_EXEC_PATH. Thanks for the info. I will try to search paths like the buildin-test.c file, and the lib libperf-jvmti.so is installed in the folder "$HOME/lib64/", I will check if can reuse PERF_EXEC_PATH for this case. > I'd prefer it if the test could be self contained for example: > > echo "int fib(int x) { return x > 1 ? fib(x - 2) + fib(x - 1) : 1; } > int q = 0; for(int i=0; i < 10; i++) q += fib(i); > System.out.println(q);" | /tmp/perf/perf record -k 1 jshell > -J-agentpath:/tmp/perf/libperf-jvmti.so > > where jshell runs on the JVM and so we should get some jitted execution time. Will do. Appreciate for sharing this! Leo