From patchwork Mon Aug 12 20:47:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13761043 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 3CC5BC3DA7F for ; Mon, 12 Aug 2024 21:03:05 +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=0/PW497Hbxz+K6ERVzgwnz8NGkRpB4aRXVX3N8aWF4E=; b=dCM83pKdTjZR9Rt/OpSkx9m0Yh HCiZfEY4m4/tjkKnGzJ47LmMemtHaT188hKcyRnAIaQuIxr9wYQfbmqBPRraQ+nyu+M2H02+pyYPh jcQ3GmMc+XiAlldcWlBjp7srvp00jz2TbfkQwhlCYZWRPjBVV5ASKtZo8V0Aw0xQZStAlh7/ab95k sNX+me3QbqrfoWZ0nfjnp14At+RE5IvE4sesos3SX+bTrpSbCVPJh8bMzn83W73bNBgnG/lCTvtu3 L00EO5DIb5lpPfVPTjt5DCB4CbPW8MPzoPRfFz6IreaQ2j06YoAxnbEFB7/E21+x8m4OAF6gTra9B 9yzhf2MQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdcBs-00000001YvM-2wyh; Mon, 12 Aug 2024 21:02:56 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdbxp-00000001Ur0-1LeO for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 20:48:27 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-e0879957a99so7668041276.1 for ; Mon, 12 Aug 2024 13:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723495704; x=1724100504; 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=0/PW497Hbxz+K6ERVzgwnz8NGkRpB4aRXVX3N8aWF4E=; b=nwMqQmEe0vXRuRDbM5ToqB0Nr5BgofAM15e12I7ZiYMTJ6Gq1xtUhr+59X7/RCETjM sAiyctbu4gNz45u+GkTCjtn0UqVrXhiTkfAfOWi1XBRELE88f/386eZNoQJM5CHfjHg3 UnyQYeiwY3gkUgtQrHkCFIbdw6w8ei8xmafZVPLHI/9xwUh0IEyRoFRNAlAuLNiSFCI7 jWk6nT7CGP7avq5fkUR6dhRPOxESwI+WcYaoiMw9bhNy3M05XUBXhp680FI8VZk5afS3 Ia6SA1F7rYTKQsD13VVFIMu/0J7izX9PVmVAJyQz9Y2Jr6hCkPnSLUtAI16wSgyIGh/v 2WVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723495704; x=1724100504; 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=0/PW497Hbxz+K6ERVzgwnz8NGkRpB4aRXVX3N8aWF4E=; b=D2E/SZJIt1xQZ30c9bjkYIYIOVFvP1FlVBIN1JHZPP3Seg3fZu8KhAxSNRl0tdXfxx TyT0TIxt3IROu+8ooZ2Tc2R/aHSD0ron8WgWKm/CdOTqb/6SNQpXdDzYY2Ny1Yv/0cdG UTeH20ENMCIu8XkZj9+O3YGUPt/XjbgvFrjQ9h6Tmysrefzsf6nbxSw9Hr7mY2ep3oSi H2h8D/muhRiIyFPZTFhUFMsp3MjfOZua3ksvL9x8C1efvzWK02jtWtmqpfphzFNGzToD 1UTZLUKmOtKFwLtsiTM/A6bbt5LvegJwpBvogVslBLsh1g5lCFRACqvjRLE/XXLdyXGn xpzQ== X-Forwarded-Encrypted: i=1; AJvYcCXVu3GeDp9qcQ/gQ1U9wyDEAF+K1yx1vfB0RBqPbAejbsoUCM34rsQd/EaJmXk/R+SeD4bMP9MBIiJPcHwRATo4PgxMxpgAhGdQq0H/ytSzKQXvCwI= X-Gm-Message-State: AOJu0YyW8bwsBkikJE+GbCpGW3BU59wwZbHaSvCITWx2gYkJZQhz9NV+ PPn7Z840em2oY9D8oEf7Z8RCVsvF+6WiW9g8oqNy9ifSlbow6QioD+OftHeKBEYOp84cyD86/Pl h0LOZBA== X-Google-Smtp-Source: AGHT+IHz+OIR3uPEMJrYUYVFCp+CEdR1jvMSTlm/KPD5+ygMtWmiw1Qa9JNuPjCJbkE3PhW6bzE9s9yYXJ4I X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:e7f1:b90:720c:35bf]) (user=irogers job=sendgmr) by 2002:a25:6fc5:0:b0:e0b:ab63:b9c7 with SMTP id 3f1490d57ef6-e113cf5e921mr2109276.7.1723495704095; Mon, 12 Aug 2024 13:48:24 -0700 (PDT) Date: Mon, 12 Aug 2024 13:47:18 -0700 In-Reply-To: <20240812204720.631678-1-irogers@google.com> Message-Id: <20240812204720.631678-27-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 26/27] perf tool: Remove perf_tool__fill_defaults 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_134825_407447_9E7E535A X-CRM114-Status: GOOD ( 14.51 ) 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 Now all tools are fully initialized prior to use it has no use so remove. Signed-off-by: Ian Rogers --- tools/perf/util/session.c | 6 --- tools/perf/util/tool.c | 89 --------------------------------------- tools/perf/util/tool.h | 1 - 3 files changed, 96 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 5c0e0341d39e..a8404cc99cfc 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1781,8 +1781,6 @@ static int __perf_session__process_pipe_events(struct perf_session *session) void *p; bool update_prog = false; - perf_tool__fill_defaults(tool); - /* * If it's from a file saving pipe data (by redirection), it would have * a file name other than "-". Then we can get the total size and show @@ -2206,8 +2204,6 @@ static int __perf_session__process_events(struct perf_session *session) struct ui_progress prog; int err; - perf_tool__fill_defaults(tool); - if (rd.data_size == 0) return -1; @@ -2260,8 +2256,6 @@ static int __perf_session__process_dir_events(struct perf_session *session) u64 total_size = perf_data__size(session->data); struct reader *rd; - perf_tool__fill_defaults(tool); - ui_progress__init_size(&prog, total_size, "Processing events..."); nr_readers = 1; diff --git a/tools/perf/util/tool.c b/tools/perf/util/tool.c index a4ca16e5eefe..3b7f390f26eb 100644 --- a/tools/perf/util/tool.c +++ b/tools/perf/util/tool.c @@ -288,95 +288,6 @@ void perf_tool__init(struct perf_tool *tool, bool ordered_events) tool->finished_init = process_event_op2_stub; } -void perf_tool__fill_defaults(struct perf_tool *tool) -{ - if (tool->sample == NULL) - tool->sample = process_event_sample_stub; - if (tool->mmap == NULL) - tool->mmap = process_event_stub; - if (tool->mmap2 == NULL) - tool->mmap2 = process_event_stub; - if (tool->comm == NULL) - tool->comm = process_event_stub; - if (tool->namespaces == NULL) - tool->namespaces = process_event_stub; - if (tool->cgroup == NULL) - tool->cgroup = process_event_stub; - if (tool->fork == NULL) - tool->fork = process_event_stub; - if (tool->exit == NULL) - tool->exit = process_event_stub; - if (tool->lost == NULL) - tool->lost = perf_event__process_lost; - if (tool->lost_samples == NULL) - tool->lost_samples = perf_event__process_lost_samples; - if (tool->aux == NULL) - tool->aux = perf_event__process_aux; - if (tool->itrace_start == NULL) - tool->itrace_start = perf_event__process_itrace_start; - if (tool->context_switch == NULL) - tool->context_switch = perf_event__process_switch; - if (tool->ksymbol == NULL) - tool->ksymbol = perf_event__process_ksymbol; - if (tool->bpf == NULL) - tool->bpf = perf_event__process_bpf; - if (tool->text_poke == NULL) - tool->text_poke = perf_event__process_text_poke; - if (tool->aux_output_hw_id == NULL) - tool->aux_output_hw_id = perf_event__process_aux_output_hw_id; - if (tool->read == NULL) - tool->read = process_event_sample_stub; - if (tool->throttle == NULL) - tool->throttle = process_event_stub; - if (tool->unthrottle == NULL) - tool->unthrottle = process_event_stub; - if (tool->attr == NULL) - tool->attr = process_event_synth_attr_stub; - if (tool->event_update == NULL) - tool->event_update = process_event_synth_event_update_stub; - if (tool->tracing_data == NULL) - tool->tracing_data = process_event_synth_tracing_data_stub; - if (tool->build_id == NULL) - tool->build_id = process_event_op2_stub; - if (tool->finished_round == NULL) { - if (tool->ordered_events) - tool->finished_round = perf_event__process_finished_round; - else - tool->finished_round = process_finished_round_stub; - } - if (tool->id_index == NULL) - tool->id_index = process_event_op2_stub; - if (tool->auxtrace_info == NULL) - tool->auxtrace_info = process_event_op2_stub; - if (tool->auxtrace == NULL) - tool->auxtrace = process_event_auxtrace_stub; - if (tool->auxtrace_error == NULL) - tool->auxtrace_error = process_event_op2_stub; - if (tool->thread_map == NULL) - tool->thread_map = process_event_thread_map_stub; - if (tool->cpu_map == NULL) - tool->cpu_map = process_event_cpu_map_stub; - if (tool->stat_config == NULL) - tool->stat_config = process_event_stat_config_stub; - if (tool->stat == NULL) - tool->stat = process_stat_stub; - if (tool->stat_round == NULL) - tool->stat_round = process_stat_round_stub; - if (tool->time_conv == NULL) - tool->time_conv = process_event_time_conv_stub; - if (tool->feature == NULL) - tool->feature = process_event_op2_stub; - if (tool->compressed == NULL) { -#ifdef HAVE_ZSTD_SUPPORT - tool->compressed = perf_session__process_compressed_event; -#else - tool->compressed = perf_session__process_compressed_event_stub; -#endif - } - if (tool->finished_init == NULL) - tool->finished_init = process_event_op2_stub; -} - bool perf_tool__compressed_is_stub(const struct perf_tool *tool) { return tool->compressed == perf_session__process_compressed_event_stub; diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h index c7fea58729a5..db1c7642b0d1 100644 --- a/tools/perf/util/tool.h +++ b/tools/perf/util/tool.h @@ -90,7 +90,6 @@ struct perf_tool { }; void perf_tool__init(struct perf_tool *tool, bool ordered_events); -void perf_tool__fill_defaults(struct perf_tool *tool); bool perf_tool__compressed_is_stub(const struct perf_tool *tool);