Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6799870rwr; Tue, 25 Apr 2023 04:07:22 -0700 (PDT) X-Google-Smtp-Source: AKy350Y6S0Ub/8p9taqPJ67zvMooDBCzWlqSn29zcSPW/3XQckVuYtFXlk6B96xOLV5BRtPkrr6w X-Received: by 2002:a05:6a20:1607:b0:ee:bfc0:2bfe with SMTP id l7-20020a056a20160700b000eebfc02bfemr21789234pzj.60.1682420842194; Tue, 25 Apr 2023 04:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682420842; cv=none; d=google.com; s=arc-20160816; b=YlFD2Q7qDLFShWtFIqnRbQueVMEQlk0md4V65TSPxmDf19Enq/tS+g7ZC1Wfyj1WYZ e7LTxX3hIzmyVAA0480sAytbSbqmMcEQANdbsKX86BdvWZtnmXUQJa1jbZOxrMZKnTbW oGKNifhFfRVMXCo52ssopoLEFAtKznBJK1yWYt84rsd9+MYPJVsoBHJIO2t2LXaO7dgb MibH6tcPK/0ag2WWbB3pX7oDhk1SaL2jmAVGkX11HM/L+HVpNpEu3e3aMEf8RCM1S58E /Slnw1XF2oh/zEaK2g5oxPx+hP926BBc2DA7dUERzHPx/QHLGVBQWieVbUiZaXy7LacG /oUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=fenDfuc/buuQmtTx6ThPEafvuX0IYA7AiJXSnRcQEcQ=; b=W2F+4hOkgmT8QPuZSk8ZSNyH0DIqdbCLaFUlo5kHlR3VPA16mrBNJ/s6SAkLV3UEwy NAkk3kNVhTCDhNGeITNT2YBEGD1zcIuVJZmAhKzJq11wDsP+w+PptG8OCoyQvI2Bulc9 XIDh3b1OnXHCTc2GlpaPn1qpjxwxHV0+7MFvKYIIrwNQIaNdgAWKSPf/Dhw5P/uZav0v l+F0cPdZBlEXUTzKZarVHzAaax09PTiKuIjSPctXy+vLmKyIx4fUcs5vF38KgBHCZ1X8 MhMEJlevCFwaGCjiWcIqfYLlt0OHevejjCY+HPciJjdlr45JZnWLfoaM5/ZtA3ML8S8F mDrA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t1-20020a17090aba8100b0023670bc014dsi16160243pjr.110.2023.04.25.04.07.08; Tue, 25 Apr 2023 04:07:22 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233746AbjDYLDq (ORCPT + 99 others); Tue, 25 Apr 2023 07:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbjDYLDp (ORCPT ); Tue, 25 Apr 2023 07:03:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AB7985274; Tue, 25 Apr 2023 04:03:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 58A124B3; Tue, 25 Apr 2023 04:04:27 -0700 (PDT) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E1E233F5A1; Tue, 25 Apr 2023 04:03:40 -0700 (PDT) Message-ID: <6a55956e-4218-4e11-4d7b-841761430a42@arm.com> Date: Tue, 25 Apr 2023 12:03:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 2/7] perf tools: Add util function for overriding user set config values Content-Language: en-US To: Arnaldo Carvalho de Melo Cc: Adrian Hunter , linux-perf-users@vger.kernel.org, coresight@lists.linaro.org, shy828301@gmail.com, denik@google.com, Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230424134748.228137-1-james.clark@arm.com> <20230424134748.228137-3-james.clark@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 24/04/2023 18:45, Arnaldo Carvalho de Melo wrote: > Em Mon, Apr 24, 2023 at 06:36:14PM +0300, Adrian Hunter escreveu: >> On 24/04/23 16:47, James Clark wrote: >>> There is some duplicated code to only override config values if they >>> haven't already been set by the user so make a util function for this. >>> >>> Signed-off-by: James Clark >> >> One minor comment, nevertheless: >> >> Acked-by: Adrian Hunter > > I just moved to evsel__set_config_if_unset() to util/pmu.c, next to > some other evsel__ functions to not break the python.so binding, before > I was getting: > > [acme@quaco perf-tools-next]$ perf test -v python > Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc > 19: 'import perf' in python : > --- start --- > test child forked, pid 500086 > python usage test: "echo "import sys ; sys.path.append('/tmp/build/perf-tools-next/python'); import perf" | '/usr/bin/python3' " > Traceback (most recent call last): > File "", line 1, in > ImportError: /tmp/build/perf-tools-next/python/perf.cpython-311-x86_64-linux-gnu.so: undefined symbol: perf_pmu__format_bits > test child finished with -1 > ---- end ---- > 'import perf' in python: FAILED! > [acme@quaco perf-tools-next]$ > > Please run 'perf test' and 'make -C tools/perf build-test' prior to > sending pull requests, > > Thanks, applied. > Ah sorry! I ran it from an in source build and got the python import error so I ignored that test. I see the new error if I run it from tools/perf instead. Interestingly with an out of source build it doesn't matter which cwd you run the Python test from because $OUTPUT is an absolute path. Normally I do an out of source build, but the Coresight tests don't currently work with that. Which I will submit another fix for... I don't know if it's worth getting rid of that edge by making sure PYTHONPATH is always absolute even for in source builds or if it will break something else like a make install? It's because of this line: -DPYTHONPATH="BUILD_STR($(OUTPUT)python)" Will make sure that they all pass next time. I also sent a fix for the build-test target on my platform. > - Arnaldo >