From patchwork Fri Jul 12 18:11:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13732159 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 BE8E5C2BD09 for ; Fri, 12 Jul 2024 18:19:26 +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=phxqvYyYZFcsS+fO7HmN6BaHRpzOxQeFfvDLLgr+3hE=; b=kTgdILtz6QWcodrISMZybSnQL3 BTKP+0ZFzHTo6IcvgrgQFKKuL/xAka0dUSXv7u4s6/3w/JfkyMFl0AeUEbJOHAdRe0nMne6RZPLPX jzk4ZjVvboPpvCW9k9tUitqpx+dnerk+Jvw6ZI/EHIwejFbzDYHlhBTMBZrjTQK34JRz3UUEuGb8y vFQETYSdl4P9g77gDMsRNgf4ZleuOOP3Rg3rFbhsw6nlWwsmds2szl9S/cjGChpbiILoF+g+iWnen 2QmOZnYUigHHw1UPb9mnvaWf7xK2LOqbwNN4mk0lX86HlHa+i0AhyGqx3yyRJNfJilk1lmbSqUEaK zH29mLiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSKrV-00000000yHs-0zId; Fri, 12 Jul 2024 18:19:17 +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 1sSKlX-00000000ve8-0w98 for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 18:13:08 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-653306993a8so37568287b3.1 for ; Fri, 12 Jul 2024 11:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720807986; x=1721412786; 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=phxqvYyYZFcsS+fO7HmN6BaHRpzOxQeFfvDLLgr+3hE=; b=y/mSPUF2PJBZ/HqwuD21Pdz494wpDfm5/5aZ9KgOlnIpldGzrFBV0kwNCUI6h+rSNQ jM8LdDX+12P1eLp+zl3YTg0OrJr5xIGslLCjfiniv4eFQ9Pr0r0UVchgdbzddgZ5wsk5 9Zt9kwzZ+O33cs+Eq4FBUGzicP69smU9mxOrvLG2zU52dtSLZyWwPipd7Il+36x3tnC0 SFbnCh+xZxIqzGwvOO4l9GgEdllu6zcF/pjq2JDdkG11xdYmPDUoAMNE9loyyiVP93DC 5zRwA1pv6unjchlc7y6kROmLYrTzMlGyhtGvj0LLhAjW8w+9V/EnRTofVwKOwRqY/mIm mM1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720807986; x=1721412786; 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=phxqvYyYZFcsS+fO7HmN6BaHRpzOxQeFfvDLLgr+3hE=; b=brwDElvr1vZjc0LAb+RcJHyEBg1ecTEKuPraPLyd55g+DCRbq+ViiFZtYeIpZU3B2W 7F/3i8LqgEU+oQLdvHY+ADFzo//Jd3oQG2ciF70Mk13+6tBRZSKo/fKtCZzjkoc4rlOH 8VE5UJPX6KnlpRJb1HdPLDwpw3xlKt2l31aV9VDZdKsEozt14NS1Q+WBXH2pTe7bpVGA atO4AsnUpN38ERzSe01gtB+/mVuMALsVPeVivfCIm40pFtZDg+2CU4HQhga8njoLv+uj Re1vzTWFZk/52VCSIMhdRJNBG3b9DL4Ld8esK+YymWs/xBB3/Hlj8Kp2ZNhJraEnIAu4 DkXA== X-Forwarded-Encrypted: i=1; AJvYcCWqI+cub10xnhMDKWAhyAFRnyZ8mb7LWvkDs3CiNVhJmr2gnBBF4OWXSevrRjaIPHHeat09o/NxBVBdWujcuTlCUqUvrBNrpTGJESdgL10R0zxtMZU= X-Gm-Message-State: AOJu0Yz95PQiY4r4HKBCQfjvo+ozSFS9sVARrUdLBF4YRaL9ZkEScSJa i3Gw0H5A0FDr8BAN6a8Zfk7AWXQF37kpG6C8RQ8i0B8yGv6bdH1xbURb2Q4TRFg0psr822hwnbp 6MWpfWA== X-Google-Smtp-Source: AGHT+IH55ouNUARRkV/7vwiojtMsBJqnZMjnyHFWfmbeG3E2oRRjNgYMj3GXuyIvTVcz6xeK7mzL5W5Xp8yA X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:2e7d:d47a:a0c6:e3b1]) (user=irogers job=sendgmr) by 2002:a05:6902:1b0c:b0:dff:396c:c457 with SMTP id 3f1490d57ef6-e041b0364b6mr21640276.3.1720807985767; Fri, 12 Jul 2024 11:13:05 -0700 (PDT) Date: Fri, 12 Jul 2024 11:11:06 -0700 In-Reply-To: <20240712181108.475336-1-irogers@google.com> Message-Id: <20240712181108.475336-26-irogers@google.com> Mime-Version: 1.0 References: <20240712181108.475336-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog Subject: [PATCH v5 25/27] perf kwork: Use perf_tool__init 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-20240712_111307_284401_C9D68452 X-CRM114-Status: GOOD ( 12.58 ) 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 Use perf_tool__init so that more uses of struct perf_tool can be const and not relying on perf_tool__fill_defaults. Signed-off-by: Ian Rogers --- tools/perf/builtin-kwork.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c index 8ffaa80a2d1d..6a4281b8fd10 100644 --- a/tools/perf/builtin-kwork.c +++ b/tools/perf/builtin-kwork.c @@ -2322,12 +2322,6 @@ int cmd_kwork(int argc, const char **argv) { static struct perf_kwork kwork = { .class_list = LIST_HEAD_INIT(kwork.class_list), - .tool = { - .mmap = perf_event__process_mmap, - .mmap2 = perf_event__process_mmap2, - .sample = perf_kwork__process_tracepoint_sample, - .ordered_events = true, - }, .atom_page_list = LIST_HEAD_INIT(kwork.atom_page_list), .sort_list = LIST_HEAD_INIT(kwork.sort_list), .cmp_id = LIST_HEAD_INIT(kwork.cmp_id), @@ -2462,6 +2456,11 @@ int cmd_kwork(int argc, const char **argv) "record", "report", "latency", "timehist", "top", NULL }; + perf_tool__init(&kwork.tool, /*ordered_events=*/true); + kwork.tool.mmap = perf_event__process_mmap; + kwork.tool.mmap2 = perf_event__process_mmap2; + kwork.tool.sample = perf_kwork__process_tracepoint_sample; + argc = parse_options_subcommand(argc, argv, kwork_options, kwork_subcommands, kwork_usage, PARSE_OPT_STOP_AT_NON_OPTION);