Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp743677rdb; Fri, 6 Oct 2023 19:14:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlBloh3aKtiLM5pIDIwxg27uNBhC8Lgk3U7004UcdFn/aPP+eyRDq2V7KhzL1s+zmDw+u/ X-Received: by 2002:a17:902:ab82:b0:1c7:443d:7419 with SMTP id f2-20020a170902ab8200b001c7443d7419mr9928328plr.29.1696644881809; Fri, 06 Oct 2023 19:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696644881; cv=none; d=google.com; s=arc-20160816; b=oHvYS3QpBukzD/3IN4TexyxQLsB7AjOu8KGm4eziQKlQoGmhz4FriicWV8rhjKjQ5k 5ohtViiNwIqtZhmoOYbVMfmRdLj3frcNw4XAOQoJh4nSTZUF61xMo9dNhkkJll4bQOJb Gm79Oock6wP52U/FfojT2ug+fuSy9t0xSyKUT6VYvSSzAIUdjXM3KwnapLJGV7/7s1PW yOX1W5OtRAdd7CUb8AH859pDGPoebZt18rHBVGLgYqs7z4kr4PZrj40a0sa80udACEib usYuFV5+gaqTebL8Iui9uv/yf/IVT5eqGeM5v3s64wvsIQad5Y5wL7kk/p6f7Jk82mgu Ywpw== 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=FLkv57fF17zqRfpQp8SmIixiH1bpbCUPMZ8JZj8EM2M=; fh=/5tleBjPDujrXIYss611tAyhfELId0etfY4oKm6i49Q=; b=lcEbK7G7RAjHLYTQukAM4AUC0q0ux75rG64UOEJ3vdQvGyZubX0yIdJvrrc88GxkPJ EnG98FUBr1knEEyHQwfLllHSs2X52udjkKQFATsh4kaztccNcQB+5k3YqtsHnpyQBe1K mBEOjIkKpnkRpEZAvNzCL2micenSN4DdcLToY07kNKILXQtVyUqfuvmhIRdDlp2/QMpL 6WiQGcIEjmVLxrYYLE565zTikBCxLwSHN2wqmIl9t2NwTLhRxKfgKeObfbITC9yaxs/Z ZP7eUygDBaLF3hTp7uc4kE6LMzUhPobO6WHTEHXOxIFP3SykbV9gz/QdxiKqCzz2eRbJ Q/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=XxnTRAx7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j20-20020a170902f25400b001c62cfff799si4589374plc.176.2023.10.06.19.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 19:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=XxnTRAx7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 3E10080A64CD; Fri, 6 Oct 2023 19:14:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234064AbjJGCOK (ORCPT + 99 others); Fri, 6 Oct 2023 22:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234069AbjJGCOE (ORCPT ); Fri, 6 Oct 2023 22:14:04 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C1C100 for ; Fri, 6 Oct 2023 19:13:59 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d918aef0d0dso3888528276.3 for ; Fri, 06 Oct 2023 19:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696644839; x=1697249639; 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=FLkv57fF17zqRfpQp8SmIixiH1bpbCUPMZ8JZj8EM2M=; b=XxnTRAx7E6ffCQwPnXQtUjxD3n/quOBWFowClBnMNVB8xFJmrZkGoqUMRWh4YjX0lc 5fa2hX0oXn0rLgfRVB9OkliYXPdgsoFv5cdlHlRa2oCzOpa/iJV1KjhSa9kSRJHL0+YH uMVAqUmzMFdErRvDpXBF/o81g2y3QRAhh8i25ugp9/lMmw+dLXu+xgIjztFJBEF3tz2d s+0l7x/ZmGjhWHuBuE5lfAiPvg/dyzf9kplzthdsoGcVPZBIlOFRD48JdFjfZuLLsVFR /QgqSmo495FbSXdq5Q085/1PtCdKwSNHUD22dRk6s9NjIBLbkIgzzaorQoL0ubdFpPxn MF3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696644839; x=1697249639; 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=FLkv57fF17zqRfpQp8SmIixiH1bpbCUPMZ8JZj8EM2M=; b=KbVKEfuHMC1s497atEuHAtY15gwDXL6pVg5b7SeNYsmiqhGtfKb60BetNXwPTXzHh4 s+C87WHK7G4c6nenRUq+o5gB0eY3IZl0WgCDJP9jInhWzhWC0UEncY2NBwxmHLe/4zsR hvSAa/wJJmMnYlK6gPqa9UbcWtp6sBNncGWwYzXmqHfc0nskZqOaqs31tkSj20AyMRPe 8T6A+tPb45VLRhVRGm6vH8X+8vjs4mxenx0pTY/+UMxlOXopXTuq0qk2HYMbXIMNnC12 bMUQIb3IFT+BZl6H7EgEd2+daXgraLKgvZN08PaV+QH1y3hbe5qcRqfGbmtRFqeNxZGL RiNA== X-Gm-Message-State: AOJu0Yy5sqrRPdD7fPTI6sJvftibk5M3mwHsdRf4gxQQuqb7XdjCaTAS vaCFMkQW73VHkc/EZcYmawli7LQo/KmK X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:7031:b36b:6c77:bfd0]) (user=irogers job=sendgmr) by 2002:a05:6902:990:b0:d89:4382:6d14 with SMTP id bv16-20020a056902099000b00d8943826d14mr156266ybb.6.1696644838851; Fri, 06 Oct 2023 19:13:58 -0700 (PDT) Date: Fri, 6 Oct 2023 19:13:24 -0700 In-Reply-To: <20231007021326.4156714-1-irogers@google.com> Message-Id: <20231007021326.4156714-6-irogers@google.com> Mime-Version: 1.0 References: <20231007021326.4156714-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.609.gbb76f46606-goog Subject: [PATCH v1 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=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 06 Oct 2023 19:14:39 -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 --- 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); -- 2.42.0.609.gbb76f46606-goog