From nobody Thu Dec 18 05:30:59 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 94FF880C13 for ; Thu, 18 Jul 2024 01:01:37 +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=1721264502; cv=none; b=CRS59/f/rlqAamJItDuC+vIvZvZM/TSvzwIPK/i8O57D/znlfkGWV1G3eXrtfe5ztE+MpXiHMMO4gQyRCstzbuvIMQZ7Uc/eUxkqz5uGR4EXRceRr5AzMIRii/7xv/WCuRYf5jHSvMTyBlaUiHlPwAy2Maqq2GuH/hEYSxzo7HA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721264502; c=relaxed/simple; bh=Bx08tB6feHERnMdXGNueKGNYplrQpkF4l9BhuiL3bjY=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=SDjNSIk6T9cdvAOz+eW5ufmMG6Y/TZOMfcEtkMZfju8vAmmO2vQ/dmIBsGG7FlqOYr/atz7gegLQr2q5aeup5AOyYMk1eRYliCaCbi30J3zY6eBYv1Z+WFv8FAhb2TPAIIhrscMH/1TbMBGYoIYJHKnQXUxoZ2yOabke5jXtCrU= 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=xDbHt2VD; 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="xDbHt2VD" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e0335450936so714218276.1 for ; Wed, 17 Jul 2024 18:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721264496; x=1721869296; 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=dsqa4ji/Kru2TpTCpzQSXPab7IPwWK5YnC4MrN+9OsY=; b=xDbHt2VDZvuYdJrQVNz/b7VwTcLVlCp9pm3X0zLdxRLSbVmCG74XjJDTZG3902+7x1 3YKGDADQSMHSB6Td3chwiYK6n3Wv+UBq17yTKGkNgTsvsk/KVJEVG6ndideXqvf6oTv4 90XRxCRVhW5w+oBwq93QWiQ8lEBWCaDFoCODnqdL6cwDWgl01dOq0UEShHFP+/yMkcNQ nWqxJYsQssWVZEQFRkOPf1x6KEd66C+Dr6EpsqOSO29jL0YlAaDhxcDZMV99czkZE1Xt 6X7BEUwQZw+Z+p0JnhpnMFSiIxVi8KTn/vhQzXJwy4S+deLdjQ061yS2sv+8VQNYd2+K efMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721264496; x=1721869296; 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=dsqa4ji/Kru2TpTCpzQSXPab7IPwWK5YnC4MrN+9OsY=; b=UVY1j+a6/fCmnNwEsSdGX26fr/wTkTDXJdM0VgrwK4cXDL0KLr4PmT+RgybaLmfAN8 0qWSD97kkO7eIJL8uvzOw/aNokdqYN+HWwqK9y9kaWdHX4SPVw42WJYAvlPpirBXxmZz D+1WtriPPzdkCJQOJq6B9y3KfioVd/yMhzskT2Wp6s9Wv9Y4ljRZVsmKy/Vu8gxwy7bk EWXCjczWI+36A9BzYIuQtQYdOPv574SLfbxv5MWorCMDRGrr2W5cMU6x0TzKK3ozDbWx TNmpGlrxWTQWC4qi/nAjg5e3CSvY8kcLRwC37sbH+Lqi2Y85fUcLJW/iPPARtQKBGvjW Q2eg== X-Forwarded-Encrypted: i=1; AJvYcCVrFxfZOXyb/B8V6VCtmnKD//uRwrVmY7opO4M4VLuV6odCLMtdD1M9cGKU4mzfgsQdk74Y/enmpHS69snxuQdzCD5y/r0ChjW4SIwg X-Gm-Message-State: AOJu0Yybnjwco6wEMH9ltgZhl8Tvov9Wl8hQY6wx4NAJIUUjscbjBozs fskZCNpR51Q0XbHQKe9txWDGboESZ1wsQ9skn4p5/49x/3i6R5eSTglm7gGhmre8hIjIJciJ2S/ ZT1/byw== X-Google-Smtp-Source: AGHT+IHCN1faAO+r6hnMX5BHhvSYi2L3MP7xyujmm2Mr7VslcsQx4zStBqwTrKdnZw0UNaH7Tqzijy2cur+u X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:940b:9044:fa83:4060]) (user=irogers job=sendgmr) by 2002:a05:6902:18c6:b0:e05:aba2:43e9 with SMTP id 3f1490d57ef6-e05fea8a868mr2200276.5.1721264496521; Wed, 17 Jul 2024 18:01:36 -0700 (PDT) Date: Wed, 17 Jul 2024 18:00:22 -0700 In-Reply-To: <20240718010023.1495687-1-irogers@google.com> Message-Id: <20240718010023.1495687-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: <20240718010023.1495687-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.1089.g2a221341d9-goog Subject: [PATCH v6 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 Reviewed-by: Adrian Hunter --- 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 5359ee055c85..ad5da61d2330 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1776,8 +1776,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 @@ -2201,8 +2199,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 @@ -2255,8 +2251,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 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.1089.g2a221341d9-goog