From nobody Fri Dec 19 10:22:39 2025 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 ED039239E81 for ; Sat, 11 Oct 2025 08:28:26 +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=1760171312; cv=none; b=g8JwU2jekqON8zJM2QQGxPPQmV5AbguBxoyMeEgmAs37mI/PAmln2904DYFi81a6gofmTIqJwoF24y5axBYdWmXGCLkSn9LCjLK0//J+++JYx0VUTl8eRLdrbjREthCu1JjPumV+KEKi+dqU7h3lZmgHtM7BBXFe7jp1maW8ARY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760171312; c=relaxed/simple; bh=bK9ZbbRSu/RcSrw1tHd8Ioosrltuz2a83Oe9kALhMi0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RqyFRt1MmodDGKPATsuwV7SMALKn2pGKi+DmPb0QbHDD1DlgIluU4mc6E4JmFvtNpKnhvJs2cxYmOzA1Th3m0XkrPiyZ+kyU6deWO+lEfkMBne5kWv/68UABvFx53sOMx73giDSLOhXI1T7NyCJlqEKvioW5Yp4Hs8grTpQKRCE= 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=FsQSZVV0; 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="FsQSZVV0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760171306; 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=dBAgrUtuAZgF1r3Y0+9jCP35gSNzVvlFmIc27nq44Uk=; b=FsQSZVV08HllJ9V0bq5smicJRwHIpVVRzWo4B4h9k11bDWIc0L3qx6Lr/ghNPgVsqqByOc t92erbgwAO+ecleGQB02bTcVXuBSoayuSJ3LZoK3LD2mPZ+pqtpPas49nbHRSYEFVyD2yS B2kG7Kc2BENEGlKjD1VhH4D80xrTKgM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-GX7HhJG0M4y795EJvzNw7w-1; Sat, 11 Oct 2025 04:28:24 -0400 X-MC-Unique: GX7HhJG0M4y795EJvzNw7w-1 X-Mimecast-MFC-AGG-ID: GX7HhJG0M4y795EJvzNw7w_1760171303 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3ece0fd841cso2291987f8f.0 for ; Sat, 11 Oct 2025 01:28:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760171303; x=1760776103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dBAgrUtuAZgF1r3Y0+9jCP35gSNzVvlFmIc27nq44Uk=; b=rW0MK1lhXLIlp8NFuUMLqapMitry3WkDu3/J9DniW+OiwNOErD043sBhyZf9WG8B15 yHNz/1EjIcV+AvVQyl5HftnK3uGgFpkLwRQpMO1KgvXgzWonC/HVd4H6vAbzk8pGV7Bt 3CVu16CHzEZuMWVwV5wDmjAJVM+O6WskjEVGN+ThdmCXlGIx8hlX14on6FZej+NiQ1eo sVMx9WWBnloNAAQSjLk4Jl61ZiH6gaNFZmBsrwDSXPI/qTOIy7+vPhYhx/i9cKV6mjmt Y9Vqd2Rb5mwD3psOyFix9Y2Gi6OcJB8vPVk3tWsuhZ21RtSSXE8w1SfZyfWd7La4FMv5 7hjA== X-Forwarded-Encrypted: i=1; AJvYcCUivQqO719VKI/pDbW/nl+034tjFmsUtRmeIOFlcyqQPOyfatqmvZ29dLkYF1yyGrCm3K+l0Rr9kNpokmU=@vger.kernel.org X-Gm-Message-State: AOJu0YyQ0qO//mdCe7Mzatvt39DQNjZ+uACJisZyI86bib0SDQwQjoxg 5exCNtTA6ipfR/l105oSDGB0cCZhKdtczYC56oHOuLw9TUmRzqcctwgIQ3gb9SJdgF/HFY+apNO XZpPQ6jyxxTZhJIciwqu0uKT0IypB9oPpMR0/mwqqysPzLXzTNCga1Cep8tVdwVzUMg== X-Gm-Gg: ASbGnctmSg/jSRZ9QKybmC71D+zrL5A7N3F06Az6C0vsOjs0rxItuInM/FprBd9Y0Na jYrpXY/amo8A/ecd5c61uULXB3gbtc6b88sStJ6zPcXU05OV7U07ftMp5bGeSvviuX+oBtB7h5v L4IoVUg+uiDLQqqOj1HtJjP+8FvuP4pGPiAPpQIC/4eO/EnXdTdrkvFuynW78YNcrM1RE7zSZlZ ycCuN25n5zrxe/6i3Y/Se5DK5imlPDmFBrWublFjZRnjJjxlQGQVO9mw+zsagr0TK2Ezp5IuT9T eIOExe+rSKz3X1agxLC8ZJR8MM9bC4fF3GNQ21OesXBk X-Received: by 2002:a05:6000:659:10b0:426:d82f:889e with SMTP id ffacd0b85a97d-426d82f88cbmr276600f8f.14.1760171303106; Sat, 11 Oct 2025 01:28:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrOrLxL1eNdz8ZKW238q93rZX5VW6RjLN0F6KEdjI7rPURwhL8djYrNs8pRcGaxQcWksUQkg== X-Received: by 2002:a05:6000:659:10b0:426:d82f:889e with SMTP id ffacd0b85a97d-426d82f88cbmr276582f8f.14.1760171302720; Sat, 11 Oct 2025 01:28:22 -0700 (PDT) Received: from localhost ([2a00:a041:e2eb:5500:8728:d68a:a687:c89b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-426ce5d0006sm8022580f8f.34.2025.10.11.01.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Oct 2025 01:28:22 -0700 (PDT) From: Costa Shulyupin To: Steven Rostedt , Tomas Glozar , Costa Shulyupin , Crystal Wood , John Kacur , Tiezhu Yang , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] tools/rtla: Replace timerlat_top_usage("...") with fatal("...") Date: Sat, 11 Oct 2025 11:27:35 +0300 Message-ID: <20251011082738.173670-3-costa.shul@redhat.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251011082738.173670-1-costa.shul@redhat.com> References: <20251011082738.173670-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" A long time ago, when the usage help was short, it was a favor to the user to show it on error. Now that the usage help has become very long, it is too noisy to dump the complete help text for each typo after the error message itself. Replace timerlat_top_usage("...\n") with fatal("...") on errors. Remove the already unused 'usage' argument from timerlat_top_usage(). Signed-off-by: Costa Shulyupin --- Changes since v1: - fatal() prints "\n" insteasd of caller as suggested by Crystal Wood --- tools/tracing/rtla/src/timerlat_top.c | 28 +++++++++++---------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index d8e60f823b25..27b64bdc5b18 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -476,7 +476,7 @@ timerlat_print_stats(struct osnoise_tool *top) /* * timerlat_top_usage - prints timerlat top usage message */ -static void timerlat_top_usage(char *usage) +static void timerlat_top_usage(void) { int i; =20 @@ -524,18 +524,12 @@ static void timerlat_top_usage(char *usage) NULL, }; =20 - if (usage) - fprintf(stderr, "%s\n", usage); - fprintf(stderr, "rtla timerlat top: a per-cpu summary of the timer latenc= y (version %s)\n", VERSION); =20 for (i =3D 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); =20 - if (usage) - exit(EXIT_FAILURE); - exit(EXIT_SUCCESS); } =20 @@ -648,7 +642,7 @@ static struct common_params case 'c': retval =3D parse_cpu_set(optarg, ¶ms->common.monitored_cpus); if (retval) - timerlat_top_usage("\nInvalid -c cpu list\n"); + fatal("Invalid -c cpu list"); params->common.cpus =3D optarg; break; case 'C': @@ -667,7 +661,7 @@ static struct common_params case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) - timerlat_top_usage("Invalid -d duration\n"); + fatal("Invalid -d duration"); break; case 'e': tevent =3D trace_event_alloc(optarg); @@ -680,7 +674,7 @@ static struct common_params break; case 'h': case '?': - timerlat_top_usage(NULL); + timerlat_top_usage(); break; case 'H': params->common.hk_cpus =3D 1; @@ -700,12 +694,12 @@ static struct common_params case 'p': params->timerlat_period_us =3D get_llong_from_str(optarg); if (params->timerlat_period_us > 1000000) - timerlat_top_usage("Period longer than 1 s\n"); + fatal("Period longer than 1 s"); break; case 'P': retval =3D parse_prio(optarg, ¶ms->common.sched_param); if (retval =3D=3D -1) - timerlat_top_usage("Invalid -P priority"); + fatal("Invalid -P priority"); params->common.set_sched =3D 1; break; case 'q': @@ -740,7 +734,7 @@ static struct common_params if (retval) fatal("Error adding trigger %s", optarg); } else { - timerlat_top_usage("--trigger requires a previous -e\n"); + fatal("--trigger requires a previous -e"); } break; case '1': /* filter */ @@ -749,7 +743,7 @@ static struct common_params if (retval) fatal("Error adding filter %s", optarg); } else { - timerlat_top_usage("--filter requires a previous -e\n"); + fatal("--filter requires a previous -e"); } break; case '2': /* dma-latency */ @@ -785,7 +779,7 @@ static struct common_params fatal("Invalid action %s", optarg); break; default: - timerlat_top_usage("Invalid option"); + fatal("Invalid option"); } } =20 @@ -802,10 +796,10 @@ static struct common_params params->no_aa =3D 1; =20 if (params->no_aa && params->common.aa_only) - timerlat_top_usage("--no-aa and --aa-only are mutually exclusive!"); + fatal("--no-aa and --aa-only are mutually exclusive!"); =20 if (params->common.kernel_workload && params->common.user_workload) - timerlat_top_usage("--kernel-threads and --user-threads are mutually exc= lusive!"); + fatal("--kernel-threads and --user-threads are mutually exclusive!"); =20 /* * If auto-analysis or trace output is enabled, switch from BPF mode to --=20 2.51.0