From nobody Fri Dec 19 07:49:28 2025 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 3C1D513D880 for ; Sat, 29 Jun 2024 04:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719636910; cv=none; b=McSxcAniqWIeEPoeTGUPAcMAQr+lRYHMuvCwbqmbBGKecpqM5lzKGT+jh1l+PpV8IMUjFK5+RvqA+Qw6BKHGPxcOBLr4iXlOKhVfMOiofxMXrjMf/q2BqQqY488zz/mGYIxoB7qTCHNjVPd0UVhmIZYss8PgVfVUCm6lug7p+1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719636910; c=relaxed/simple; bh=mIWU7IzZZQPEq4YeWIDCuW1Y/Tbek1DD/Kq21Hw01w8=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=g3TCadh9Sa0NnqkvFSToD5fbMksDwvOuqQDGsMcpCMH6CXrwvYkQivYMbrECaoYPHWyB7erEhSc3WGdwb8/qKbC5Cn9QgcTMf2/I1AYlwDFXkYBcJlJe82q67TGViCrckPahKHuOr6TLZ5blxfaeuy34/JOIwFFWNWOTwB+wrkc= 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=CvvTKFNF; arc=none smtp.client-ip=209.85.219.202 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="CvvTKFNF" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e03623b24ddso1776546276.1 for ; Fri, 28 Jun 2024 21:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719636908; x=1720241708; 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=CzceA3PnZIITcf46Xf33bNMRePSLAdcPAZsGB0bFPNM=; b=CvvTKFNFRu/9ewCi7WwfRS6M6NNBKv/qVj6G9jgnmFVCUUYIgz2CN+bn1IJo8kFNGm K4AO0bRFPN2jnqlDT+BdsgioxvXnMxCES59jiyf0XpfgT+dENuzvmS3O8s/63mG/EWBd AmkeCg+nInNzrNeZGciQbLNgKsdGSuJ2sqDinXoj1ZvtBIFrrHYfGBxFRzpa6OXxzroc K8pzMExHgshx7BKDmeGCMSVnmcgWO8fa6Ii1i3KDpxRc4StLQoi88CLY2AXA+kb0nGZC T6RxXxDRfE0vac2YbLkk0FGsfbltCvPKk1DU4c9XFEbHGk4jeuzxbNUDuiiKuxKQIFLv 6h7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719636908; x=1720241708; 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=CzceA3PnZIITcf46Xf33bNMRePSLAdcPAZsGB0bFPNM=; b=RbS7H1GXUeDtlvy4ABCqlsnZnU5OEo965GCeJQNHViYg/l+nvtDWA26KzmOMi8jL2z XADBVxyjS8MZsP6YF1p6ALtUHrGL1taw/evsjCG7ht003hoY2in183354SgzFEIuNVUy 7LdVSzhlqukeC4Wf2ds/tzVNhJj0L+hP/GctPLQUIOU4s+kadwz6v5XKYMN76T1fDbTJ T8lI5fx1ZQgo3zf5gnhMn96cnTE/h+JFw34hsAeh3dZ9kygRwNOOLWWPPRarrUHalm0S id3amghGDL/0wCnSPS+T3cy7VW3ZMV6iWDv0oU3F0/vMpYYvbk8rHlrj5+n0GHbWgBeH nS7g== X-Forwarded-Encrypted: i=1; AJvYcCUasKZ/ptUW5O1VEM3vKZLGFPVXAhSArXjDA7uL4k9ymuku2SDSy2ZvFNBvxC9kSb6Uk3WtBJucfM0gIAQtlIGqkYwE4ULikL6mVu/d X-Gm-Message-State: AOJu0YxekNDR0jsDCDNHfj2pjViur8uFkj4j6uKZVa+C7CWqOo/poYNH DSa5u/KTy72UVQSj0vV1nOtYcyhYXhjkCCzeK4Va9h6iH8QvJWGz6qTQvdItgY3mFyNlt6rQ4yQ U8XHRFQ== X-Google-Smtp-Source: AGHT+IGF/SJXJ/sR+JmKyUtE7KPOf5EJWXpjDLqKIoIjmwh6hh573ZiZG4/nnUrG20dJHib8/wRPscsvi5Mh X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:f9fe:7acd:496e:4edb]) (user=irogers job=sendgmr) by 2002:a05:6902:102f:b0:dfa:6ea5:c8d5 with SMTP id 3f1490d57ef6-e036ec36959mr14094276.10.1719636908382; Fri, 28 Jun 2024 21:55:08 -0700 (PDT) Date: Fri, 28 Jun 2024 21:53:49 -0700 In-Reply-To: <20240629045350.285243-1-irogers@google.com> Message-Id: <20240629045350.285243-28-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240629045350.285243-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.803.g4e1b14247a-goog Subject: [PATCH v3 27/28] 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 1490d33eab2b..6f5692902892 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1780,8 +1780,6 @@ static int __perf_session__process_pipe_events(struct= perf_session *session) ssize_t err; void *p; =20 - perf_tool__fill_defaults(tool); - head =3D 0; cur_size =3D sizeof(union perf_event); =20 @@ -2189,8 +2187,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 @@ -2243,8 +2239,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, "Sorting 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 fb7e32d98dda..0874e7924687 100644 --- a/tools/perf/util/tool.h +++ b/tools/perf/util/tool.h @@ -89,7 +89,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.45.2.803.g4e1b14247a-goog