Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp251566rdg; Thu, 12 Oct 2023 04:56:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGt5nJCOkwd1H7H/AVh/zK0mfPFNzcTxkKkPD8lNCVTXjdpfn7zN51jXH3B3b2KVaZN5PoT X-Received: by 2002:a54:4e84:0:b0:3a7:48eb:2de2 with SMTP id c4-20020a544e84000000b003a748eb2de2mr24765373oiy.26.1697111809745; Thu, 12 Oct 2023 04:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697111809; cv=none; d=google.com; s=arc-20160816; b=oxk3tv3lJPW5P2XkAULKmZ/ZExa9H6exr+FBFmo0Iw9jWsFGS1IPDWpu0xBQKLd7RU lLJTC+iYhA2iHYDO43x6K6qaEPhiKeOMS0Ec/7pOVTVoHtkcnJpK39VBEXnPXzqtUR4Z Lzmv+6byxanxRe2mbhYTeS5L1zePSVPfTLpIEevMcHoqECcGNaudEWifi7EoNQBv/M+c DmUEBzAf64n3IpnYQfrKYt/pFgi4A6bhIDVFvqlhe0PqhQmAp0avbeK6u1d8keDppfBR uT2cg+kYTJwKZ37uPVPs0VnkCr00vgMoqw8eefkjW47L/TZLqGypbdnen6WH2Adc7mW9 r2Dw== 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 :organization:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=2UCySkGL0POih85O4wPTAnmXYnAEUt2mU6RdjPftVJs=; fh=W3U2V5NWgOp/qb3+mq+iAX2Phz2PcGd1A8pr7VsL1jc=; b=MPwsh0ePXVsv4DpJ/8rN0yw7y0ZYRfJqnZVGnWvSr5QrUxdfKz251XcaBwnlNWmTHz oWJ9Z5PmKSMZrYf8W8PTCHDTss/J3QUykbnefhNsEPcZo0w4hgunKu868TbBA/UVFTzV zEGt9MRZPFOgDLUbvP+tbewVwtxtBCI6QOgFfH9rsPhTuaNLrK3/BGoG45mKZvFFjZq7 RgAaS1HBef5E48udKuF8zLtRbUd+2jp6sbaqTZzSuyDbv5/bkIM8rrNRmQU8kyboCpCZ Zmb1d1C5PRh2yrw2l5apwk/OoQkbCVdVJV6obhZyQRQt1InUdH7KhliE1JpZwmH6pFKm 3IhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MT+tfkyk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ca7-20020a056a00418700b006880a2ca0fasi14096562pfb.312.2023.10.12.04.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 04:56:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MT+tfkyk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C6DAB80D7540; Thu, 12 Oct 2023 04:56:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379202AbjJLL4Q (ORCPT + 99 others); Thu, 12 Oct 2023 07:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379254AbjJLLzs (ORCPT ); Thu, 12 Oct 2023 07:55:48 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44055468D; Thu, 12 Oct 2023 04:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697111630; x=1728647630; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=u0eUJHiuTfxnEuvCucLEAgO20pruS/LMBzHzjX0mWE0=; b=MT+tfkykbqOjhGkUywZ0OYi/4m8M1c0XtzSuMyOqWoRXUbedOcIpOop/ 2mJkvzh+bmLZBYVgb+8+NrSHaGDf02JoYNoNvBFGGmAgW3+nJkiHjKpSY btInmaCUv4J5JJ6b5GN+FiXFi9WhEpxxXgZoyDikxjFEP8NAWDj13Ng+B 8mZQZgOOZu2Vk9vxmjaLKgL/j5p4tPPWitB6SVBtfqIg02MRzvK5UQ7Tu eOJQMUORZDHC/YW+BpEaQFZ+MEi9wtjt7GfsWBVvwv50gU9ahR0BI+hyl bv2YzJOxNyABTENWMrgyxwIplALvZdYmb6Op7dJMnBzHA1H8Onizdmy7Q g==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="415949549" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="415949549" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 04:53:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="870545735" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="870545735" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.41.84]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 04:53:06 -0700 Message-ID: <5887df01-1263-44ec-a625-e550cea78289@intel.com> Date: Thu, 12 Oct 2023 14:53:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 5/7] perf pmu: Const-ify perf_pmu__config_terms Content-Language: en-US To: Ian Rogers , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Richter , Ravi Bangoria , Kajol Jain , Jing Zhang , Kan Liang , Yang Jihong , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231007021326.4156714-1-irogers@google.com> <20231007021326.4156714-6-irogers@google.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20231007021326.4156714-6-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 04:56:40 -0700 (PDT) On 7/10/23 05:13, Ian Rogers wrote: > Add const to related APIs, this is so they can be used to default > initialize a perf_event_attr from a const pmu. > > Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter > --- > tools/perf/util/pmu.c | 10 +++++----- > tools/perf/util/pmu.h | 2 +- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index e11901c923d7..eb17f00bd0d2 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -156,7 +156,7 @@ static void __perf_pmu_format__load(struct perf_pmu_format *format, FILE *file) > format->loaded = true; > } > > -static void perf_pmu_format__load(struct perf_pmu *pmu, struct perf_pmu_format *format) > +static void perf_pmu_format__load(const struct perf_pmu *pmu, struct perf_pmu_format *format) > { > char path[PATH_MAX]; > FILE *file = NULL; > @@ -1132,7 +1132,7 @@ void evsel__set_config_if_unset(struct perf_pmu *pmu, struct evsel *evsel, > } > > static struct perf_pmu_format * > -pmu_find_format(struct list_head *formats, const char *name) > +pmu_find_format(const struct list_head *formats, const char *name) > { > struct perf_pmu_format *format; > > @@ -1230,7 +1230,7 @@ static int pmu_resolve_param_term(struct parse_events_term *term, > return -1; > } > > -static char *pmu_formats_string(struct list_head *formats) > +static char *pmu_formats_string(const struct list_head *formats) > { > struct perf_pmu_format *format; > char *str = NULL; > @@ -1256,7 +1256,7 @@ static char *pmu_formats_string(struct list_head *formats) > * Setup one of config[12] attr members based on the > * user input data - term parameter. > */ > -static int pmu_config_term(struct perf_pmu *pmu, > +static int pmu_config_term(const struct perf_pmu *pmu, > struct perf_event_attr *attr, > struct parse_events_term *term, > struct parse_events_terms *head_terms, > @@ -1379,7 +1379,7 @@ static int pmu_config_term(struct perf_pmu *pmu, > return 0; > } > > -int perf_pmu__config_terms(struct perf_pmu *pmu, > +int perf_pmu__config_terms(const struct perf_pmu *pmu, > struct perf_event_attr *attr, > struct parse_events_terms *terms, > bool zero, struct parse_events_error *err) > diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h > index 24af7297b522..5a05131aa4ce 100644 > --- a/tools/perf/util/pmu.h > +++ b/tools/perf/util/pmu.h > @@ -193,7 +193,7 @@ void pmu_add_sys_aliases(struct perf_pmu *pmu); > int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, > struct parse_events_terms *head_terms, > struct parse_events_error *error); > -int perf_pmu__config_terms(struct perf_pmu *pmu, > +int perf_pmu__config_terms(const struct perf_pmu *pmu, > struct perf_event_attr *attr, > struct parse_events_terms *terms, > bool zero, struct parse_events_error *error);