From patchwork Wed Jun 26 20:36:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13713394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94A34C27C4F for ; Wed, 26 Jun 2024 20:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:From:Subject :References:Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bnGIHHkhF2Y479Oo/otGWrEFafXUa7WO1wDvauktO0o=; b=hTdazJNtswb7ZcwGgHv32Xoats 63Ow5zHZ5pZG6+M/Lkfati5ZsIRBEFo/rewdYXRuddeZJI2Nm4qQcplJb2w2zU11pXabI400pzQr7 N3C8DA9mWAHPexPBSBsv5GXx+fMkiBNkAR18ebkMos1gWPjnVm9iL+JBZ1cMpJbjoqdetwTGREk8U LkqMaFl5lJ9pPkW6X2zqNuKBrx5y3Z35MM+8er6j+c6fdtRhRPeuFng+2dDyFD0tGb0QjPkUVeoNe e6PqUpdm0dcWzgENH+bNV4CATScKZBzHNHI5Lxk/CsleVhL0IEOr6EnpqNbu3tx7r/Mk2yIQV9Q9G 6f1BX0sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMZNv-00000008FAV-0fmd; Wed, 26 Jun 2024 20:36:55 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMZNi-00000008F5f-3XwN for linux-arm-kernel@lists.infradead.org; Wed, 26 Jun 2024 20:36:44 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-63bab20bf5fso164068667b3.0 for ; Wed, 26 Jun 2024 13:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719434201; x=1720039001; darn=lists.infradead.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=bnGIHHkhF2Y479Oo/otGWrEFafXUa7WO1wDvauktO0o=; b=Gb1Y912XCD6FmSjVREyfsUILTfnjHsb0YS2afVIchag5GF2bncmI363bmO0qkQGtjh nvVCq2LZ+8WZY5wZPKRO/ie1GvDs4f3eJCoOPz2jaykl/kQX6ZrHonTU/7X73bxlwdhM nW2msVoNW88lwrOdnQz7tTlLVP8San4crRduldNaO7F8HTnQ/5RI9uENPc71uB/GGN0a MiHKENQWt+k+AQnYklZVhaIRdVBxj8xMfwsBXeFiwPokToBcJq7WXVH/gCrvrw3k7+CS 03kdvQRaNmkAomIxkMlDkhq+NRFWRGzkvgff3fu2ZNrobIbBJJ9eEeYVTbVnTHgj3X5b XNYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719434201; x=1720039001; 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=bnGIHHkhF2Y479Oo/otGWrEFafXUa7WO1wDvauktO0o=; b=A7ORSNlr64NAOwYeC43f2cg0A4agreLwRLhCjPQjzz6hQdldEpsGeRg1BPZNZ5KCa6 T3AHGcpXVbEo7QmIr26w5bAUHlT7bKo/CpPGViDJY9EnT4MAJn/dM42jrcKRwcswxHwH /2Wnm7pFg+kRYqPKCqEcXaUO0KV4yvEjNpgJCekFNddNl5V/YXUk8TQBU+46cIGIrU7D CXpcJ5wNCCVzPkS6Z7tMAAbxIrUAplU4mYAX5OpzlTJ6UOxtiXSXdIwdyS2+BOcic3ED pFYUViBL1rZaiPdGMPeSf36dmd+5PTjBO4gQi9OzuZ+w/uAxXT4Niyt3KI0bJpFj5rW1 1SxA== X-Forwarded-Encrypted: i=1; AJvYcCUCntITkTSfGX1ep1GNPib3hFOwlLxjeSJTBpK2aolJswSV1X/CGiDUZwJter+aB/vyYS6utZF8fIKrN21g7lRfSnZd2GxykB3muOz3LZAiSfRarOo= X-Gm-Message-State: AOJu0YyTLbBiCtLWzUQ3wTM9XzHXe/2nRK2mE9ehr47Be0wlF2bUZX9j hiB6VAZdQgRjex2lRTEA6Blp+NNR0fBJQOEMpyi114Wvb8SyvliCHlXm262zMZlUE25jjAjmtd2 PEnoK4A== X-Google-Smtp-Source: AGHT+IGj/mCO4jEzm9rd9xMT3ci6YrkO+sYryFdaNeAGcFh7StHBleb0kVfx0rV3JI7j9YEgpazJzR0VNbWs X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:23a1:25b9:2412:56de]) (user=irogers job=sendgmr) by 2002:a05:690c:f0b:b0:61b:e524:f91a with SMTP id 00721157ae682-64341c235b3mr1708607b3.10.1719434201082; Wed, 26 Jun 2024 13:36:41 -0700 (PDT) Date: Wed, 26 Jun 2024 13:36:03 -0700 In-Reply-To: <20240626203630.1194748-1-irogers@google.com> Message-Id: <20240626203630.1194748-2-irogers@google.com> Mime-Version: 1.0 References: <20240626203630.1194748-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Subject: [PATCH v2 01/27] perf auxevent: Zero size dummy tool 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 , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Nick Terrell , Nick Desaulniers , Oliver Upton , Anshuman Khandual , Song Liu , Ilkka Koskinen , Huacai Chen , Yanteng Si , Sun Haiyong , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_133642_922952_9394D666 X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The dummy tool is passed as a placeholder to allow a container_of to get additional parameters. As the tool isn't used, make it a zero sized array saving 320 bytes on an x86_64 build. s390-cpumsf's dummy tool struct was unused, so remove. Signed-off-by: Ian Rogers --- tools/perf/util/arm-spe.c | 6 +++--- tools/perf/util/cs-etm.c | 6 +++--- tools/perf/util/intel-bts.c | 6 +++--- tools/perf/util/intel-pt.c | 7 +++---- tools/perf/util/s390-cpumsf.c | 5 ----- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index afbd5869f6bf..ee0d5064ddd4 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -1074,8 +1074,8 @@ static void arm_spe_print_info(__u64 *arr) } struct arm_spe_synth { - struct perf_tool dummy_tool; struct perf_session *session; + struct perf_tool dummy_tool[0]; }; static int arm_spe_event_synth(struct perf_tool *tool, @@ -1084,7 +1084,7 @@ static int arm_spe_event_synth(struct perf_tool *tool, struct machine *machine __maybe_unused) { struct arm_spe_synth *arm_spe_synth = - container_of(tool, struct arm_spe_synth, dummy_tool); + container_of(tool, struct arm_spe_synth, dummy_tool[0]); return perf_session__deliver_synth_event(arm_spe_synth->session, event, NULL); @@ -1098,7 +1098,7 @@ static int arm_spe_synth_event(struct perf_session *session, memset(&arm_spe_synth, 0, sizeof(struct arm_spe_synth)); arm_spe_synth.session = session; - return perf_event__synthesize_attr(&arm_spe_synth.dummy_tool, attr, 1, + return perf_event__synthesize_attr(arm_spe_synth.dummy_tool, attr, 1, &id, arm_spe_event_synth); } diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 32818bd7cd17..9fd2967d4e3f 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -1596,8 +1596,8 @@ static int cs_etm__synth_branch_sample(struct cs_etm_queue *etmq, } struct cs_etm_synth { - struct perf_tool dummy_tool; struct perf_session *session; + struct perf_tool dummy_tool[0]; }; static int cs_etm__event_synth(struct perf_tool *tool, @@ -1606,7 +1606,7 @@ static int cs_etm__event_synth(struct perf_tool *tool, struct machine *machine __maybe_unused) { struct cs_etm_synth *cs_etm_synth = - container_of(tool, struct cs_etm_synth, dummy_tool); + container_of(tool, struct cs_etm_synth, dummy_tool[0]); return perf_session__deliver_synth_event(cs_etm_synth->session, event, NULL); @@ -1620,7 +1620,7 @@ static int cs_etm__synth_event(struct perf_session *session, memset(&cs_etm_synth, 0, sizeof(struct cs_etm_synth)); cs_etm_synth.session = session; - return perf_event__synthesize_attr(&cs_etm_synth.dummy_tool, attr, 1, + return perf_event__synthesize_attr(cs_etm_synth.dummy_tool, attr, 1, &id, cs_etm__event_synth); } diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index ec1b3bd9f530..fb8fec3a3c36 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -738,8 +738,8 @@ static bool intel_bts_evsel_is_auxtrace(struct perf_session *session, } struct intel_bts_synth { - struct perf_tool dummy_tool; struct perf_session *session; + struct perf_tool dummy_tool[0]; }; static int intel_bts_event_synth(struct perf_tool *tool, @@ -748,7 +748,7 @@ static int intel_bts_event_synth(struct perf_tool *tool, struct machine *machine __maybe_unused) { struct intel_bts_synth *intel_bts_synth = - container_of(tool, struct intel_bts_synth, dummy_tool); + container_of(tool, struct intel_bts_synth, dummy_tool[0]); return perf_session__deliver_synth_event(intel_bts_synth->session, event, NULL); @@ -762,7 +762,7 @@ static int intel_bts_synth_event(struct perf_session *session, memset(&intel_bts_synth, 0, sizeof(struct intel_bts_synth)); intel_bts_synth.session = session; - return perf_event__synthesize_attr(&intel_bts_synth.dummy_tool, attr, 1, + return perf_event__synthesize_attr(intel_bts_synth.dummy_tool, attr, 1, &id, intel_bts_event_synth); } diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index d6d7b7512505..b8b90773baa2 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -3660,8 +3660,8 @@ static int intel_pt_queue_data(struct perf_session *session, } struct intel_pt_synth { - struct perf_tool dummy_tool; struct perf_session *session; + struct perf_tool dummy_tool[0]; }; static int intel_pt_event_synth(struct perf_tool *tool, @@ -3670,7 +3670,7 @@ static int intel_pt_event_synth(struct perf_tool *tool, struct machine *machine __maybe_unused) { struct intel_pt_synth *intel_pt_synth = - container_of(tool, struct intel_pt_synth, dummy_tool); + container_of(tool, struct intel_pt_synth, dummy_tool[0]); return perf_session__deliver_synth_event(intel_pt_synth->session, event, NULL); @@ -3687,8 +3687,7 @@ static int intel_pt_synth_event(struct perf_session *session, const char *name, memset(&intel_pt_synth, 0, sizeof(struct intel_pt_synth)); intel_pt_synth.session = session; - - err = perf_event__synthesize_attr(&intel_pt_synth.dummy_tool, attr, 1, + err = perf_event__synthesize_attr(intel_pt_synth.dummy_tool, attr, 1, &id, intel_pt_event_synth); if (err) pr_err("%s: failed to synthesize '%s' event type\n", diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c index 6fe478b0b61b..4ec583e511af 100644 --- a/tools/perf/util/s390-cpumsf.c +++ b/tools/perf/util/s390-cpumsf.c @@ -952,11 +952,6 @@ s390_cpumsf_process_event(struct perf_session *session, return err; } -struct s390_cpumsf_synth { - struct perf_tool cpumsf_tool; - struct perf_session *session; -}; - static int s390_cpumsf_process_auxtrace_event(struct perf_session *session, union perf_event *event __maybe_unused,