From mboxrd@z Thu Jan 1 00:00:00 1970 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 9B54C358D31 for ; Fri, 5 Dec 2025 15:19:57 +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=1764948001; cv=none; b=VXGnY1EgtLBlYJ9jHNi2a1NuRnyhavC0FkeCGOFf5ztgAc1rikQS2UMQwZaWoXD9v8dq80I2b8JHd/8lMbr9dWJo19Jth/W3D0xgX8oozZ/BrADicUWHs+7nfit0n46OHE5QXAo+H7q4Hd9/485Y+PMrhnNoM6cl/NT9bLPh0q8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764948001; c=relaxed/simple; bh=1zpC3boqKD7w1pM9kextaa6f1WgP7ZLPKy2Nz7w1Xpg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fvdUs7/yRTfKf2ekFU1kkGF4qbnCRnBW+Zf0Oc1QFfAPzUH0tec9U/Q9cqw4XgDnuLgL0m+gKytIS8N+rBlwCeLTKuXoERNCZuZfxfr3d1kmQkZIn79Wmaq/k7fjKN9nS2AC9BEDLl44sdC28A4ZyAz/GtNLaqF6OnuzV8OuPc4= 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=SMWh8KrK; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=G9ZiHxmm; 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="SMWh8KrK"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="G9ZiHxmm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764947996; 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=CqKIlVXXTKmBZEACp6ZW5pAUcp+AnDB3jgqSU2dLbHE=; b=SMWh8KrKDpzlihEaG4pEdeRnVaC7+WnyVg4R3zdIrnU11WYfLFraveYHYJ39w85wTxQM7c DY3/KjSh1dUHTmIGksjQ6iwV1gLvnBko9O/Wg1VEGQMI/tZ7tRkn9QqaQxSZto6kMxgmkg mZcottjSJr4g/TZTrp0equD2/cse6Ug= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-0WhdJHvUOym6bG-PoWdH0g-1; Fri, 05 Dec 2025 10:19:55 -0500 X-MC-Unique: 0WhdJHvUOym6bG-PoWdH0g-1 X-Mimecast-MFC-AGG-ID: 0WhdJHvUOym6bG-PoWdH0g_1764947994 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-477964c22e0so14528005e9.0 for ; Fri, 05 Dec 2025 07:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764947994; x=1765552794; 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=CqKIlVXXTKmBZEACp6ZW5pAUcp+AnDB3jgqSU2dLbHE=; b=G9ZiHxmm317S8r4IbfeixPakD84ONqFeieSJpOuUh2ZcMkhQDDDhWpne6ssUFbvIPR YgE404a3Gu4Rnvp+8XKtiKjW+oCKJ2b0aZZbLh+vUlm5si+wvtxUcKgN/2bME1ea77Nf jCNcWsv1QcUc5XQ+vYUl7yK5RVk/i+Uh7U8Eng8NScQj5WQ/CotFynM4dUL0MMwJfA/K D2mqdZFaSrhdOwyZq66vgI0AZXh0veJII0WI5PhotcCNpNAJvhHaSzKPzRONzFg7B+rl S4TsILVjVWdjMjSFOnn4rQ7ifRts055XPaDzP8rIv7KR56ISlq/FjLXepnM6KYSeoABA wkaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764947994; x=1765552794; 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=CqKIlVXXTKmBZEACp6ZW5pAUcp+AnDB3jgqSU2dLbHE=; b=h4yxudNGVbUgqsD0e3J2ZC1Ob7v01jakQeZli06yCQDZosL5BG6/7QEQ9mejKsh4YT xQGfrplW8cJMVZLgW8dkowrgK6wEdyrkSGIicuIV8Fw1xgNrlVenMRCYtdK0HEQEZiZW hFkvF1a6obj65kt0MvfS9usOHq7Xa4yaal+0y/qt5WYEj8FhrERjHRqLzNHZln+8Q3LP i4i6ZvPxvxxvdPvHRt1HQS7E1fYH0zhx0OucgyQJN+xo1xXBdHDgJqSOY7BRw+EdePIs 7oxJrVFASalurieffxJXN3CmJDdWujAr9dNLW1VHFMaNefxBwHIuUl7/fEF3WqbfRfqQ nBIw== X-Forwarded-Encrypted: i=1; AJvYcCU8E1i5iZCzhaFjrwIA4w4ZZRFWG6R3OcYggHdYNo+lSDhH5590N2cWJX99WIUj4a0iLU81+OQ1+s+wE5M=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/0dTQh5oEHTD80Kioi9Q3YAFrBpd8BK+JZNT/Fc+LjiLKZ+Xy J4qQqDRStvTdL3omwXTOiXSJCAU28OYwKgJGHcl4/KNmH3f9lImz7jlfDpzOzTMB2UeddAM1f39 56FYHcpQZH8j4N89s0JBDmsBcvKDodF/yNm5rjKQVj6afpyxnpS2N/2yBwVyqziI0rvxaiqco/P 1j X-Gm-Gg: ASbGncuk/EBVkuuqBJbmyrIb/xj2mcL4vfK09/TAvKYNnZtmi8QU3LgfbSzrsc3CXVP /i08GqEaCyzk2kmetSixCSLM62lRXprw79cGSM2sq3Bz9BHfXIf5DizXuHJXBRe//8G9SpVghQj aukywk7dWvLwMmaZMHKZO+QN50Znhb9ufWbr+L2v8yHOQ+T5yofCVRUGPhSIWKl7HFZBvEBmHGO LJzT6+jlCcw8f3ieLiekExv2+8MQMci6krFN4Y38clmavUlgR92EkBdZi3k7RG4qViCrnDStrlB +CTNKSUlAw0tjh6IcQLIDwIh9jEDrrT5MZGKVJEIL1Tqd/lwz62nCe7tQMmGm0DszGCq2U/cPXc 9HdF13nVx84cGFd04G7/gH+iDuaE= X-Received: by 2002:a05:600c:35cb:b0:479:1348:c63e with SMTP id 5b1f17b1804b1-4792eb34362mr87708875e9.9.1764947993634; Fri, 05 Dec 2025 07:19:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsalfLoAN7coI5FE0IesHktXh0uZ/rZJu8GrJTUoz+4jj9gwBhkJ+9n5C5J3zuXs0/CIA+MQ== X-Received: by 2002:a05:600c:35cb:b0:479:1348:c63e with SMTP id 5b1f17b1804b1-4792eb34362mr87708475e9.9.1764947993198; Fri, 05 Dec 2025 07:19:53 -0800 (PST) Received: from costa-tp.redhat.com ([2a00:a041:e294:5000:b694:8e49:4f51:966d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792b021cd2sm74880785e9.1.2025.12.05.07.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Dec 2025 07:19:52 -0800 (PST) From: Costa Shulyupin To: Steven Rostedt , Tomas Glozar , Crystal Wood , Wander Lairson Costa , Costa Shulyupin , Ivan Pravdin , John Kacur , Tiezhu Yang , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v1 4/4] tools/rtla: Remove unneeded nr_cpus from for_each_monitored_cpu Date: Fri, 5 Dec 2025 17:19:24 +0200 Message-ID: <20251205151924.2250142-4-costa.shul@redhat.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251205151924.2250142-1-costa.shul@redhat.com> References: <20251205151924.2250142-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: 8bit 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/common.h index 2765e2a9f85f..a597e7591e20 100644 --- a/tools/tracing/rtla/src/common.h +++ b/tools/tracing/rtla/src/common.h @@ -109,7 +109,7 @@ struct common_params { extern int nr_cpus; -#define for_each_monitored_cpu(cpu, nr_cpus, common) \ +#define for_each_monitored_cpu(cpu, common) \ for (cpu = 0; cpu < nr_cpus; cpu++) \ if (!(common)->cpus || CPU_ISSET(cpu, &(common)->monitored_cpus)) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c index 7514b29ec559..56bca13b991f 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -245,7 +245,7 @@ static void osnoise_hist_header(struct osnoise_tool *tool) if (!params->common.hist.no_index) trace_seq_printf(s, "Index"); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; @@ -274,8 +274,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "count:"); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { - + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; @@ -286,7 +285,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "min: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; @@ -299,7 +298,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "avg: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; @@ -315,7 +314,7 @@ osnoise_print_summary(struct osnoise_params *params, if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "max: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; @@ -350,7 +349,7 @@ osnoise_print_stats(struct osnoise_tool *tool) trace_seq_printf(trace->seq, "%-6d", bucket * data->bucket_size); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { if (!data->hist[cpu].count) continue; @@ -386,7 +385,7 @@ osnoise_print_stats(struct osnoise_tool *tool) if (!params->common.hist.no_index) trace_seq_printf(trace->seq, "over: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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 e5a13f1bdfb6..0f5b86f11486 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) osnoise_top_header(top); - for_each_monitored_cpu(i, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(i, ¶ms->common) { osnoise_top_print(top, i); } diff --git a/tools/tracing/rtla/src/timerlat.c b/tools/tracing/rtla/src/timerlat.c index 7503e18b905c..181d72de3197 100644 --- a/tools/tracing/rtla/src/timerlat.c +++ b/tools/tracing/rtla/src/timerlat.c @@ -124,7 +124,7 @@ int timerlat_enable(struct osnoise_tool *tool) return -1; } - 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; @@ -217,7 +217,7 @@ void timerlat_free(struct osnoise_tool *tool) if (dma_latency_fd >= 0) close(dma_latency_fd); if (params->deepest_idle_state >= -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/src/timerlat_hist.c index 207359f1cec4..e93476e18ad8 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 *tool) if (!params->common.hist.no_index) trace_seq_printf(s, "Index"); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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:"); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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 = ~0; sum.min_user = ~0; - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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: "); - for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, ¶ms->common) { 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 34c8a0010828..c48f02075197 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -447,7 +447,7 @@ timerlat_print_stats(struct osnoise_tool *top) timerlat_top_header(params, top); - 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); } -- 2.52.0