From nobody Tue Feb 10 20:05:50 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 2A5FC3624DE for ; Mon, 9 Feb 2026 09:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770629111; cv=none; b=s90SodzyD1lefOQjKjbZSEWg1OGhu9Wz5XfQs8j+4Aw0JQsAX6rz1wQ4GjF1qVeapp34FCAJVFkLhYFz+dM64Sk9QI8N/Xiv4I7nx0DGwbEnsqMUkRQxKEa2MuWd/XFyj2UzynA+9zgOsba3XE0TpQ1CAyOcsVpRAVHSoJ79CEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770629111; c=relaxed/simple; bh=jXM6h73fi/T1NI6sc5NlsOcr2JeACiIlmwKPddXhEyc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jaryT5olBvaZSvA3xNAJQymRCo24gwqbnFV9KaFfpufw1YcrMykLcm+NuzPfCvDqB202/t8qZVi0pKaFGR/ZfpqSVd1ay+5w8iygt31h9L8aMQ81BZdF33qonR3Fkmbr9ETG26+GcwePn9gO7sFJm8nMX8m07lkmtQgpFsy5+v0= 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=T3/Zzoaj; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=LPHBb2wl; arc=none smtp.client-ip=170.10.129.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="T3/Zzoaj"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="LPHBb2wl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770629110; 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=vrzntSVggQfVgXA1EfIrnMrsyGocXfN5hLyeRmwcLd0=; b=T3/ZzoajpQqp5M/+ui8wdZ1QUx8L1UbO4vFlxydB5qKd2mbp2vQzSTaEydpIMBcKC6vKNx vLJQj4dS2qCe0MqxaKeO/O2vIQ7idPDVHCOmnPAPtQyCTFnAX1HWVMBw0NaHw+i3jkPusw b+k/Ux6jkQONHc7hMldzVgLAkDTcvWY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-375-AQsXbkOFMwKJArkU9zyYNw-1; Mon, 09 Feb 2026 04:25:08 -0500 X-MC-Unique: AQsXbkOFMwKJArkU9zyYNw-1 X-Mimecast-MFC-AGG-ID: AQsXbkOFMwKJArkU9zyYNw_1770629107 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-482d8e6e13aso31315135e9.3 for ; Mon, 09 Feb 2026 01:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770629107; x=1771233907; 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=vrzntSVggQfVgXA1EfIrnMrsyGocXfN5hLyeRmwcLd0=; b=LPHBb2wlvzHU2pUC8e1YUSCfikI3hstMcfZt6H946JzTHCxq8Dekf6czPHbl+Hc119 E16+eo741ivzeGFOcHC7D7sBYuWos1lECSj09hNum9HG3BmJTLwJUrZLYUNIA5qOMmNT NskLh01RN9j635jOdTlNaA6R85AzyDnxr3yjgA/kT6GTA8HQ/Y65hYPq1uV7lyKP3j2u 0CcyoeGetKPN5lX46GYa4ZjU84K/agg5sDs9mdS/ZoUMdAbNFl2BL2U9r7C8ZaQMF7Ki VHm0TFGjzL3FhEjxD1VasFejZ4sLMYnrIST7D/G/WCS24sdcokfMOdkjKEGSXdu4CWX5 c4yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770629107; x=1771233907; 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=vrzntSVggQfVgXA1EfIrnMrsyGocXfN5hLyeRmwcLd0=; b=kwL+lert5Vhpxo26zf7fnOs7oKsUmlDVVUxIfXSgOcAZxOWGRK8GxYGAzfkKNKoYKO btnhSg3lWzQFEqgHPWxd4nJg9MNpe7ngw5VOKF33TQWsOZyWBOlckRxqCZeUsH0eYezt oJkvBl0HRbqJa3bgNfB8EXtbggijFrb0Fw3RvFoQk3LgTFDej0SITYJ+xZCbay6wTSE7 /h5YPFapLsMSZO+0Obaz7GnC5MZ8mpPHKzv2gyBwOFgKZH+5DN83ipKPh6E2dGqTh4rz EFe8ouVBb0Kyeci6HNuoGSyJWIq2cqIDNzlLU3xgFt4klA5ZADmGvjB0dYIZMQaV5PjQ hR0g== X-Forwarded-Encrypted: i=1; AJvYcCUrz0Fx2PTjgZ3/IZfJ5s9S4ahFO9WsJrU3I3MKuRRBh77zl9F6owkuKkdy9jc9nAGIFuacF1xzEFKEK0U=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0we738MjxByEMTMPQeXNEVlBoOvgvZG+ZBStQHT74MqaK+Mkq 34r8FO4YYQZ5jU3Vg8zYtjNf91wafe9lF3IThrNvxvf0GlWTarb0iWY5rdXU/tu7U0/Tn8Ht6kF 20v0OuglQHd27Psp3g2Io1ZQL5Z1hX08pGqYPL4Bt5T6VLNZ3lE0WJ9Ixj8qjVFq2YA== X-Gm-Gg: AZuq6aLlKeB1Udg08B09CSnfIfaEv5nZfNoWJ76fZA+bn4FvFf88eyGoFu4sN05iKFK p7pc0EbK51inkq8RECWK9gF7idUgDDQWDdlBaRqk64/t4XH2DzX+3GGt0SEI+lNCkREz5ntUvnt QwZ/c+RalbggBPXRmUyQQNqSo+85DCy/PX0OvULvcGLOHW36dzVL5pxGo+VmLS2E9V3wNtDfvxE qf2Wk4arQo/h690UGEkpV3BugZfhBGUmQKVCTyodYOS4R3d8EJOLsBybus3pgDMyVu6uChW9l0u 7Ea5Lv0/pbpm/NzMEhVuayev2mPCT/Yqy0G+AgpKLa0+AfPpsyOvF3BSnW71gbuok2fSX1GANHE x+JZXjrwYGxg0a84gNutA7Qqn5A== X-Received: by 2002:a05:600c:5307:b0:480:4a4f:c36f with SMTP id 5b1f17b1804b1-4832096671dmr160891245e9.21.1770629107336; Mon, 09 Feb 2026 01:25:07 -0800 (PST) X-Received: by 2002:a05:600c:5307:b0:480:4a4f:c36f with SMTP id 5b1f17b1804b1-4832096671dmr160890915e9.21.1770629106883; Mon, 09 Feb 2026 01:25:06 -0800 (PST) Received: from costa-tp.redhat.com ([2a00:a041:e223:1b00:fe51:8bb:7986:c897]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48317d33f5fsm316310295e9.5.2026.02.09.01.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Feb 2026 01:25:06 -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 v2 4/4] tools/rtla: Remove unneeded nr_cpus from for_each_monitored_cpu Date: Mon, 9 Feb 2026 11:24:36 +0200 Message-ID: <20260209092436.2899888-5-costa.shul@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260209092436.2899888-1-costa.shul@redhat.com> References: <20260209092436.2899888-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 the macro argument is unnecessary. Remove the argument and use the global nr_cpus instead. Signed-off-by: Costa Shulyupin --- tools/tracing/rtla/src/common.h | 2 +- tools/tracing/rtla/src/osnoise_hist.c | 15 +++++++-------- tools/tracing/rtla/src/osnoise_top.c | 2 +- tools/tracing/rtla/src/timerlat.c | 4 ++-- tools/tracing/rtla/src/timerlat_hist.c | 16 ++++++++-------- tools/tracing/rtla/src/timerlat_top.c | 2 +- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/tools/tracing/rtla/src/common.h b/tools/tracing/rtla/src/commo= n.h index 32f9c1351209..28d258d6d178 100644 --- a/tools/tracing/rtla/src/common.h +++ b/tools/tracing/rtla/src/common.h @@ -109,7 +109,7 @@ struct common_params { =20 extern int nr_cpus; =20 -#define for_each_monitored_cpu(cpu, nr_cpus, common) \ +#define for_each_monitored_cpu(cpu, common) \ for (cpu =3D 0; cpu < nr_cpus; cpu++) \ if (!(common)->cpus || CPU_ISSET(cpu, &(common)->monitored_cpus)) =20 diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index 90291504a1aa..e8f07108d39a 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -244,7 +244,7 @@ static void osnoise_hist_header(struct osnoise_tool *to= ol) if (!params->common.hist.no_index) trace_seq_printf(s, "Index"); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -273,8 +273,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "count:"); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { - + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; =20 @@ -285,7 +284,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "min: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -298,7 +297,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "avg: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -314,7 +313,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "max: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -349,7 +348,7 @@ osnoise_print_stats(struct osnoise_tool *tool) trace_seq_printf(trace->seq, "%-6d", bucket * data->bucket_size); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -385,7 +384,7 @@ osnoise_print_stats(struct osnoise_tool *tool) if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "over: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index 6fb3e72d74f2..ab5db35f21ae 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -236,7 +236,7 @@ osnoise_print_stats(struct osnoise_tool *top) =20 osnoise_top_header(top); =20 - for_each_monitored_cpu(i, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(i, ¶ms->common) { osnoise_top_print(top, i); } =20 diff --git a/tools/tracing/rtla/src/timerlat.c b/tools/tracing/rtla/src/tim= erlat.c index 69856f677fce..ec14abd45fff 100644 --- a/tools/tracing/rtla/src/timerlat.c +++ b/tools/tracing/rtla/src/timerlat.c @@ -115,7 +115,7 @@ int timerlat_enable(struct osnoise_tool *tool) return -1; } =20 - for_each_monitored_cpu(i, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(i, ¶ms->common) { if (save_cpu_idle_disable_state(i) < 0) { err_msg("Could not save cpu idle state.\n"); return -1; @@ -218,7 +218,7 @@ void timerlat_free(struct osnoise_tool *tool) if (dma_latency_fd >=3D 0) close(dma_latency_fd); if (params->deepest_idle_state >=3D -1) { - for_each_monitored_cpu(i, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(i, ¶ms->common) { restore_cpu_idle_disable_state(i); } } diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index 4bf1489cad23..db66312ec966 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -298,7 +298,7 @@ static void timerlat_hist_header(struct osnoise_tool *t= ool) if (!params->common.hist.no_index) trace_seq_printf(s, "Index"); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -350,7 +350,7 @@ timerlat_print_summary(struct timerlat_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "count:"); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -372,7 +372,7 @@ timerlat_print_summary(struct timerlat_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "min: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -400,7 +400,7 @@ timerlat_print_summary(struct timerlat_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "avg: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -428,7 +428,7 @@ timerlat_print_summary(struct timerlat_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "max: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -473,7 +473,7 @@ timerlat_print_stats_all(struct timerlat_params *params, sum.min_thread =3D ~0; sum.min_user =3D ~0; =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -620,7 +620,7 @@ timerlat_print_stats(struct osnoise_tool *tool) trace_seq_printf(trace->seq, "%-6d", bucket * data->bucket_size); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -658,7 +658,7 @@ timerlat_print_stats(struct osnoise_tool *tool) if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "over: "); =20 - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 4eb820fe1f21..ed3d3d1c8956 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -446,7 +446,7 @@ timerlat_print_stats(struct osnoise_tool *top) =20 timerlat_top_header(params, top); =20 - for_each_monitored_cpu(i, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(i, ¶ms->common) { timerlat_top_print(top, i); timerlat_top_update_sum(top, i, &summary); } --=20 2.52.0