Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp30776rwj; Thu, 22 Dec 2022 20:06:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuadnPTB2zGXtTVs9rW3ZeuVp6KZ+d4NX7VMbeWUP8L4/pKqFfUHM3L4tDRYNJki4HTbW7G X-Received: by 2002:a17:907:73c1:b0:7e8:cf25:4b9c with SMTP id es1-20020a17090773c100b007e8cf254b9cmr6036702ejc.59.1671768383943; Thu, 22 Dec 2022 20:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671768383; cv=none; d=google.com; s=arc-20160816; b=ZOSTI+Ur6Km5W6W7b6sJ0Rs4nQVf69HdjXuYhs5PPut2ZceKvqA97dOzcFKdMuev4h /1/qzDcgzFt2Au/zcnRfj2PtuNeERPJC9MzAVHlACs38EUL4SZH4Pv6KvqNyo/RR4C38 cRtPb/39umYh/mDI8kQcm0t76E9tg/ZnZBwsjTmOaOToC5hE9prJgHcMMdB/jVv8AMXR L8W+GrXe4R07EsEzipFuDHksPOHEQWLKi4s8OvPkJVfEvlWfpIhxf0JScf5RkJ1pa1Ey EHMkfFITxvUQXip2gBrnoUNMMPBgSGNP0JkDL0oOPk4jLJhi846CO0P4Q8bVJ9dPdVyr wNKw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1oKHszNlyPRAoIoEblRlaQjb7vzsMZUlhtQ32+aR420=; b=BSDTu465dwgjafnFA6DUqrp8gkIiubgkTsvbAMU34yfm0sljg40bUDc5cGWh7tPk87 8leq61ISoYL8t5/oyWFuu+fiMYApopBLyz+zVmRmgqup0nAKQ1WkayCiu7wLjjuzA7sJ WX14LLtTiZ6+XbSHmBqmCSgQRKy4iP9rES/lDk9NBODDdL4btq5MBbgbJcRMovdxaavi yGWwDNN27vbK1yZfiIwEUYoKW9xr+H0sukjbqwWtHyj1My3Z1Tct05/YJY8jhzHrSerZ fOM9yr3w936ZtiKY3ANLUnz6nyy5TkAdZiS0KDVR0xShMTNAYiuzh6+k7/LpchzxPL5e GEzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n0qfaq6r; 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 sd40-20020a1709076e2800b00841e8b0d992si1770690ejc.77.2022.12.22.20.06.08; Thu, 22 Dec 2022 20:06:23 -0800 (PST) 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=n0qfaq6r; 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 S229897AbiLWEAE (ORCPT + 67 others); Thu, 22 Dec 2022 23:00:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiLWEAB (ORCPT ); Thu, 22 Dec 2022 23:00:01 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1024140A5 for ; Thu, 22 Dec 2022 19:59:58 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so7698826pjj.2 for ; Thu, 22 Dec 2022 19:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=1oKHszNlyPRAoIoEblRlaQjb7vzsMZUlhtQ32+aR420=; b=n0qfaq6rARj65lJ/ZVFLaxy257IeqtPIc09HTww6vmAwQGVqL6SYQFReXrfy2pysBd ZbChMSfgm14hRYpiN708UhTlzryNEQww62F7Gnw0TNupeN6R2ChAottys+1aZNnpKLWn Swb2ySRN1bAKSXkipUPajUG+UT/oXcjZt+IShgOS8agTOdo5WwwHrOuXry86amaMMJEx p2Nikb3gGFKUyBezQRyokw6fxyXupzrDduhF785ZoJieh4LMWQd2F7LM38ZCmCOqMIXG aZCGWYQ5/YVgM9hHTI7DRdZnhXfAraFlqCxccma+RlJpE/kJ6aDCAcrtcmZ6RTZA52ZS Kh6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1oKHszNlyPRAoIoEblRlaQjb7vzsMZUlhtQ32+aR420=; b=KckfQM/XGwbpZEajxNsRzyUSHi7b9KE8Uc8FtT80vX593CFUctvMMtLdF1NMYA/Rtm 1OYRhMt49bUj3oiQHX5oMVX2vAe1UsCkDWPQeHmzc39zN7JX5Pi5BRC8JCYEhM4LqB63 f/LiUN0CZYQw+SXY21BX2bhan01XuB70KkIOqqGb5O1xjOVtN7D1lIs9VcGNt9MpLvwu 1DWn09KfPdsSNfpG4kzCS5wDq6d/+kmtnKFhfM4yDmxJMAQUewrzT5IAGcBqTiOmU1kW zztMuCoTUBeIWG4/ObtdW8Ar8lb++Y6jLADTayykhtIxdHtMQAN/oGrnoMeRzI7qQluU XQeQ== X-Gm-Message-State: AFqh2koQJ4GAa0aIplBRPIFUENFH2EkspD7jXTXr5xA9vfOssBYd7Gno 9nysR89TtSzLBSb/9AEpF0MuDQ== X-Received: by 2002:a05:6a20:bc95:b0:a3:1ea9:dd13 with SMTP id fx21-20020a056a20bc9500b000a31ea9dd13mr8751967pzb.30.1671767998364; Thu, 22 Dec 2022 19:59:58 -0800 (PST) Received: from leoy-yangtze.lan (n058152048149.netvigator.com. [58.152.48.149]) by smtp.gmail.com with ESMTPSA id d4-20020a170903230400b001896af10ca7sm1256957plh.134.2022.12.22.19.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 19:59:57 -0800 (PST) Date: Fri, 23 Dec 2022 11:59:51 +0800 From: Leo Yan To: James Clark Cc: linux-perf-users@vger.kernel.org, tanmay@marvell.com, sgoutham@marvell.com, gcherian@marvell.com, lcherian@marvell.com, bbhushan2@marvell.com, Mathieu Poirier , Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/7] perf: Use perf_pmu__open_file() and perf_pmu__scan_file() Message-ID: References: <20221222160328.3639989-1-james.clark@arm.com> <20221222160328.3639989-3-james.clark@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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=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 Fri, Dec 23, 2022 at 11:45:21AM +0800, Leo Yan wrote: [...] > > @@ -103,8 +103,9 @@ static int test__perf_evsel__roundtrip_name_test(struct test_suite *test __maybe > > int subtest __maybe_unused) > > { > > int err = 0, ret = 0; > > + char cpu_atom[] = "cpu_atom"; > > > > - if (perf_pmu__has_hybrid() && perf_pmu__hybrid_mounted("cpu_atom")) > > + if (perf_pmu__has_hybrid() && perf_pmu__hybrid_mounted(cpu_atom)) > > After change the parameter 'name' to non const type in function > perf_pmu__hybrid_mounted(), at here we still can pass string "cpu_atom" > without warning, right? If so, we don't need to define a local > variable 'cpu_atom'. Correct for above statement, I did experiment and confirmed building failure after change the parameter to non const type and directly pass string "cpu_atom": tests/evsel-roundtrip-name.c: In function ‘test__perf_evsel__roundtrip_name_test’: tests/evsel-roundtrip-name.c:108:64: error: passing argument 1 of ‘perf_pmu__hybrid_mounted’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 108 | if (perf_pmu__has_hybrid() && perf_pmu__hybrid_mounted("cpu_atom")) | ^~~~~~~~~~ But I still suggest we can keep const type for the parameter for perf_pmu__hybrid_mounted(), this is more friendly for its callers without define local strings. Thanks, Leo