From nobody Thu Apr 2 21:51:46 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 08B2A430BB3 for ; Fri, 6 Mar 2026 19:54:27 +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=1772826869; cv=none; b=X1uwlOBmGDdJqIGtTsDsop9wVG8oVDEDaUU8vqWTpoR2qKLmIokYY53OTtUxyhynqVWvYYG7gogwIgHB0r/d1fnJRN3Xv8Xs/84OXGD6vmqUhdsqg6cLhojOG68sKb6/Xj2kmyWSoVEypRUtCwS+M0ILBssJ2gxkxxFg1QhfOFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772826869; c=relaxed/simple; bh=6to0dfrAh3XjTCSonSgtXalBKtCubLPLIEWU1ztAl+A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=urWo3NDzQWUdgNyJbNINCEn4GFE6rF7n3/k/A/LQyCcWdL6/gAXbBdXOtSbZsmzS3uWosUWsNVaQ7N2DG2Og4Y1DInQ7am1tYP2bDShGIu5tr6QIMshrJP5rO1eZM+46Bu8UdfeCi6uWBMCzibZdwzf+Cz7I3wPm7x7fBnI3cPU= 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=ZXD6/zyJ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=JAfDRa6Y; 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="ZXD6/zyJ"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="JAfDRa6Y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772826867; 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=zVtg1Z0m8Jaq2J1pJ1SVX/vA+T31djcwB6wnVu1yPyc=; b=ZXD6/zyJEUSmqSn4vCuf8XNHAyJTHBWwVKDHylDATLignLL5WUFPDeVhxsyDpCwh3uFOh8 ElkIU2EDX8bqYb0gKqzV3xPm0WysBaY8A6OjZ/X7mh+pr3BWpujt0cjj4ksJ9ja/Kx7Fgo eLwpDvZA/iGE0wE/15jpEKUMLYFyJ/Y= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-MGxJ_xdNPb2A9k12SqQQ7w-1; Fri, 06 Mar 2026 14:54:24 -0500 X-MC-Unique: MGxJ_xdNPb2A9k12SqQQ7w-1 X-Mimecast-MFC-AGG-ID: MGxJ_xdNPb2A9k12SqQQ7w_1772826862 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-48372facfedso85556945e9.0 for ; Fri, 06 Mar 2026 11:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1772826862; x=1773431662; 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=zVtg1Z0m8Jaq2J1pJ1SVX/vA+T31djcwB6wnVu1yPyc=; b=JAfDRa6Y5mk71R+o2i7fYCfokGC3VaMdjMDcciSN6Z2a8PrwFm38WG8ZAJ7X/6ijQN +L0neHoN4c7PXPcCB3I9xekSmko0q8M8XtWnlXcw0bvBiVM+1+z6hvwXRoHG2vcGEfGC y2SoNaGunKdELtnDTr7Y8gw+mojmDMB+ceTz1eYO5+vWOJpISqeb6SrPJmRsu1mQluoo kbmv5ayU0j/IOzLtQCG3fsEoiF2KQEKhFPAZuMB85axgk88HhTP9UiNrrugY0nneZE8f EOQ+i+4uTrBJ80f1HrTtNyouy1sVYgDAO4j4smz8hpP5mxv3llmniBQtaGRUJsjI6gR1 hKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772826862; x=1773431662; 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=zVtg1Z0m8Jaq2J1pJ1SVX/vA+T31djcwB6wnVu1yPyc=; b=fhnVFyWsngU0M8YiWCNJB0Q4NnCxVrg8hD7SCBLoGmhV1cMQIEJaZyeLMoYQeDoKA4 nwGABmjevNuIILpv1BN8CMEm9Y4W1+uIFUiBtms+xoFtIgr0CLWbeXIzEucj0zH02/hV GCcPwKbc+TodcToexqN6yxxbxah6c+Y3PobLqcudlRJRr8tJ7oV2KdmSO606EHNLDIFd eOFdL22dPc4gGKmaImOk/weWWVwaURmYjQqPLP+vCX3gCDgI28kpKbtFQ+PNA51Qq4zf IpjfopkxzAsTjIeCSuvOG/g0WCWJDig77gr/Xp40ns+HDlFTTW9jjpBy8it7aoidSCg6 h+1g== X-Forwarded-Encrypted: i=1; AJvYcCWIMquf/K0lGstZIBEO2wNc1Ob9D7/7ZhyilS4xqhoJcr+NC3hXB4lSA6N7LfaIFqFLm7jyVIuBN3fbAjI=@vger.kernel.org X-Gm-Message-State: AOJu0YxmmZWoDA31B04S/vCqNyZik/1v7Jw1Sy+IZOXjQKBqzNzBYpOl tXcFmtDNNTaziEgF+G85/HMtdunWtgU7vgXs8WA7lzb0ojy6Qw9NC8TzGjLThpWB2rZG0ancogg eKgodnwAzRLg4bJiudI0fkpWfSGaY+Z3PyDbadACFdiyktKTqSUMooZSQ5i/dqE72wQ== X-Gm-Gg: ATEYQzxNN67N7iDi3YQgyuT2ibl3Ewz9E5MZmNXUQee8aGUmcWE5rznIdTNFSP5TjEn 2G3G+kueURUAEUASPG07CCnb0IL1fEJ6HXmuP1g+bUbYe6mMlOpzTfI1LxQ0ayd5/TxY0RuW2Fg TDwB2rduBxYyj9n/LXXolb9SWVwzio8sDdS2Q98twl40FIJK14CC99NK5RQVmTRpG3BRPgW/E4D YPtsZb6ArHiWDgVS4QcnunUaUtXnFk61MztA3IhsaEIkdY28u10Bb3ZsM2v1dHSx5o8TL7xXtHK FYpScBGsyOLzM0z7P+bgUaL9IGtgKYrQoO4wZia2exbUnzwevq7as8M4d3WVjedbhiUuGhGRNFX 2zZrU8M9RD6nlvBj93cweYJYH1UyoX5TBcCKtzw== X-Received: by 2002:a05:600c:1e88:b0:479:13e9:3d64 with SMTP id 5b1f17b1804b1-48526759d12mr62794545e9.15.1772826861996; Fri, 06 Mar 2026 11:54:21 -0800 (PST) X-Received: by 2002:a05:600c:1e88:b0:479:13e9:3d64 with SMTP id 5b1f17b1804b1-48526759d12mr62794165e9.15.1772826861464; Fri, 06 Mar 2026 11:54:21 -0800 (PST) Received: from costa-tp.redhat.com ([2a00:a041:e223:1b00:fe51:8bb:7986:c897]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485276b75eesm48596485e9.14.2026.03.06.11.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 11:54:21 -0800 (PST) From: Costa Shulyupin To: Steven Rostedt , Tomas Glozar , Costa Shulyupin , Crystal Wood , Wander Lairson Costa , John Kacur , Ivan Pravdin , Tiezhu Yang , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v4 3/4] tools/rtla: Remove unneeded nr_cpus members Date: Fri, 6 Mar 2026 21:49:51 +0200 Message-ID: <20260306194953.2511960-4-costa.shul@redhat.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260306194953.2511960-1-costa.shul@redhat.com> References: <20260306194953.2511960-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 keeping it in struct members is unnecessary. Use the global nr_cpus instead of struct members. Signed-off-by: Costa Shulyupin --- tools/tracing/rtla/src/osnoise_hist.c | 18 ++++++------ tools/tracing/rtla/src/osnoise_top.c | 3 -- tools/tracing/rtla/src/timerlat_aa.c | 10 +++---- tools/tracing/rtla/src/timerlat_hist.c | 38 ++++++++++++-------------- tools/tracing/rtla/src/timerlat_top.c | 19 ++++++------- 5 files changed, 38 insertions(+), 50 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index f39f60d3b00e..5bbec27b46a7 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -29,7 +29,6 @@ struct osnoise_hist_data { struct osnoise_hist_cpu *hist; int entries; int bucket_size; - int nr_cpus; }; =20 /* @@ -41,7 +40,7 @@ osnoise_free_histogram(struct osnoise_hist_data *data) int cpu; =20 /* one histogram for IRQ and one for thread, per CPU */ - for (cpu =3D 0; cpu < data->nr_cpus; cpu++) { + for (cpu =3D 0; cpu < nr_cpus; cpu++) { if (data->hist[cpu].samples) free(data->hist[cpu].samples); } @@ -73,7 +72,6 @@ static struct osnoise_hist_data =20 data->entries =3D entries; data->bucket_size =3D bucket_size; - data->nr_cpus =3D nr_cpus; =20 data->hist =3D calloc(1, sizeof(*data->hist) * nr_cpus); if (!data->hist) @@ -246,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -275,7 +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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -287,7 +285,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -300,7 +298,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -316,7 +314,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -351,7 +349,7 @@ osnoise_print_stats(struct osnoise_tool *tool) trace_seq_printf(trace->seq, "%-6d", bucket * data->bucket_size); =20 - for_each_monitored_cpu(cpu, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].count) continue; @@ -387,7 +385,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶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 3a241b69f622..672cdb254f4c 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -31,7 +31,6 @@ struct osnoise_top_cpu { =20 struct osnoise_top_data { struct osnoise_top_cpu *cpu_data; - int nr_cpus; }; =20 /* @@ -59,8 +58,6 @@ static struct osnoise_top_data *osnoise_alloc_top(void) if (!data) return NULL; =20 - data->nr_cpus =3D nr_cpus; - /* one set of histograms per CPU */ data->cpu_data =3D calloc(1, sizeof(*data->cpu_data) * nr_cpus); if (!data->cpu_data) diff --git a/tools/tracing/rtla/src/timerlat_aa.c b/tools/tracing/rtla/src/= timerlat_aa.c index 095483375823..41d8d48c5b41 100644 --- a/tools/tracing/rtla/src/timerlat_aa.c +++ b/tools/tracing/rtla/src/timerlat_aa.c @@ -102,7 +102,6 @@ struct timerlat_aa_data { * The analysis context and system wide view */ struct timerlat_aa_context { - int nr_cpus; int dump_tasks; enum stack_format stack_format; =20 @@ -759,7 +758,7 @@ void timerlat_auto_analysis(int irq_thresh, int thread_= thresh) irq_thresh =3D irq_thresh * 1000; thread_thresh =3D thread_thresh * 1000; =20 - for (cpu =3D 0; cpu < taa_ctx->nr_cpus; cpu++) { + for (cpu =3D 0; cpu < nr_cpus; cpu++) { taa_data =3D timerlat_aa_get_data(taa_ctx, cpu); =20 if (irq_thresh && taa_data->tlat_irq_latency >=3D irq_thresh) { @@ -787,7 +786,7 @@ void timerlat_auto_analysis(int irq_thresh, int thread_= thresh) =20 printf("\n"); printf("Printing CPU tasks:\n"); - for (cpu =3D 0; cpu < taa_ctx->nr_cpus; cpu++) { + for (cpu =3D 0; cpu < nr_cpus; cpu++) { taa_data =3D timerlat_aa_get_data(taa_ctx, cpu); tep =3D taa_ctx->tool->trace.tep; =20 @@ -813,7 +812,7 @@ static void timerlat_aa_destroy_seqs(struct timerlat_aa= _context *taa_ctx) if (!taa_ctx->taa_data) return; =20 - for (i =3D 0; i < taa_ctx->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { taa_data =3D timerlat_aa_get_data(taa_ctx, i); =20 if (taa_data->prev_irqs_seq) { @@ -863,7 +862,7 @@ static int timerlat_aa_init_seqs(struct timerlat_aa_con= text *taa_ctx) struct timerlat_aa_data *taa_data; int i; =20 - for (i =3D 0; i < taa_ctx->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { =20 taa_data =3D timerlat_aa_get_data(taa_ctx, i); =20 @@ -1052,7 +1051,6 @@ int timerlat_aa_init(struct osnoise_tool *tool, int d= ump_tasks, enum stack_forma =20 __timerlat_aa_ctx =3D taa_ctx; =20 - taa_ctx->nr_cpus =3D nr_cpus; taa_ctx->tool =3D tool; taa_ctx->dump_tasks =3D dump_tasks; taa_ctx->stack_format =3D stack_format; diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index 7e735b62488c..cfb745b75b8a 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -44,7 +44,6 @@ struct timerlat_hist_data { struct timerlat_hist_cpu *hist; int entries; int bucket_size; - int nr_cpus; }; =20 /* @@ -56,7 +55,7 @@ timerlat_free_histogram(struct timerlat_hist_data *data) int cpu; =20 /* one histogram for IRQ and one for thread, per CPU */ - for (cpu =3D 0; cpu < data->nr_cpus; cpu++) { + for (cpu =3D 0; cpu < nr_cpus; cpu++) { if (data->hist[cpu].irq) free(data->hist[cpu].irq); =20 @@ -94,7 +93,6 @@ static struct timerlat_hist_data =20 data->entries =3D entries; data->bucket_size =3D bucket_size; - data->nr_cpus =3D nr_cpus; =20 /* one set of histograms per CPU */ data->hist =3D calloc(1, sizeof(*data->hist) * nr_cpus); @@ -204,9 +202,9 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) { struct timerlat_hist_data *data =3D tool->data; int i, j, err; - long long value_irq[data->nr_cpus], - value_thread[data->nr_cpus], - value_user[data->nr_cpus]; + long long value_irq[nr_cpus], + value_thread[nr_cpus], + value_user[nr_cpus]; =20 /* Pull histogram */ for (i =3D 0; i < data->entries; i++) { @@ -214,7 +212,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) value_user); if (err) return err; - for (j =3D 0; j < data->nr_cpus; j++) { + for (j =3D 0; j < nr_cpus; j++) { data->hist[j].irq[i] =3D value_irq[j]; data->hist[j].thread[i] =3D value_thread[j]; data->hist[j].user[i] =3D value_user[j]; @@ -226,7 +224,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->hist[i].irq_count =3D value_irq[i]; data->hist[i].thread_count =3D value_thread[i]; data->hist[i].user_count =3D value_user[i]; @@ -236,7 +234,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->hist[i].min_irq =3D value_irq[i]; data->hist[i].min_thread =3D value_thread[i]; data->hist[i].min_user =3D value_user[i]; @@ -246,7 +244,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->hist[i].max_irq =3D value_irq[i]; data->hist[i].max_thread =3D value_thread[i]; data->hist[i].max_user =3D value_user[i]; @@ -256,7 +254,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->hist[i].sum_irq =3D value_irq[i]; data->hist[i].sum_thread =3D value_thread[i]; data->hist[i].sum_user =3D value_user[i]; @@ -266,7 +264,7 @@ static int timerlat_hist_bpf_pull_data(struct osnoise_t= ool *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->hist[i].irq[data->entries] =3D value_irq[i]; data->hist[i].thread[data->entries] =3D value_thread[i]; data->hist[i].user[data->entries] =3D value_user[i]; @@ -300,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -352,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -374,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -402,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -430,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -475,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -622,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶ms->common) { =20 if (!data->hist[cpu].irq_count && !data->hist[cpu].thread_count) continue; @@ -660,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, data->nr_cpus, ¶ms->common) { + for_each_monitored_cpu(cpu, nr_cpus, ¶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 994e89a57cd3..8fad4edb0d72 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -41,7 +41,6 @@ struct timerlat_top_cpu { =20 struct timerlat_top_data { struct timerlat_top_cpu *cpu_data; - int nr_cpus; }; =20 /* @@ -71,8 +70,6 @@ static struct timerlat_top_data *timerlat_alloc_top(void) if (!data) return NULL; =20 - data->nr_cpus =3D nr_cpus; - /* one set of histograms per CPU */ data->cpu_data =3D calloc(1, sizeof(*data->cpu_data) * nr_cpus); if (!data->cpu_data) @@ -190,16 +187,16 @@ static int timerlat_top_bpf_pull_data(struct osnoise_= tool *tool) { struct timerlat_top_data *data =3D tool->data; int i, err; - long long value_irq[data->nr_cpus], - value_thread[data->nr_cpus], - value_user[data->nr_cpus]; + long long value_irq[nr_cpus], + value_thread[nr_cpus], + value_user[nr_cpus]; =20 /* Pull summary */ err =3D timerlat_bpf_get_summary_value(SUMMARY_CURRENT, value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->cpu_data[i].cur_irq =3D value_irq[i]; data->cpu_data[i].cur_thread =3D value_thread[i]; data->cpu_data[i].cur_user =3D value_user[i]; @@ -209,7 +206,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->cpu_data[i].irq_count =3D value_irq[i]; data->cpu_data[i].thread_count =3D value_thread[i]; data->cpu_data[i].user_count =3D value_user[i]; @@ -219,7 +216,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->cpu_data[i].min_irq =3D value_irq[i]; data->cpu_data[i].min_thread =3D value_thread[i]; data->cpu_data[i].min_user =3D value_user[i]; @@ -229,7 +226,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->cpu_data[i].max_irq =3D value_irq[i]; data->cpu_data[i].max_thread =3D value_thread[i]; data->cpu_data[i].max_user =3D value_user[i]; @@ -239,7 +236,7 @@ static int timerlat_top_bpf_pull_data(struct osnoise_to= ol *tool) value_irq, value_thread, value_user); if (err) return err; - for (i =3D 0; i < data->nr_cpus; i++) { + for (i =3D 0; i < nr_cpus; i++) { data->cpu_data[i].sum_irq =3D value_irq[i]; data->cpu_data[i].sum_thread =3D value_thread[i]; data->cpu_data[i].sum_user =3D value_user[i]; --=20 2.53.0