Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp477721rdg; Thu, 12 Oct 2023 10:57:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHESjuJ4IB+o7x+jsdtc8lV0KlG17NyQnx0lIAE9KlqgrCHnJSdIo567bATVNQskA+iHrlB X-Received: by 2002:a05:6a00:24c3:b0:691:21:d9b7 with SMTP id d3-20020a056a0024c300b006910021d9b7mr29991374pfv.27.1697133478418; Thu, 12 Oct 2023 10:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697133478; cv=none; d=google.com; s=arc-20160816; b=ZpOgZdeDFLcJKvmbpY4qQMcWZbNSaPxOYz6173hO7Kyrnd5WnQm3yOk40wyu2rLe6H AjdrBWkWFlmRCLgbqP+1GLZtiOc90ZZ5XHzugE63eq+BZCPEr5O+TgckY8auVBumvzh3 xVavibMZAAb7+i0yRMC6W2Jljh4zyoZvNaFQSbnV5BZrVvHjhp909oryBR5n2Jw8Mm2W vexQyB2deTMElxSP1a+P1+yFPWIZNhtTc4VNCD5UXtBuAIWgfcm3kQCcOES5TJy/HKlx QK/4Qq1c3jKy2WY9wHAtDQJariYdjgqjgcolyJ/vZhi/Yre4R281WF9ylAaLl61zwIum qLzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=wGZZkKhNq9JhzWRjca3M7jYSu+YUOulkgrRkrXoPM5M=; fh=/5tleBjPDujrXIYss611tAyhfELId0etfY4oKm6i49Q=; b=s1oGo32LQRE2CtW14HNWzmfQ4ZMommAuNeY8YTWdAYxTj2BmZJM5HuD9oiAfi9mcmT Lo4L7TW4HOv069u9ZpK9m5nGtOQTqDtyQO61KOCmYkLlS9rBJl7YpZh8MX3pZsvfiid1 d4TdA6SmLtLRm+k2A4MnN7i/fBZecnlU52XlE1kMZ3vEKBjvxtvkJmBqRZxPrjDK+VaO dE+dnCV9VHEYrQLlUqdHA3+nDAFX/z+t/crX+CVXHMtNzOvI/eDVNgbjvOsP92FyHHTY Kfu1r/I0xGTKblT5OyEn9K80S0tjutAmU/yr24AZvEln5x4oZbmkLDf/1IfO7an1kOnK o0jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=RfbCr3Wk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ei5-20020a056a0080c500b0069024c6a9a8si14151324pfb.389.2023.10.12.10.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 10:57:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=RfbCr3Wk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BB27882516DE; Thu, 12 Oct 2023 10:57:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379682AbjJLR5L (ORCPT + 99 others); Thu, 12 Oct 2023 13:57:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442039AbjJLR5E (ORCPT ); Thu, 12 Oct 2023 13:57:04 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E85AEE for ; Thu, 12 Oct 2023 10:57:02 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-c647150c254so1020931276.1 for ; Thu, 12 Oct 2023 10:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697133421; x=1697738221; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=wGZZkKhNq9JhzWRjca3M7jYSu+YUOulkgrRkrXoPM5M=; b=RfbCr3WkTW93Hl0hg8e8vr6OVtQf2LDulNPp0n5HwjPA70073Jo6Q1H7nYVZ8N/BsT 0ku5q+fiMc4X2GZdege9jhPdOsLrJ7KefXsuslt+QqXyhaec5a6lMd7ilfR+KkFKEhMf yM3LD22vH18Fbe5AJFsNBhYBI7EtpiGgKkalRGiV3MXmJlqFA7VbQ9MHSi4A2AnhYyAt 5di9ookNmiFkGChRiol/bEbIDaodwQpt39YfVej0Pf1Kguc6171vHnOQsoC9YWZMG7/Y SROA3mVS7ABZPbzpgf0APyjzTxa2UwjhMpCCksoEf+91in3eBn46k4m2KrNqbqzsCoUd vpaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697133421; x=1697738221; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wGZZkKhNq9JhzWRjca3M7jYSu+YUOulkgrRkrXoPM5M=; b=GcrXv+3eG3yynrMjzXXv4iAwVBi9twatpocoy3Q5pKrFJB3FtYBZt22dweRHh5EjN9 J0bNtkON0fG42sPm/9MoipzZESPTTfzOl6PSepQgdF3P3j+rrKK5zfpabf3uS5tfYAkN dpW2AGWaDjJomwaq9YJiewHfNCvauKZ38fzlj8qpJ7ahatYi2vbb3Ulq0s+QlIJONmm/ HQtXH3P35baY1wtKMd/Y5XVuIM4UmJtS3CTtErhPRd6ct1TIqAWMoMsX+rOOSroE4Gsu uma6ZWNA4rVJbpouOUEuTCF6ziXDS6wLLgbq2SNtZcgZgQRQsbhBzIyoPxp0g8W9rgmK 53Wg== X-Gm-Message-State: AOJu0YybrjYkgX2KrUkFJINlHYDi/VZi6NdGlRy74UKYL41TlBnaiWH5 8cgzcngTbfh34Spwe5YP33TcNqq4wjKh X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:6a89:babc:124b:e4e6]) (user=irogers job=sendgmr) by 2002:a25:f609:0:b0:d7e:78db:d264 with SMTP id t9-20020a25f609000000b00d7e78dbd264mr468922ybd.5.1697133421379; Thu, 12 Oct 2023 10:57:01 -0700 (PDT) Date: Thu, 12 Oct 2023 10:56:43 -0700 In-Reply-To: <20231012175645.1849503-1-irogers@google.com> Message-Id: <20231012175645.1849503-6-irogers@google.com> Mime-Version: 1.0 References: <20231012175645.1849503-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog Subject: [PATCH v2 5/7] perf pmu: Const-ify perf_pmu__config_terms From: Ian Rogers To: 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 , Ian Rogers , Adrian Hunter , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 10:57:55 -0700 (PDT) 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 861e485e0a70..8ef675ea7bdd 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; @@ -1131,7 +1131,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; @@ -1229,7 +1229,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; @@ -1255,7 +1255,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, @@ -1378,7 +1378,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); -- 2.42.0.655.g421f12c284-goog