From nobody Thu Apr 2 22:07:14 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3956D35295E for ; Fri, 13 Feb 2026 11:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770983587; cv=none; b=GtR8mDkTg1YoD+sqxZVtywTtVxsXnePKeQWD6oOEMcdPjjl/3i4Omx5pExPWWJFkfOCkfeLAHlyUp1K/pnJtzLBssc3OteHqFA4W2FGgvkw2FGVC6umq7JN81coAGospQqv3GvFz78zl8Xg7eGCHcxDLeRuk6StmzWulnV25/9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770983587; c=relaxed/simple; bh=0GS+sGsKXEzx+jNnjrXhGcR2pmtCanW/2A8zyqvNC+o=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V0PJmWNPpfseTjHUMSDMDgN9wL1Pb271mMg67ySkmblyf7yJzYpEwZyqzJJu+xb6CYmb/0SdUtzan1+3M9rIqzro2JHgx3wb+ooiDIeiJWqJEkm4goRVRQ/zg/dR/1SzvJnylXXEpxp3NcQlVuCZukX2zF9IuVDac8j80LKUf8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=QDCqIWDj; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=tlYxrYjH; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QDCqIWDj"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="tlYxrYjH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770983584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=brymhXOpcI8ZGOoB0rH9K+9PTJHbZxRRnQAyHzspC9M=; b=QDCqIWDj71v67h0ChLfkjzcaQxTvEyvFLI/StUXR6AqklaZQUkSdQ1HFKQCPXZ4UDe9PA9 Fi5SXBH8jvykT6ocat/yY/tLbReYmkS4DwXuPXJHCLSht9yghE8Mue4deZp1OjYjUmMqKn KrR/B6PFn3VIy/i7ByZNGIO+RzNse5E= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-444-byKf15LYM8-Aege2guEweA-1; Fri, 13 Feb 2026 06:53:03 -0500 X-MC-Unique: byKf15LYM8-Aege2guEweA-1 X-Mimecast-MFC-AGG-ID: byKf15LYM8-Aege2guEweA_1770983582 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4836ff58111so11023745e9.1 for ; Fri, 13 Feb 2026 03:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770983582; x=1771588382; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=brymhXOpcI8ZGOoB0rH9K+9PTJHbZxRRnQAyHzspC9M=; b=tlYxrYjHr5q8A0AEDpEMux++HskmFsHbZp8o1FpsWpuzP+jKolM5Z0zrhd7/0GMcFI 9u1ZSFjNuD1R2veLR2MfVFsivHc03nkLcE0RUBrRh7BPU3PN+AbxBKAPKnltOSVYHkB3 hoNZWHydlVWFHnlZRB105xe1GA8KAQowXGHD2w4WpmCQRKd3fUYos2pR8Wt7U8Uxgitz 4UEWPmnzxYC1/ikNjxwXoOX1WY7tffdczkr4hyD4PEwkyScMEd+vipXmlhoNdFy/Nax5 tdOOhkEDXvMelQxjDTG7B7Q+NjgTXRl7+WILbVokI33bZdX07zagNzpWrDKd7DOxuDFo d3xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770983582; x=1771588382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=brymhXOpcI8ZGOoB0rH9K+9PTJHbZxRRnQAyHzspC9M=; b=wF2u15XklNH944faAiXdL8oJrtxmHXsJ2n6U4PTQ/tGWjtGMM2iV1wDRaZmnCn6cfR ceQMD+HBSX9LtYYpzoxo0/J0x0mDrOvfZjN+wJTBRE/CPqz7teo2m0SCqOSnfoXHbOV2 PjcrKQ2keTzRAP7h/C3pzUw3XnxV88tsn0y36L8JRSIE6r9clGcZO1BmKO8+D710udle pTVFXzLnRx7EwlSEN4Rip/P6CU+09sKA6VLcOicrOZqpRpz5VnJABVCqOQowdrB5/GTR PIKTThaS06Kj47EBkRbNpBXum4A2+WJHqiEbQq3gtkW97SMRPaLFtxWQ0WfdZVyi1sgF SNhQ== X-Forwarded-Encrypted: i=1; AJvYcCV/1LsubNwcGv/JUYLyBNv/pG/a3yfaarXKMYlVn66E+hhadDwb7Wny7rcCmQ+tvkQ1qBoDArtFdYRiG/E=@vger.kernel.org X-Gm-Message-State: AOJu0YwxLpiebFwUogmJgmXnUJ6pR7E/5HQP/eX52cK3FXj8wF8bAg2l vwctsqmDpetzwJByVkcTQMP8q5tO9Q/cVlvJPJ7cz+Pn4FVWM+3Tf7CRwlbJ/WsrVCTwNYs6fjz KjL6eK7LlcqrYcynIixLYCoztu2wZGrwR7sAGqXtfRrS4q7kR3YMvfRgvLZYFKq4fOg== X-Gm-Gg: AZuq6aL0Xkr83lTAhanXiUioeAibSqYjS7I75/XJITnpIaDuWQ12Tsf4U30swJHQSZV GZIyBLiXxWBVukkBa16AUEEpTg6yGHZjpKHU+MLOv1nbjlKE/0QTlbfSfYb5z9T3mfbZ90suUxk E8psO8a7MHFYpjXGM/sNlgho3ITQDmhyCn+0ANmfFH276BG9kl0mefp+sK1uP4assZPZWEl2mni DxxG89tAp8BfRq504hUGtAsjICQKzOEOaXzV4TO/PJRyJgsOkGXxc+ljQdJu2D0ODVYgvko3tgS OPOn8M8PCcKAoGtRBbFeRNMbNui9RlsWiQ6sQDnKnuDzxq5/ZapT9jtk4qvQJYuoghry6xBgb/v 4UGOTFSqB3n73cut9T5Co9cRXCVMMx3jLGOo= X-Received: by 2002:a05:600c:5296:b0:482:eec4:74c with SMTP id 5b1f17b1804b1-48373a5d771mr22090245e9.22.1770983581821; Fri, 13 Feb 2026 03:53:01 -0800 (PST) X-Received: by 2002:a05:600c:5296:b0:482:eec4:74c with SMTP id 5b1f17b1804b1-48373a5d771mr22089795e9.22.1770983581338; Fri, 13 Feb 2026 03:53:01 -0800 (PST) Received: from costa-tp.bos2.lab ([2a00:a041:e223:1b00:fe51:8bb:7986:c897]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d835f6bsm234671275e9.14.2026.02.13.03.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 03:53:00 -0800 (PST) From: Costa Shulyupin To: Steven Rostedt , Tomas Glozar , Costa Shulyupin , Crystal Wood , Wander Lairson Costa , Ivan Pravdin , John Kacur , Tiezhu Yang , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v3 2/5] tools/rtla: Remove unneeded nr_cpus arguments Date: Fri, 13 Feb 2026 13:52:31 +0200 Message-ID: <20260213115234.430232-3-costa.shul@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213115234.430232-1-costa.shul@redhat.com> References: <20260213115234.430232-1-costa.shul@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" nr_cpus does not change at runtime, so passing it through function arguments is unnecessary. Use the global nr_cpus instead of propagating it via parameters. Signed-off-by: Costa Shulyupin --- tools/tracing/rtla/src/osnoise_hist.c | 4 ++-- tools/tracing/rtla/src/osnoise_top.c | 4 ++-- tools/tracing/rtla/src/timerlat_bpf.c | 5 ++--- tools/tracing/rtla/src/timerlat_bpf.h | 6 ++---- tools/tracing/rtla/src/timerlat_hist.c | 19 +++++++------------ tools/tracing/rtla/src/timerlat_top.c | 19 +++++++------------ tools/tracing/rtla/src/timerlat_u.c | 6 +++--- 7 files changed, 25 insertions(+), 38 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index 03ebff34fff4..d83ee047a5f5 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -62,7 +62,7 @@ static void osnoise_free_hist_tool(struct osnoise_tool *t= ool) * osnoise_alloc_histogram - alloc runtime data */ static struct osnoise_hist_data -*osnoise_alloc_histogram(int nr_cpus, int entries, int bucket_size) +*osnoise_alloc_histogram(int entries, int bucket_size) { struct osnoise_hist_data *data; int cpu; @@ -652,7 +652,7 @@ static struct osnoise_tool if (!tool) return NULL; =20 - tool->data =3D osnoise_alloc_histogram(nr_cpus, params->hist.entries, + tool->data =3D osnoise_alloc_histogram(params->hist.entries, params->hist.bucket_size); if (!tool->data) goto out_err; diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index 7dcd2e318205..73b3ac0dd43b 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -51,7 +51,7 @@ static void osnoise_free_top_tool(struct osnoise_tool *to= ol) /* * osnoise_alloc_histogram - alloc runtime data */ -static struct osnoise_top_data *osnoise_alloc_top(int nr_cpus) +static struct osnoise_top_data *osnoise_alloc_top(void) { struct osnoise_top_data *data; =20 @@ -496,7 +496,7 @@ struct osnoise_tool *osnoise_init_top(struct common_par= ams *params) if (!tool) return NULL; =20 - tool->data =3D osnoise_alloc_top(nr_cpus); + tool->data =3D osnoise_alloc_top(); if (!tool->data) { osnoise_destroy_tool(tool); return NULL; diff --git a/tools/tracing/rtla/src/timerlat_bpf.c b/tools/tracing/rtla/src= /timerlat_bpf.c index 05adf18303df..8d5c3a095e41 100644 --- a/tools/tracing/rtla/src/timerlat_bpf.c +++ b/tools/tracing/rtla/src/timerlat_bpf.c @@ -191,13 +191,12 @@ int timerlat_bpf_get_hist_value(int key, int timerlat_bpf_get_summary_value(enum summary_field key, long long *value_irq, long long *value_thread, - long long *value_user, - int cpus) + long long *value_user) { return get_value(bpf->maps.summary_irq, bpf->maps.summary_thread, bpf->maps.summary_user, - key, value_irq, value_thread, value_user, cpus); + key, value_irq, value_thread, value_user, nr_cpus); } =20 /* diff --git a/tools/tracing/rtla/src/timerlat_bpf.h b/tools/tracing/rtla/src= /timerlat_bpf.h index 169abeaf4363..f4a5476f2abb 100644 --- a/tools/tracing/rtla/src/timerlat_bpf.h +++ b/tools/tracing/rtla/src/timerlat_bpf.h @@ -28,8 +28,7 @@ int timerlat_bpf_get_hist_value(int key, int timerlat_bpf_get_summary_value(enum summary_field key, long long *value_irq, long long *value_thread, - long long *value_user, - int cpus); + long long *value_user); int timerlat_load_bpf_action_program(const char *program_path); static inline int have_libbpf_support(void) { return 1; } #else @@ -53,8 +52,7 @@ static inline int timerlat_bpf_get_hist_value(int key, static inline int timerlat_bpf_get_summary_value(enum summary_field key, long long *value_irq, long long *value_thread, - long long *value_user, - int cpus) + long long *value_user) { return -1; } diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index 841118ed84f2..dee5fbf622c3 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -83,7 +83,7 @@ static void timerlat_free_histogram_tool(struct osnoise_t= ool *tool) * timerlat_alloc_histogram - alloc runtime data */ static struct timerlat_hist_data -*timerlat_alloc_histogram(int nr_cpus, int entries, int bucket_size) +*timerlat_alloc_histogram(int entries, int bucket_size) { struct timerlat_hist_data *data; int cpu; @@ -223,8 +223,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) =20 /* Pull summary */ err =3D timerlat_bpf_get_summary_value(SUMMARY_COUNT, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -234,8 +233,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_MIN, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -245,8 +243,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_MAX, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -256,8 +253,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_SUM, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -267,8 +263,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_OVERFLOW, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -1036,7 +1031,7 @@ static struct osnoise_tool if (!tool) return NULL; =20 - tool->data =3D timerlat_alloc_histogram(nr_cpus, params->hist.entries, + tool->data =3D timerlat_alloc_histogram(params->hist.entries, params->hist.bucket_size); if (!tool->data) goto out_err; diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 3e395ce4fa9f..25b4d81b4fe0 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -62,7 +62,7 @@ static void timerlat_free_top_tool(struct osnoise_tool *t= ool) /* * timerlat_alloc_histogram - alloc runtime data */ -static struct timerlat_top_data *timerlat_alloc_top(int nr_cpus) +static struct timerlat_top_data *timerlat_alloc_top(void) { struct timerlat_top_data *data; int cpu; @@ -196,8 +196,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) =20 /* Pull summary */ err =3D timerlat_bpf_get_summary_value(SUMMARY_CURRENT, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -207,8 +206,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_COUNT, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -218,8 +216,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_MIN, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -229,8 +226,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_MAX, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -240,8 +236,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) } =20 err =3D timerlat_bpf_get_summary_value(SUMMARY_SUM, - value_irq, value_thread, value_user, - data->nr_cpus); + value_irq, value_thread, value_user); if (err) return err; for (i =3D 0; i < data->nr_cpus; i++) { @@ -782,7 +777,7 @@ static struct osnoise_tool if (!top) return NULL; =20 - top->data =3D timerlat_alloc_top(nr_cpus); + top->data =3D timerlat_alloc_top(); if (!top->data) goto out_err; =20 diff --git a/tools/tracing/rtla/src/timerlat_u.c b/tools/tracing/rtla/src/t= imerlat_u.c index a569fe7f93aa..03b4e68e8b1e 100644 --- a/tools/tracing/rtla/src/timerlat_u.c +++ b/tools/tracing/rtla/src/timerlat_u.c @@ -99,7 +99,7 @@ static int timerlat_u_main(int cpu, struct timerlat_u_par= ams *params) * * Return the number of processes that received the kill. */ -static int timerlat_u_send_kill(pid_t *procs, int nr_cpus) +static int timerlat_u_send_kill(pid_t *procs) { int killed =3D 0; int i, retval; @@ -169,7 +169,7 @@ void *timerlat_u_dispatcher(void *data) =20 /* parent */ if (pid =3D=3D -1) { - timerlat_u_send_kill(procs, nr_cpus); + timerlat_u_send_kill(procs); debug_msg("Failed to create child processes"); pthread_exit(&retval); } @@ -196,7 +196,7 @@ void *timerlat_u_dispatcher(void *data) sleep(1); } =20 - timerlat_u_send_kill(procs, nr_cpus); + timerlat_u_send_kill(procs); =20 while (procs_count) { pid =3D waitpid(-1, &wstatus, 0); --=20 2.52.0