From nobody Thu Dec 18 05:34:37 2025 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2A6019E7E8 for ; Mon, 12 Aug 2024 20:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723495706; cv=none; b=AoJErTmuCyo3NdklJXxAYZrb2J/uUfGiPSQA01eZsquQ96LoY2H1joZZWv28NC1xO0O40oYOQH7M1b2xURI9rYHxTsFXK9/uKguyIrCaCIcSTY+0fCqie00k0MFQt3P2aHShz6LfVBTUQgwgl42d6Qweh9PZEMVojfJ3/Sa8uxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723495706; c=relaxed/simple; bh=rK6gkGo9GgTELivuAc4AXwSkX1abYEDMRCaMnWGvK1Q=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=nvVGIB2UNe3uzFViSk/10XqoGuu+gxLOjVLF6OvuSkqgbSmGAcTDHiqwGaP0hjUwtxJWLBWYyBDqXZ7fGpJjbPw48mPc+jomh4qenq/gLDzxfjTvXi22pXhEZUeXSPog8vSJ8OygQW8IPmzDe+Wd/IjFVfapalMJmvkIOVJ2IGY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uQ8vjPi6; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uQ8vjPi6" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e0ba4d19585so8084337276.0 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=vger.kernel.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=uQ8vjPi6X+LQ2okOXeRS1e+PcGxh9QSeVjVR591cepUx+EI2uOZdMbs/+74cPUUVgK 96g+bn7soS7ushG9NcT4tdr3N8O8iKvhAphKTPJGUqNJRJhdQ6ts1Iv//6cU3hRS3QNT uTK21yBNhj8VWkPZLaNDH1gGPhpxes7I6g6TkAcEBuRSdBGPqUDezR7aMiHh3eQ4L1eL 6yS+0xXnG43sS+DGXtRt8Y0hRoDtrnHxZlxHx+gcoqleBwRvlwOpEQg52o1+TXQQoKle dv99ox8w3JCgX5Lj6zG1jcXvyWrQD3uEz7h5NuHHg90OCHQ5Cnx78QHHHCrXkY6f2wHp i3ng== 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=FvDzmZDV/DYxtSNPFrwq2kFrkOP5y+diRZE42WgKyHHl1PTGz5vGn6QiynFXzlFwAV HZaaYio0zjZfUG/ZRXNgipvL6I6/iPe6ulaceotdwEKEwoCB7h88Ns3QK6UvNiQrTurT H7I7wBADiGlzH4EY9mgMKDhfyTpRvrtFbEuaio9o8um8tf8Ho7YF0rHugV6tHwq4Jgup Lu9I/z0Z07WNGbQ9QLyK9awFJo27dHc1DcrtsM2Q3TpUxjCVYWcVkpTisxe8nYyTTBQe P/dM9kiYailcAly3hlZ7cPPCPsx6VakN2WZ0ot0NBAVbLEFaLjUkSBHIT+eR/Pe3LI17 r4lw== X-Forwarded-Encrypted: i=1; AJvYcCXqGso5qy7qiJX3a6MRQafWfetDwVQFTrijXM3eTWdUOfic1NHJJkJq+4U1oM6lskG9pamoDWL2wJhv+SAOo3yMlRen+FRtLZ5DHSAh X-Gm-Message-State: AOJu0YzKQ3Z7B19TNzy7UUoBvm6oSHVCTjTMpp9CODQ8k8sa/UXo+Hf6 lSz/ZHUDXsoJ4xrG1Ljl+ekfU+lI0MmreVmhpwv/+ZVsqhIcTvweEMg9BOenwjmeKZ/2zJJdpQW Cve4VMg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D false; =20 - 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; =20 - perf_tool__fill_defaults(tool); - if (rd.data_size =3D=3D 0) return -1; =20 @@ -2260,8 +2256,6 @@ static int __perf_session__process_dir_events(struct = perf_session *session) u64 total_size =3D perf_data__size(session->data); struct reader *rd; =20 - perf_tool__fill_defaults(tool); - ui_progress__init_size(&prog, total_size, "Processing events..."); =20 nr_readers =3D 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 orde= red_events) tool->finished_init =3D process_event_op2_stub; } =20 -void perf_tool__fill_defaults(struct perf_tool *tool) -{ - if (tool->sample =3D=3D NULL) - tool->sample =3D process_event_sample_stub; - if (tool->mmap =3D=3D NULL) - tool->mmap =3D process_event_stub; - if (tool->mmap2 =3D=3D NULL) - tool->mmap2 =3D process_event_stub; - if (tool->comm =3D=3D NULL) - tool->comm =3D process_event_stub; - if (tool->namespaces =3D=3D NULL) - tool->namespaces =3D process_event_stub; - if (tool->cgroup =3D=3D NULL) - tool->cgroup =3D process_event_stub; - if (tool->fork =3D=3D NULL) - tool->fork =3D process_event_stub; - if (tool->exit =3D=3D NULL) - tool->exit =3D process_event_stub; - if (tool->lost =3D=3D NULL) - tool->lost =3D perf_event__process_lost; - if (tool->lost_samples =3D=3D NULL) - tool->lost_samples =3D perf_event__process_lost_samples; - if (tool->aux =3D=3D NULL) - tool->aux =3D perf_event__process_aux; - if (tool->itrace_start =3D=3D NULL) - tool->itrace_start =3D perf_event__process_itrace_start; - if (tool->context_switch =3D=3D NULL) - tool->context_switch =3D perf_event__process_switch; - if (tool->ksymbol =3D=3D NULL) - tool->ksymbol =3D perf_event__process_ksymbol; - if (tool->bpf =3D=3D NULL) - tool->bpf =3D perf_event__process_bpf; - if (tool->text_poke =3D=3D NULL) - tool->text_poke =3D perf_event__process_text_poke; - if (tool->aux_output_hw_id =3D=3D NULL) - tool->aux_output_hw_id =3D perf_event__process_aux_output_hw_id; - if (tool->read =3D=3D NULL) - tool->read =3D process_event_sample_stub; - if (tool->throttle =3D=3D NULL) - tool->throttle =3D process_event_stub; - if (tool->unthrottle =3D=3D NULL) - tool->unthrottle =3D process_event_stub; - if (tool->attr =3D=3D NULL) - tool->attr =3D process_event_synth_attr_stub; - if (tool->event_update =3D=3D NULL) - tool->event_update =3D process_event_synth_event_update_stub; - if (tool->tracing_data =3D=3D NULL) - tool->tracing_data =3D process_event_synth_tracing_data_stub; - if (tool->build_id =3D=3D NULL) - tool->build_id =3D process_event_op2_stub; - if (tool->finished_round =3D=3D NULL) { - if (tool->ordered_events) - tool->finished_round =3D perf_event__process_finished_round; - else - tool->finished_round =3D process_finished_round_stub; - } - if (tool->id_index =3D=3D NULL) - tool->id_index =3D process_event_op2_stub; - if (tool->auxtrace_info =3D=3D NULL) - tool->auxtrace_info =3D process_event_op2_stub; - if (tool->auxtrace =3D=3D NULL) - tool->auxtrace =3D process_event_auxtrace_stub; - if (tool->auxtrace_error =3D=3D NULL) - tool->auxtrace_error =3D process_event_op2_stub; - if (tool->thread_map =3D=3D NULL) - tool->thread_map =3D process_event_thread_map_stub; - if (tool->cpu_map =3D=3D NULL) - tool->cpu_map =3D process_event_cpu_map_stub; - if (tool->stat_config =3D=3D NULL) - tool->stat_config =3D process_event_stat_config_stub; - if (tool->stat =3D=3D NULL) - tool->stat =3D process_stat_stub; - if (tool->stat_round =3D=3D NULL) - tool->stat_round =3D process_stat_round_stub; - if (tool->time_conv =3D=3D NULL) - tool->time_conv =3D process_event_time_conv_stub; - if (tool->feature =3D=3D NULL) - tool->feature =3D process_event_op2_stub; - if (tool->compressed =3D=3D NULL) { -#ifdef HAVE_ZSTD_SUPPORT - tool->compressed =3D perf_session__process_compressed_event; -#else - tool->compressed =3D perf_session__process_compressed_event_stub; -#endif - } - if (tool->finished_init =3D=3D NULL) - tool->finished_init =3D process_event_op2_stub; -} - bool perf_tool__compressed_is_stub(const struct perf_tool *tool) { return tool->compressed =3D=3D perf_session__process_compressed_event_stu= b; 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 { }; =20 void perf_tool__init(struct perf_tool *tool, bool ordered_events); -void perf_tool__fill_defaults(struct perf_tool *tool); =20 bool perf_tool__compressed_is_stub(const struct perf_tool *tool); =20 --=20 2.46.0.76.ge559c4bf1a-goog