From patchwork Mon Aug 12 20:47:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13761041 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 56FBFC52D7C for ; Mon, 12 Aug 2024 21:01:56 +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=kiqQs713NS2cwu9IGmflyeUpCc5+2eIUysSxdZONVB4=; b=rrF6t9MCwMovcW9YRKNTQqX5km NNhRNyOye9XoxDy7EBrc41+AAN5WCjaZtj13FWOrL29iaEU8gXeqnn+pYOWuINtgyidLlmU92v6Si o2EgnymcvhHJqMUScAGFJKGNgtM3BdEefQejvnrYkYss+3Kj4CHmLlVqnkShVy/vAkdBYTPW6zJiu 3FZHsx//22+ky0R2IaF6pzcd0CVcXEmNmt7HVbpo4H0xZXX3KhUydtl20KfApDdbVJm9AOreD2iNi z2CCQ0F3Wnn/YpFmnCmg1CYS6HQBqAt/ppkQrXvdDipjtggB8Jc/FCLov5JB7DytQBh1PM5bnqRJ4 UAOGzkgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdcAm-00000001Yl7-0x72; Mon, 12 Aug 2024 21:01:48 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdbxl-00000001Uok-0jaD for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 20:48:22 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e08bc29c584so7664508276.0 for ; Mon, 12 Aug 2024 13:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723495700; x=1724100500; 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=kiqQs713NS2cwu9IGmflyeUpCc5+2eIUysSxdZONVB4=; b=UY1RMZgpPQBNzdqCS271OlqXbvTraV/YwzYPRgtCxjmnSeYNnlqCLZIKlfbpDfqZjR mDDly91HtwvyJ14NISBugfO1lo26oDTXwdbOM31fGiHb5JCe7vevjVLkyAZw1hG/CDdC gTVgPtsykR8KsnipJSX3wkDE33YVI+F11DWmm69ODHakAck+BU/V0ZsTuMaAP8o1bDdG Tnp7UL0oZVA/Dgyez8awJIMLQwKTWX5YbRYLHCIGsik5+q7hrYEK1UWMMssKN+ACve39 oWwL+30g7PhA5wnqH6j95/I5PugEmOwVepq5o579N0qo//5Af9B5lHAdYCXqlz1wIrO1 Ew/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723495700; x=1724100500; 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=kiqQs713NS2cwu9IGmflyeUpCc5+2eIUysSxdZONVB4=; b=XZvwmabyOvyNeEgHBrNHXEpwUzlgkT/tlSNr3JSnM6VGKiuvvT/EbWY1kADOC+lzmO AaS0K+kPVCpf3VIQfi5VWjt8uMPWSyyjmT9rgy8Yp1T4t4/As2BwRC2diEnGT4noAbis dBz2kI2nv9WVI4QBZOtOjswXGdA8w4gKcx/oJWAsqFd2/dzZRVoNrOr1Nqh+i5g9S5B4 GrqcDMb/1Mxwmabk0d9rZA1CA0HtO/SlYht/JMCUVbGFi7bEVZ2aYkZkYJrZmQOJseC/ Gkb6A3+Qe9fVLyKtrUqBgs8WaSQqjZ0lIXb1nxkCQUm3Nz54QZWAy7dcxOteZX8mS+GR mLQg== X-Forwarded-Encrypted: i=1; AJvYcCXbcj06No0Jqjdz9xr1u0SxGHpfCxvYBsJF9iwY9A2G44uQXdZ/2LbFvhSPvi8bBqAxuuHto1QV2w8VK678Te8N4Co3teLeVbQZT1B4C0w1mivqJSo= X-Gm-Message-State: AOJu0YxecF8rqk5vvB4LZmE3fX7TqOBlyhWBZE43GUwhdhwnGOKvbA0h cGDZ561TzYTFXBl9SG2EWgFK7SITRQ9JMl04cB/qz3rrXZpnrZ77tGSr358EyMt6DQJIKewgjHv QRbcVQg== X-Google-Smtp-Source: AGHT+IH3KiTk750Irbjnomg6Lm7uXV9YcitFsOtYH/VB3qZCzlTL/MIwOsfRWnRrXOwHrMNRY7pbWgYokw0z X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:e7f1:b90:720c:35bf]) (user=irogers job=sendgmr) by 2002:a25:3002:0:b0:e05:6e45:84b6 with SMTP id 3f1490d57ef6-e113d176384mr2040276.8.1723495699659; Mon, 12 Aug 2024 13:48:19 -0700 (PDT) Date: Mon, 12 Aug 2024 13:47:16 -0700 In-Reply-To: <20240812204720.631678-1-irogers@google.com> Message-Id: <20240812204720.631678-25-irogers@google.com> Mime-Version: 1.0 References: <20240812204720.631678-1-irogers@google.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Subject: [PATCH v7 24/27] perf test event_update: Ensure tools is initialized 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 , Athira Rajeev , 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-20240812_134821_243839_182034E3 X-CRM114-Status: GOOD ( 11.48 ) 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/tests/event_update.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index fdecad920f59..d6b4ce3ef4ee 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c @@ -103,6 +103,7 @@ static int test__event_update(struct test_suite *test __maybe_unused, int subtes TEST_ASSERT_VAL("failed to synthesize attr update scale", !perf_event__synthesize_event_update_scale(NULL, evsel, process_event_scale)); + perf_tool__init(&tmp.tool, /*ordered_events=*/false); tmp.name = evsel__name(evsel); TEST_ASSERT_VAL("failed to synthesize attr update name",