From patchwork Tue Jun 25 17:25:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13711735 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 5D620C2BBCA for ; Tue, 25 Jun 2024 17:29:03 +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=6A7PaqIwyu4CU4GrB89ckL5QJWFy56tGr5i6+q3YuHU=; b=Tch644uj4f6IyX9Y68GC2XsvHy afZNNBrkPR21o+2HM/k4efNCXroxcPhNNDVJRsWEqGUg2glFgN+TxRBRBTyiQShKcq7Mk9J1wGi7R APKQpa2tJKW20TXjrrHRRaSCH4mlbXJmQ73n7o4eCyPQTu1nPoce9U89kPbPwZxQPRKaA+9plA+oP xcpGGTHM8s/aVxNlE5c2VOH+jphWvoemG7/PFN9CaYR+Hdf8fZnMGHUnecexCIISMwWYmxuMV1NMg sOa6NT11UhL/xI2QlJoG1y7dzKQXw4+ETz4JZ23zt3BKe36stzo6oer9kmaHzWd3QCdNp50KTjAQU 95BdDbIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sM9yP-00000003uCM-0Q69; Tue, 25 Jun 2024 17:28:53 +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 1sM9we-00000003sxK-203X for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 17:27:06 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-643f57e2f0fso72144687b3.0 for ; Tue, 25 Jun 2024 10:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719336420; x=1719941220; 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=6A7PaqIwyu4CU4GrB89ckL5QJWFy56tGr5i6+q3YuHU=; b=DWeae2yPMHo3axEHPN0ol3N3y5koipanIE2Id5cw+eE3plpL1MmbseZ5Z/mFQ0NrUP 2+uZ8PCR1xBa+RdF10Uw2LNG1+jcJxDtrrbpZldCAQyR1bVPRLRAo8+uYctFl8TZyOcE R9BpsSZIYmh8yA/n+KBS5/DoLKQ7l27lGekSeREvTD2gXuhFiDgRVjnbTGJDRn+z01UE 1z06AJdaq/M5vSzAzgSjimNFXdcl7lniRxbiCGDqe1C4FKl+urdhQL6OBB4tHxs8aZuF +USpKWfoUc+0UlN4lqCsTCF7ExFYR/sJr7g/i35IL9GrbXTKIFKoCwmMEkae1HmX0JTE M33Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719336420; x=1719941220; 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=6A7PaqIwyu4CU4GrB89ckL5QJWFy56tGr5i6+q3YuHU=; b=wGDiK8ka4OWEhj3xezHCYabcX+6Ajxl0LLjPZmjz0kTiTG+mypjR8rCfeHAnz7M5I+ LXaJ3VhzxewXZwt02SbefZPOm+0GgWSMTnrPtA53LZxNKyWFuuogbGA9W2Oy9NtbLaa/ hDxZgZ1MfP1ad8+AnXQ4JIKMW+Bc4FWwg9OJhZEzmFsDUiLzYT/3y9dKE5l/8MQmh697 +LzLAYn+nlxS0r6hg/HLIiwmlyBlx0G3IzJvXLeYKAoHn5S0dPNUZiBEgbVeeRD+yby3 7LIdUa1VtkPW7CDxpaKsScrmE18a6+ftAoLTh06x88lVZ83/MrnRAu0KkiG1mEzwlcIq EHMQ== X-Forwarded-Encrypted: i=1; AJvYcCVK+hKixhSAM+LOJifKRsgoOayrU6FPyh1X9N6FdOgxDb/CWjazDkX++ZFcKNp9hFOKwajOUij5GwG8pkyWRM+j5Nw8tUkVNZe7JQogtPGw/UQKk98= X-Gm-Message-State: AOJu0YzboMlw2h3xQ/X7g2m1Y9ivw0+IpPe0oTHTgAWHj+CgtboS6mwy 3UUoXO4HMvWoJEn53KrojK3BpoZ6yai34p+sVPDSjD9UFu777HwpZ1JsTKuX/fnlqiA8PWUsfRT yb8lEww== X-Google-Smtp-Source: AGHT+IGIWKw3wlhnYW+gj5sNzYIaUB7CqGMqyR/kggiKnBfYHZogEyOyafdY5n5VrvSu0dmMoUTAy5u3BnvK X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:b4cb:a52b:f9ea:8678]) (user=irogers job=sendgmr) by 2002:a05:690c:7001:b0:62d:a29:537f with SMTP id 00721157ae682-643ac338f18mr3046937b3.4.1719336420093; Tue, 25 Jun 2024 10:27:00 -0700 (PDT) Date: Tue, 25 Jun 2024 10:25:59 -0700 In-Reply-To: <20240625172603.900667-1-irogers@google.com> Message-Id: <20240625172603.900667-23-irogers@google.com> Mime-Version: 1.0 References: <20240625172603.900667-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Subject: [PATCH v1 22/26] perf auxevent: Add explicit dummy tool initialization 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-20240625_102704_905189_E0DDF650 X-CRM114-Status: GOOD ( 13.87 ) 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 Ensure tool is initialized to avoid lazy initialization pattern so that more uses of struct perf_tool can be made const. Signed-off-by: Ian Rogers --- tools/perf/util/arm-spe.c | 1 + tools/perf/util/cs-etm.c | 1 + tools/perf/util/intel-bts.c | 1 + tools/perf/util/intel-pt.c | 2 +- tools/perf/util/s390-cpumsf.c | 1 - 5 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 70bad18c4a0d..06a198b2f483 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -1097,6 +1097,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; + perf_tool__init(&arm_spe_synth.dummy_tool, /*ordered_events=*/false); 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 231cd833c012..02eb5b3eed14 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -1619,6 +1619,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; + perf_tool__init(&cs_etm_synth.dummy_tool, /*ordered_events=*/false); 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 779982c478e0..ae97109542be 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -761,6 +761,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; + perf_tool__init(&intel_bts_synth.dummy_tool, /*ordered_events=*/false); 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 bed35029e1f6..48ed60e521ed 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -3687,7 +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; - + perf_tool__init(&intel_pt_synth.dummy_tool, /*ordered_events=*/false); err = perf_event__synthesize_attr(&intel_pt_synth.dummy_tool, attr, 1, &id, intel_pt_event_synth); if (err) diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c index 5834bad6ac0f..eb835e531cd6 100644 --- a/tools/perf/util/s390-cpumsf.c +++ b/tools/perf/util/s390-cpumsf.c @@ -953,7 +953,6 @@ s390_cpumsf_process_event(struct perf_session *session, } struct s390_cpumsf_synth { - struct perf_tool cpumsf_tool; struct perf_session *session; };