Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1871907lqp; Mon, 15 Apr 2024 23:23:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWqrRdJAy4rifIavuHajg7w30qbmhe9XR4uqD1PvbJShqIhPYBUSp1GAoxIKJfN7GA1w1g3y0ngoVOgalkEtFGEfPvoFSybpO/IitnF2Q== X-Google-Smtp-Source: AGHT+IFBGU/5P0rW1Z7qroF8zTBKm4Cdb4B1lpJNCsqkxDPKUDkCQmbiyE9Y5jrVk+oLC2J59uBe X-Received: by 2002:a05:6871:7a87:b0:22e:b175:3c08 with SMTP id pd7-20020a0568717a8700b0022eb1753c08mr12994861oac.59.1713248606952; Mon, 15 Apr 2024 23:23:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713248606; cv=pass; d=google.com; s=arc-20160816; b=OhG5sZb7Ki90itZd1ZkWusCsgjT9DYP2bVl8c9va/Ky+pvFRQVOqFlgGoukXQSx0xk IB/t2c3IETH4ndG+vgbQ5Y+xVHIGtU7v0OyKXcVRlomDyMN1GHhgCMqkKvRj5MKv4wYh xM987/ow3/gkqktBCX4uigNcrWy/qXI6Ch9Xb4dh/d9KafW3kpHUqiHfM/rYVt+jMEtm SrbbdLijsvSezEjPZ3nAB3goSed42M1nVwJjmiG+rJ5dxVFVfYmm0SB8csQMltE/4w/9 rVKZkPoxbaftDqGzqGw3OONhwtVxPSKO+8js8lfGxfBnWEPYM8qmp8D0FHGyLZk10LKC CSWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=CS464tDCakpyTmrmcLFcR8YYU9aH6y31Ipzi53/1x7k=; fh=EaqMLEjulJIe1RGAdfG10A6ZdHvyAFe6lQT41ep+2P4=; b=MgCXcZb0fkOtsyZn75pK/04OKaIWBE30WqMHQL7kxrsqeY0q4DlwIL43YmpOhL50fo ygt8Q0JQS0EFoDBhHY+PYdJqXaH/33WNWBmT0fD6r5LMJYOpgXgdpPyAoDxwCbaia+37 G/c80UkJ72e9HxB9iv3Md1oqpyI4uzAQsRaRIaR2pdB0rvfa5QPyiuqB1EParWlY4+5V 1eE7nZn81QgM+SpoiJjiMtfwQ5FS3Nh2X7bk8AhiwFUcZejzclyeCgd+KaowCUA9zkCw xosY8c+M+z7+TwtdhzDzuTev7stkcnIgoX0y/piYoU+/hyJ8KYPgh5mIaB2qD3gowZWy cqkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2JEn8eOz; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-146335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id gg23-20020a056a00631700b006e733588b4bsi9080765pfb.59.2024.04.15.23.23.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 23:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2JEn8eOz; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-146335-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146335-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 47284B23169 for ; Tue, 16 Apr 2024 06:19:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 132471598F5; Tue, 16 Apr 2024 06:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2JEn8eOz" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE4821581F6 for ; Tue, 16 Apr 2024 06:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713248179; cv=none; b=VENe4LdB1iq58ayqlB8Tj2X0sEs6MU+CONk8yP/CmIaG/1cM0FRIO4jgyqFFnmR2BRBgVA9DAsQZKLybYofXYNkIxzFIjOPfkrIsqndTBTZEAygG/PChiwpfs6/40h5WPFPKqsmuupYkL9GSfAtMZEj6NY3O643UHF4VaEcyD5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713248179; c=relaxed/simple; bh=RJLEGacEoWTcJGv5R0SFmVMGUwKOfcVwsf41gQZkJ4U=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=oFyiRAgaf6obNH4uiBjnck//mB8k1g4libV1K9CdeqNGRlDYw+4YoOot3KxPg5cDPANmheexGr3o1OVdSsl4RA7WAoK/OQQ3XjNEkLCeDL9cJ5zyr4hgdmqBcT0B/lV9SLaW01nnzpMzNcOKydRbop0RH0QGLIQX3CufqT0edd8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2JEn8eOz; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dd0ae66422fso7990817276.0 for ; Mon, 15 Apr 2024 23:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713248177; x=1713852977; 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=CS464tDCakpyTmrmcLFcR8YYU9aH6y31Ipzi53/1x7k=; b=2JEn8eOzqJsheImB37OB5RjMrLuxx1MmAAVe1ESawyN7MwgjXfNak80eiQDclyluRf B9dQuSQBB18S5eMNDtgwwGxa8FsMscw4o21oH9jDQdezNqeWRvj+zAFqRbx/pvQSycQj RDkMHIOKKF90NZlfqkNay9oVQvH/bSmIF68LV+wNjFfa21vtFiEvbBvljMJaO6MRFx69 bJqXXm/cf2yAdsIGut2gEjd3//GVZ2tbqhshsIyHm5cL5qBSwBzWETqFstGGvfXCDBcZ VxcQSIWHvgc2HwYRXfEj/HDRhfb9xoCBmMQ/FzgreaCtZVzf1esFO1ayK2Q2cB5u/Bgq 2xHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713248177; x=1713852977; 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=CS464tDCakpyTmrmcLFcR8YYU9aH6y31Ipzi53/1x7k=; b=lvi/6EEYG9UsyToQJdcFU6+yJxayzXwIdX4LlTKN1qyXGLjVYyerHMegaVJHXvTZAV g1j/p2MJ5mF48e0IUwL35nv4eoJdbv7fIahZ3ETtOlXYc5fxZCXNgyCcOTbnnYelGmBz /4GtjIC1LD2RcLHYSlR8ncghvNEUozm92JoU+fTXRfPhcsSVaaPPX6wDdTaBGdA1VmxX 7DrpU+UElOfpxWOxGqLuLVT8m+/yoZe5EuSd0rKY4X31bzbfmnISj/rJTKYNrYMDO3N3 MB0uUN+mY9Xu4Hu6ey1V/9ZojgG/2u0mHhSsOPA/+LpoMlMvHrBpV9Zw5eoSoiqQCJO9 nEGA== X-Forwarded-Encrypted: i=1; AJvYcCVVstbt9utuuKLiMQavX2IYPBb/eohinHmNp4BzkNohg1ooVv/k16MToGeFFhkOBXWKQSBfyKolqjGE6PiUirVBlVwttIuEXkwr1N7F X-Gm-Message-State: AOJu0YwYzi2EmZBQVeDWmQEooKO3XrGhHDKdTYwnM1hfhr6eTKmzFEdK B6dnFyzVFtOkddc4aIyCgJ41I69bCnxQzPsNR/fZ0a//quNEhsA34hpGd4/XiNKwj1WCzXywVl6 aEKPucA== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:30c8:f541:acad:b4f7]) (user=irogers job=sendgmr) by 2002:a05:6902:100d:b0:dbd:ee44:8908 with SMTP id w13-20020a056902100d00b00dbdee448908mr615874ybt.0.1713248177044; Mon, 15 Apr 2024 23:16:17 -0700 (PDT) Date: Mon, 15 Apr 2024 23:15:30 -0700 In-Reply-To: <20240416061533.921723-1-irogers@google.com> Message-Id: <20240416061533.921723-15-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240416061533.921723-1-irogers@google.com> X-Mailer: git-send-email 2.44.0.683.g7961c838ac-goog Subject: [PATCH v2 14/16] perf parse-event: Constify event_symbol arrays From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Atish Patra , linux-riscv@lists.infradead.org, Beeman Strong Content-Type: text/plain; charset="UTF-8" Moves 352 bytes from .data to .data.rel.ro. Signed-off-by: Ian Rogers --- tools/perf/util/parse-events.c | 4 ++-- tools/perf/util/parse-events.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 3ab533d0e653..8d3d692d219d 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -39,7 +39,7 @@ static int get_config_terms(const struct parse_events_terms *head_config, static int parse_events_terms__copy(const struct parse_events_terms *src, struct parse_events_terms *dest); -struct event_symbol event_symbols_hw[PERF_COUNT_HW_MAX] = { +const struct event_symbol event_symbols_hw[PERF_COUNT_HW_MAX] = { [PERF_COUNT_HW_CPU_CYCLES] = { .symbol = "cpu-cycles", .alias = "cycles", @@ -82,7 +82,7 @@ struct event_symbol event_symbols_hw[PERF_COUNT_HW_MAX] = { }, }; -struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = { +const struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX] = { [PERF_COUNT_SW_CPU_CLOCK] = { .symbol = "cpu-clock", .alias = "", diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index f104faef1a78..0bb5f0c80a5e 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -250,8 +250,8 @@ struct event_symbol { const char *symbol; const char *alias; }; -extern struct event_symbol event_symbols_hw[]; -extern struct event_symbol event_symbols_sw[]; +extern const struct event_symbol event_symbols_hw[]; +extern const struct event_symbol event_symbols_sw[]; char *parse_events_formats_error_string(char *additional_terms); -- 2.44.0.683.g7961c838ac-goog