From nobody Sun Feb 8 18:48:32 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 B28013BC4C9 for ; Thu, 15 Jan 2026 17:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498128; cv=none; b=BC3f4QGOfbbBe+4rntEFNxizrP7RaXF71tN8GcIuIgPbSUf+MQh8LxpuL/Py0769njQ68YdTfPzwBJjzcCj6C0a9Vt7cydDWz7iTOeqrRArbBVp/+cbYKj+uraMx8akDeCHDQL9bo6R8Ebfu1VLJElq6wlIC5SsgQ7ngMTJJMlI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768498128; c=relaxed/simple; bh=M6q+1YKSMR2qj9nmEYe1yRlHW29HrcG/JoUGyEha3OM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aA+fw8GgbKUoJfxoizMN2eLWpLqkC34zAtkPp2XuHknnWZyPV0aXnMlT7diVO1zhZIEbxySvF5Iq34jVk64sb6gMCmINQNeqIXQfRUixGbplTq91H2xKf5aDwObJXxyMhQAf95uqB3qjooaOTjEIZ/O0jqcjuhTnhXJ9fEOpKhM= 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=RHq+SjOg; arc=none smtp.client-ip=170.10.133.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="RHq+SjOg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498125; 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=oCDIg29v0GPRUT83B438eXBl9CQINW2Seue9qN0fCYg=; b=RHq+SjOgVskT/fW8PdIisLGm0CxYCB+ocr0HrFf5LXsCjB20Hfm/umxFyIlOJpzWj9q5Tg c3PJXkdUo99P0k5AY7UjDmdg8gYjqi8On9fvMeymke7ZQZuXx57ZLeL+5CadnhBjEyJMKD LVDNOFTBJxCYI//f94p9gzFRW6xv6Os= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-7JG8i3brMzebvukj_r-L8A-1; Thu, 15 Jan 2026 12:28:41 -0500 X-MC-Unique: 7JG8i3brMzebvukj_r-L8A-1 X-Mimecast-MFC-AGG-ID: 7JG8i3brMzebvukj_r-L8A_1768498120 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2A66B195609D; Thu, 15 Jan 2026 17:28:40 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.64.87]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9CFFD1800285; Thu, 15 Jan 2026 17:28:35 +0000 (UTC) From: Wander Lairson Costa To: Steven Rostedt , Tomas Glozar , Wander Lairson Costa , Ivan Pravdin , Crystal Wood , Costa Shulyupin , John Kacur , Tiezhu Yang , Daniel Wagner , Daniel Bristot de Oliveira , linux-trace-kernel@vger.kernel.org (open list:Real-time Linux Analysis (RTLA) tools), linux-kernel@vger.kernel.org (open list:Real-time Linux Analysis (RTLA) tools), bpf@vger.kernel.org (open list:BPF [MISC]:Keyword:(?:\b|_)bpf(?:\b|_)) Subject: [PATCH v3 13/18] rtla: Use str_has_prefix() for option prefix check Date: Thu, 15 Jan 2026 13:31:56 -0300 Message-ID: <20260115163650.118910-14-wander@redhat.com> In-Reply-To: <20260115163650.118910-1-wander@redhat.com> References: <20260115163650.118910-1-wander@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 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Content-Type: text/plain; charset="utf-8" The argument parsing code in timerlat_main() and osnoise_main() uses strncmp() with a length of 1 to check if the first argument starts with a dash, indicating an option flag was passed. Replace this pattern with str_has_prefix() for consistency with the rest of the codebase. While character comparison would be slightly more efficient, using str_has_prefix() provides better readability and maintains a uniform coding style throughout the rtla tool. Signed-off-by: Wander Lairson Costa --- tools/tracing/rtla/src/osnoise.c | 2 +- tools/tracing/rtla/src/timerlat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osno= ise.c index 4890a9a9d6466..5b342d945c5f6 100644 --- a/tools/tracing/rtla/src/osnoise.c +++ b/tools/tracing/rtla/src/osnoise.c @@ -1210,7 +1210,7 @@ int osnoise_main(int argc, char *argv[]) =20 if ((strcmp(argv[1], "-h") =3D=3D 0) || (strcmp(argv[1], "--help") =3D=3D= 0)) { osnoise_usage(0); - } else if (strncmp(argv[1], "-", 1) =3D=3D 0) { + } else if (str_has_prefix(argv[1], "-")) { /* the user skipped the tool, call the default one */ run_tool(&osnoise_top_ops, argc, argv); exit(0); diff --git a/tools/tracing/rtla/src/timerlat.c b/tools/tracing/rtla/src/tim= erlat.c index 8f8811f7a13bd..84577daadd668 100644 --- a/tools/tracing/rtla/src/timerlat.c +++ b/tools/tracing/rtla/src/timerlat.c @@ -272,7 +272,7 @@ int timerlat_main(int argc, char *argv[]) =20 if ((strcmp(argv[1], "-h") =3D=3D 0) || (strcmp(argv[1], "--help") =3D=3D= 0)) { timerlat_usage(0); - } else if (strncmp(argv[1], "-", 1) =3D=3D 0) { + } else if (str_has_prefix(argv[1], "-")) { /* the user skipped the tool, call the default one */ run_tool(&timerlat_top_ops, argc, argv); exit(0); --=20 2.52.0