Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2821550rwd; Fri, 26 May 2023 11:45:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7uVRbr0o2tCHdmerGmPw1kL2T52lGyOtBd6XL5EMM91UCpH8apAcF1O4xz/B+xR0iuc70q X-Received: by 2002:a17:90a:8048:b0:255:9f00:c48b with SMTP id e8-20020a17090a804800b002559f00c48bmr3157584pjw.10.1685126715080; Fri, 26 May 2023 11:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685126715; cv=none; d=google.com; s=arc-20160816; b=o/htlbCvUpKCmCHBOydYo1i2Xvyi8qGY9bcCnUpbqqxlAE7TrPi6AxIy7dAnhwnHTm dQ3r0m3bmZGd6r0oBBk9iYxTXwzl9qInIvlAAxhaXQMgfqGWp/BEXKB1lo2DnpSAeJup G3qpjl7D/YuZnZsR3oTKL8OYprP58k7e2aP1rxKIs3+TIO1jf74IeIAud2XWtb9HiOmG xcDFeWP8mJ8HqhenbEghrOvegWsFqht703cGavKo6jd+vhFBmvXsOzz6DLOz66OKBtOb 51Ma7Sy0ZblGGYXajMPWZ+yn0eo68uRVcPuxz+y5np5jBgqozNy61WTfLxXHSDCXd8UN yPpA== 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=PQ6/7wH3wD+sz3l8jATNpn1TZP74J5iSNRHOLe9pzI0=; b=jqNcv1HaqByNddcEs1JX5fd7F1Q+iSUcj0vcOYUVnOrOxAdzD54VXqZdTblPttZTRa Ox8WuXfzlGlr0uLdWOI+lKpFeHzzu5h/lc7ubRrcNCp8GNwPOQOg88g5m+1TWKCWgumP llDf1Shr+EDGVjxE6FhLznD71yllD+fkk0XjN0ubKfqMR+MvMCs4RKeGpN/VitLZH/Q3 FuvdLbvvMSuHHDDy6/s18FUtG7tFYRSNRIN8zHJH64YoahMPZWZVoOe04SPk0Sc12uFY IZldjckUbC9CHSjcSHPX3mg4/goqghs91shLmauuKs722Aui5JhTFKiJKSSvEBUzn4t+ tlXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=AUsGHk1c; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oe5-20020a17090b394500b00246f8b06125si7473221pjb.108.2023.05.26.11.45.02; Fri, 26 May 2023 11:45:15 -0700 (PDT) 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=@google.com header.s=20221208 header.b=AUsGHk1c; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237598AbjEZSea (ORCPT + 99 others); Fri, 26 May 2023 14:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242548AbjEZSeX (ORCPT ); Fri, 26 May 2023 14:34:23 -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 C43AEE42 for ; Fri, 26 May 2023 11:34:17 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-bacfa4eefd3so1399023276.3 for ; Fri, 26 May 2023 11:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685126057; x=1687718057; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=PQ6/7wH3wD+sz3l8jATNpn1TZP74J5iSNRHOLe9pzI0=; b=AUsGHk1c9uTHOghP5ICbKsK1um7JsTzGLRPWZUjJIfN5E2WrVSOFdOrqJu/tv99hd8 ewuYNgOMwXmdbKIHQbdVpXweNIEL+jY7QjWrUeBKdHfCI1ck3e09pHpzzd63jjzW18Z1 kPT2/UDwNRh94p9o+F5V7XEwAJ84y224EelIL3IaP+cb9H7SQer0EwFev6vh6UdUoeCF rBDj78sV7z3SLwRTYpKELGkD0sOqpNb5Nkqf+Nf5vtxruSzwDVY2/uMuO2yWujkVfBFu 82gPmmJBt2/rQlTpIJMfKKSBMFQYDVHBOj7f7Rx3a29OOyyD1hz2O8fniSlJId5vB3c3 u4YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685126057; x=1687718057; 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=PQ6/7wH3wD+sz3l8jATNpn1TZP74J5iSNRHOLe9pzI0=; b=C9zwWLp0rnw05xXESucgTYsA6iwiYSLCB2GzBFw7Kovu8zXsXKyV7f5+N3QTilrmUm IGp9l8DCUuCyyCD505FtL4U+jv6qm6Q67U3DrWdF0pt/Twszegayn7y+oZLoSp+aACwD PCiid7chsiEYxniJyOvbxKC9EEA/QfNkFvYP/2eZgXZbxM7wNAWiMtLDOByFZHA0a3V8 WcdWcNq8eifxaXqVwR2OlByRgLNkhm0B5WB2le/SjCTEUUPh1zhOw2HQP+yq8MH72+Ut zC0sK/j5xvT7nNKLILtDbMb9YZnKwmu553x7ylcpnT08l2yJGRukXB/pbkJe7ve8czq6 qSxA== X-Gm-Message-State: AC+VfDy1y8z6lDhaije/9BVdIXD0vMKNoAg8K+4Sbzh6IiV+D4NN57Fb fbt98zgqK3wuTyfDcfM/xUKyX9a3tV5O X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:3b4e:312c:644:a642]) (user=irogers job=sendgmr) by 2002:a25:4542:0:b0:ba8:93c3:331a with SMTP id s63-20020a254542000000b00ba893c3331amr1404539yba.5.1685126056971; Fri, 26 May 2023 11:34:16 -0700 (PDT) Date: Fri, 26 May 2023 11:33:48 -0700 In-Reply-To: <20230526183401.2326121-1-irogers@google.com> Message-Id: <20230526183401.2326121-4-irogers@google.com> Mime-Version: 1.0 References: <20230526183401.2326121-1-irogers@google.com> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog Subject: [PATCH v2 03/16] perf test x86: intel-pt-test data is immutable so mark it const From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , "Masami Hiramatsu (Google)" , "Steven Rostedt (Google)" , Ross Zwisler , Leo Yan , Tiezhu Yang , Yang Jihong , Andi Kleen , Kan Liang , Ravi Bangoria , Sean Christopherson , K Prateek Nayak , Paolo Bonzini , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows the movement of 5,808 bytes from .data to .rodata. Signed-off-by: Ian Rogers --- tools/perf/arch/x86/tests/intel-pt-test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/perf/arch/x86/tests/intel-pt-test.c b/tools/perf/arch/x86/tests/intel-pt-test.c index 70b7f79396b1..09d61fa736e3 100644 --- a/tools/perf/arch/x86/tests/intel-pt-test.c +++ b/tools/perf/arch/x86/tests/intel-pt-test.c @@ -22,7 +22,7 @@ * @new_ctx: expected new packet context * @ctx_unchanged: the packet context must not change */ -static struct test_data { +static const struct test_data { int len; u8 bytes[INTEL_PT_PKT_MAX_SZ]; enum intel_pt_pkt_ctx ctx; @@ -186,7 +186,7 @@ static struct test_data { {0, {0}, 0, {0, 0, 0}, 0, 0 }, }; -static int dump_packet(struct intel_pt_pkt *packet, u8 *bytes, int len) +static int dump_packet(const struct intel_pt_pkt *packet, const u8 *bytes, int len) { char desc[INTEL_PT_PKT_DESC_MAX]; int ret, i; @@ -206,14 +206,14 @@ static int dump_packet(struct intel_pt_pkt *packet, u8 *bytes, int len) return TEST_OK; } -static void decoding_failed(struct test_data *d) +static void decoding_failed(const struct test_data *d) { pr_debug("Decoding failed!\n"); pr_debug("Decoding: "); dump_packet(&d->packet, d->bytes, d->len); } -static int fail(struct test_data *d, struct intel_pt_pkt *packet, int len, +static int fail(const struct test_data *d, struct intel_pt_pkt *packet, int len, enum intel_pt_pkt_ctx new_ctx) { decoding_failed(d); @@ -242,7 +242,7 @@ static int fail(struct test_data *d, struct intel_pt_pkt *packet, int len, return TEST_FAIL; } -static int test_ctx_unchanged(struct test_data *d, struct intel_pt_pkt *packet, +static int test_ctx_unchanged(const struct test_data *d, struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx ctx) { enum intel_pt_pkt_ctx old_ctx = ctx; @@ -258,7 +258,7 @@ static int test_ctx_unchanged(struct test_data *d, struct intel_pt_pkt *packet, return TEST_OK; } -static int test_one(struct test_data *d) +static int test_one(const struct test_data *d) { struct intel_pt_pkt packet; enum intel_pt_pkt_ctx ctx = d->ctx; @@ -307,7 +307,7 @@ static int test_one(struct test_data *d) */ int test__intel_pt_pkt_decoder(struct test_suite *test __maybe_unused, int subtest __maybe_unused) { - struct test_data *d = data; + const struct test_data *d = data; int ret; for (d = data; d->len; d++) { -- 2.41.0.rc0.172.g3f132b7071-goog