Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp463037lqd; Wed, 24 Apr 2024 07:37:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQx7UVgzHmubs6ftZlwpil9/i7Oq1ztXZ6l0T0GqQH5mzMBrDVhs7s6kAl2HJoT1gBzWLOwkhRgr7I2F+PpzsF3jCOwCSV+iV65rHAnw== X-Google-Smtp-Source: AGHT+IGkI4Ct+3EJVwvyj/nQJn6n6rrph/+2kJQuEUR6ZscVX1Pq0nPabUG/UYEF7z5LgAmCOVcM X-Received: by 2002:ad4:510e:0:b0:6a0:8987:f68 with SMTP id g14-20020ad4510e000000b006a089870f68mr2673774qvp.1.1713969463930; Wed, 24 Apr 2024 07:37:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713969463; cv=pass; d=google.com; s=arc-20160816; b=qYLSZZFudwJ9VoogexppyaeRONdW8tzOM7KSV36WjEhQIOxhRH8tvfRyJLVvbsts5n hFaPwKc0eASZEEJ3Z0wBcVTDXjdvaRi+ZUSr7y3tdNSxXYcTJ87FiaFeo+cusFfMTX/F IpIfPkevExDmkKAULqhzSaCTxJwIyd+HyKN3zqhiWpk1G50Xk0nCSb/ZOxuNn9h0xwLG K/VvEDqOCRDR59tsAxS1De+odiCzNsYYW9PRGSRWAYPd1RJXTvDT2r4Okcu57w7kkvc/ pJo3xFToIaYIjKWPFRTB/E/WpxzQqOLsMKon6MwlQGXtRsku1SRRNTQa1z0tUwcxesMN SYDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BCCf90W+3ts9imV85Nh8WfDfzmZSzzSpZ6TZ9hIuZ0I=; fh=d5RFz15nBddd1skH/Z+aIfcoQe3Q1s757EkE2e2d5qY=; b=cPvW/xvcRi90CqfAhUrezyyezyuXQBJQFkLZjnBctoYcsrKy0FTAQZbh1DoPb6LX/x 7+UhY5pOeDRMZ820Q6GWsjJk4VTg6V+WRdMSjqyNVqbX4jvVCDfWbpzswVHZF5xE3Tij usWz2yFsO8blRRB/1LN5ezV4cUzJYu5VceLMh4iLuioZf/Arv7nyD9eiRTR2cNr77H/2 Yf0bp5w9tbi8IDzswFm35Jo/KdUDmh6+V8W9C9scN+OD9+dQM0LHvHDqOWaohLlqnB+J 3oeC/VfayCFvK4CIc1EZu6YIdeIt/UR2z6OOy9/cwq/Pz2i9j8AR8NTTA5HwTEvkTYfm /Alw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h+F1XyJn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157088-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j10-20020a05621419ca00b006a0873eed9fsi5535804qvc.480.2024.04.24.07.37.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 07:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157088-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h+F1XyJn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157088-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 45A171C242E0 for ; Wed, 24 Apr 2024 14:37:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA05015EFB4; Wed, 24 Apr 2024 14:37:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h+F1XyJn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D19B215ECF3; Wed, 24 Apr 2024 14:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713969427; cv=none; b=oBg/GNpqGpzv4Ec5kMZB65KFWIKTl5krfQJA2sX8zoAy2ly35S0w2hokKgdopU+QRdaH7fX4oj38fLVmscernjJINDrA9/8m5io1/T69omzUKscsvwL73i1W41Pajn7TAX3+E8m1uvbfo7SfDVdErTL/PWwFkErhT4hCvjdPhqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713969427; c=relaxed/simple; bh=k6zY+8OIqG3hvgbnxVfHVa3Ek+C1GSXe4a2L4RdgdEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I4p/RcWZ1zCAN8/6K8+1ZXT88uax8P6zRTd8D19oH7cVci5oo0B60WzLqC8ppr1Jd0SEqbiDldnn7IJNhaHs+UMXFAb2SJv5Bdsgd8Ssvb/7Dn8W3hT+e6AFutJbXkDKji97u1mg1ZRX2UnFcjsYxXiaBFNPxqq+JmiOi+21sn0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h+F1XyJn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C08FC113CD; Wed, 24 Apr 2024 14:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713969427; bh=k6zY+8OIqG3hvgbnxVfHVa3Ek+C1GSXe4a2L4RdgdEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h+F1XyJnBAnkc7gMGRYlCJFwpBgbkGE0SW36ugHTAwN/bG8lgwRhTmdfnTGyVdupS THlpUvl3MZVQJ0vnc+mjzkKT30t9vfj7vc3mHA7GZV4cLlGSBA5Nlk0lCGuzPynoMA lc28IawaXFrOl9rm1vOA68HUUEW4d2+F3FHLIGKiK6uLigTWvPvWiHnaw5pP0yHAoP IWPua28+RGj6IvY1W8UZ4sqzpofBmorsbPcnvYEkp+6W0C9FD4OuSkXbxRS/Qls8Px yhePsHLxoB30PP2WZJ2P7yhKuGejQZtyClOMmSbU3Lz6apmPfQ7fas5wNw0ZIuOSXH tC7Tv0Ju+AQqQ== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt , linux-trace-kernel@vger.kernel.org Cc: Jonathan Corbet , Juri Lelli , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/8] rtla/timerlat: Simplify "no value" printing on top Date: Wed, 24 Apr 2024 16:36:50 +0200 Message-ID: <0a4d8085e7cd706733a5dc10a81ca38b82bd4992.1713968967.git.bristot@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Instead of printing three times the same output, print it only once, reducing lines and being sure that all no values have the same length. It also fixes an extra '\n' when running the with kernel threads, like here: =============== %< ============== Timer Latency 0 00:00:01 | IRQ Timer Latency (us) | Thread Timer Latency (us) CPU COUNT | cur min avg max | cur min avg max 2 #0 | - - - - | 161 161 161 161 3 #0 | - - - - | 161 161 161 161 8 #1 | 54 54 54 54 | - - - -'\n' ---------------|----------------------------------------|--------------------------------------- ALL #1 e0 | 54 54 54 | 161 161 161 =============== %< ============== This '\n' should have been removed with the user-space support that added another '\n' if not running with kernel threads. Cc: stable@vger.kernel.org Fixes: cdca4f4e5e8e ("rtla/timerlat_top: Add timerlat user-space support") Signed-off-by: Daniel Bristot de Oliveira --- tools/tracing/rtla/src/timerlat_top.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c index 8a3fa64319c6..2665e0bb5f1e 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -212,6 +212,8 @@ static void timerlat_top_header(struct osnoise_tool *top) trace_seq_printf(s, "\n"); } +static const char *no_value = " -"; + /* * timerlat_top_print - prints the output of a given CPU */ @@ -239,10 +241,7 @@ static void timerlat_top_print(struct osnoise_tool *top, int cpu) trace_seq_printf(s, "%3d #%-9d |", cpu, cpu_data->irq_count); if (!cpu_data->irq_count) { - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - |"); + trace_seq_printf(s, "%s %s %s %s |", no_value, no_value, no_value, no_value); } else { trace_seq_printf(s, "%9llu ", cpu_data->cur_irq / params->output_divisor); trace_seq_printf(s, "%9llu ", cpu_data->min_irq / params->output_divisor); @@ -251,10 +250,7 @@ static void timerlat_top_print(struct osnoise_tool *top, int cpu) } if (!cpu_data->thread_count) { - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - "); - trace_seq_printf(s, " -\n"); + trace_seq_printf(s, "%s %s %s %s", no_value, no_value, no_value, no_value); } else { trace_seq_printf(s, "%9llu ", cpu_data->cur_thread / divisor); trace_seq_printf(s, "%9llu ", cpu_data->min_thread / divisor); @@ -271,10 +267,7 @@ static void timerlat_top_print(struct osnoise_tool *top, int cpu) trace_seq_printf(s, " |"); if (!cpu_data->user_count) { - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - "); - trace_seq_printf(s, " - "); - trace_seq_printf(s, " -\n"); + trace_seq_printf(s, "%s %s %s %s\n", no_value, no_value, no_value, no_value); } else { trace_seq_printf(s, "%9llu ", cpu_data->cur_user / divisor); trace_seq_printf(s, "%9llu ", cpu_data->min_user / divisor); -- 2.44.0