From nobody Tue Dec 2 01:25:49 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 27AAA350A09 for ; Fri, 21 Nov 2025 17:45:44 +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=1763747146; cv=none; b=NZy0PV740rHDVGV7QyR260b/4V9ZhcFIdWe3JkEXzXpnS4Fj5CkIV/M1hYKG7TqI6O8Vf5W2NUpKGlcQlZkNUvUA4INwpCV231FIG4lemwXAyVwaDkfb+Ub4sXy8mmx4c6urgtz05mQo8q1TwjVi+ceAp8TZAp0eJfaynUGv9fE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763747146; c=relaxed/simple; bh=jI07AZA+TX7XdamDHqd4AYGgXdXJ9w/eJer63SI/Klc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KmPQNxNTArvcOCIDM/9hRKdFCoq2jp6ZKPy5qbCEQ5sYtwIsPEt1wtY9g5/Qnt4nWQKuPeL25m8GbBSyxgf/m8Or8DtTi/ihCZTOZkXE8w6ybQ93CnW7ZwZmE9cas62xoGEApqrnw02AB+DmpPM9IRRXwAChmfdMj5aTteyqvEQ= 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=Ktkup1hn; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=DxWrn98s; 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="Ktkup1hn"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="DxWrn98s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763747144; 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=g4vTg2SXn5ikmleP2ulGHJRIjy4fI9F/oORLv9vFsuE=; b=Ktkup1hncEIA08Y/o/oZW7dktFT63lZRcpLLQ/BbZe0qWSxafadxqTq8lqGOzU0v/WVwm+ B3FRPCOGxAxu991tSeXNtuDgdnv8VWL1jH+L/Bw64Su+mIKzMW2Nnhueasg1UlmsKuZpK+ nRzcgF/+3/h4MXLj+xUD3/kvERdbPw8= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-rY-omsCtPHCIz3J3ZzpOug-1; Fri, 21 Nov 2025 12:45:42 -0500 X-MC-Unique: rY-omsCtPHCIz3J3ZzpOug-1 X-Mimecast-MFC-AGG-ID: rY-omsCtPHCIz3J3ZzpOug_1763747141 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-429cbed2b8fso1207878f8f.1 for ; Fri, 21 Nov 2025 09:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1763747141; x=1764351941; 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=g4vTg2SXn5ikmleP2ulGHJRIjy4fI9F/oORLv9vFsuE=; b=DxWrn98sZuuJjqzu7vu2pO1UtqHYAlD0mHv1rxj6H9QVxe2M1xglggTuZ4HIqEsoj2 HLOTU5r07PGHnPTqN5TEJnlKRGLvogAhd3OSJ/nJdw1Nq2dp8Y2pjIJDLm4IabJjDjX4 hoeN9FhamzShvgrc0KtBr/5j1IA0/3jMuu9JtMeM6JpHHVLKG9igWFv1OjLm5oIl0LRO gDwQDwSiJYP5cCXZf6wL88N3GEZaKzJ51n2WYLhDK2+Vgwh7cYIvYCYHKjpSz0+t0IIi CgivBEN+6gmdyxbYyPuYL4s9/qYPsxp0kU3GfPp8sgk/fclR51ENlZOiHs3SfzOwDdES 2x6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763747141; x=1764351941; 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=g4vTg2SXn5ikmleP2ulGHJRIjy4fI9F/oORLv9vFsuE=; b=MlmufXnwXg7FMsk0g/1af9x62fnbnVTrPnIJptFwcHKPlnhi+RtNWJgJvYyeKm2Jc7 8JDaCPxFWkNeBAN8a26LZ77zZGPig6uwFYAer0M2RUfgqGBAoM/jsjlDLuU8wuTN1eUf HsKgYcpGsCMOybghO6j21hx9LYu1Esf3UjKaI8vaqR51WAKVkci39BA1PDc95YjoDl7Z mFyN0IEeqZ6WM8rygX00m3tvA/Ced+axZv3iKPXtPcgQHju14rmdHg/bpRG1YZVSYf25 x9Kia32OMTcIZy2NgEKTNOk8iFKzhuXxnWbNnCV4cW/3qO8jCkwHTAEL2s5bXrgDG8VD Oh+A== X-Forwarded-Encrypted: i=1; AJvYcCVCkM9rVIPsNoIzbOFvSe2xANFAJa0VdwFGDdpaiapjQVfSUJiak8XAfa2eWVHzfzshz5aycqZ3MutSA7I=@vger.kernel.org X-Gm-Message-State: AOJu0YzKM4b108z1GqY9jKbuORMyKC6Q79oQtbKRaKCqmd1OpzrtxeVO aOrokkIths5xnPVYBt1Bq93shfKrqm6/mQjmESuerpmYSIzxg7wt+oq+Ik2wj2a4zuSy3RLi/VN puhwaLafhkgmQwrocgUzcCL3U/O8O8VLYAneQTJKHDVOMvow2YpT4RlIQmrudVByStQ== X-Gm-Gg: ASbGncvaAAvjLu6BEjnEVXZqgjUlDStHtYBt4R4u1r6CLOtPRRHVYnL3R+I85NHF+8f v4gyhIUleaC3biDExZvBxx+1dulnFKpgFY9BO4gBpafIO82F2ZGBcI37g8H4XKm29gvUjWfm8WG EdUj+h3QnuMdwyIl4nYEd91dV4EUTwnS/oUHceWQjmSPMRTmAuQ1UhnGaQ+KehuaOZzQQrVULSO Z9qtucWY+Z81HsMbvG+LRzylfL1ytTuI14yHXcUUhpBuo8n4be3+HUDTYk2ZZSxCDm+SAWjJOMO +oBV2USOxgbSaFCx6S/dNtsgMwBs8YAkdjwQ0PUpBBCBk47Kb2RwlnZI0T+1l3FCjvXTmd0ioGF pYfzpMWtCmWDisUEFIxKOxVyg X-Received: by 2002:a5d:5850:0:b0:429:c709:7b54 with SMTP id ffacd0b85a97d-42cc1cf3c0bmr3187026f8f.36.1763747141413; Fri, 21 Nov 2025 09:45:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMogGSpPJax38iHwqevfbwGGHtpcSZqT2Cj7PBh9pXn6LQfxQmFEKu2ydXxpCDILAnwUBkIg== X-Received: by 2002:a5d:5850:0:b0:429:c709:7b54 with SMTP id ffacd0b85a97d-42cc1cf3c0bmr3186997f8f.36.1763747140921; Fri, 21 Nov 2025 09:45:40 -0800 (PST) Received: from costa-tp.bos2.lab ([2a00:a041:e294:5000:b694:8e49:4f51:966d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7ec454csm11529567f8f.0.2025.11.21.09.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 09:45:40 -0800 (PST) From: Costa Shulyupin To: Steven Rostedt , Tomas Glozar , Costa Shulyupin , Crystal Wood , Wander Lairson Costa , Ivan Pravdin , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 4/8] tools/rtla: Consolidate -D/--debug option parsing Date: Fri, 21 Nov 2025 19:45:00 +0200 Message-ID: <20251121174504.519230-5-costa.shul@redhat.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251121174504.519230-1-costa.shul@redhat.com> References: <20251121174504.519230-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" Each rtla tool duplicates parsing of -D/--debug. Migrate the option parsing from individual tools to the common_parse_options(). Signed-off-by: Costa Shulyupin --- tools/tracing/rtla/src/common.c | 6 +++++- tools/tracing/rtla/src/osnoise_hist.c | 6 +----- tools/tracing/rtla/src/osnoise_top.c | 6 +----- tools/tracing/rtla/src/timerlat_hist.c | 6 +----- tools/tracing/rtla/src/timerlat_top.c | 6 +----- 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/tools/tracing/rtla/src/common.c b/tools/tracing/rtla/src/commo= n.c index 92fb2973c373..4d752e438e89 100644 --- a/tools/tracing/rtla/src/common.c +++ b/tools/tracing/rtla/src/common.c @@ -58,11 +58,12 @@ int common_parse_options(int argc, char **argv, struct = common_params *common) static struct option long_options[] =3D { {"cpus", required_argument, 0, 'c'}, {"cgroup", optional_argument, 0, 'C'}, + {"debug", no_argument, 0, 'D'}, {0, 0, 0, 0} }; =20 opterr =3D 0; - c =3D getopt_long(argc, argv, "c:C::", long_options, NULL); + c =3D getopt_long(argc, argv, "c:C::D", long_options, NULL); =20 switch (c) { case 'c': @@ -74,6 +75,9 @@ int common_parse_options(int argc, char **argv, struct co= mmon_params *common) common->cgroup =3D 1; common->cgroup_name =3D parse_optional_arg(argc, argv); break; + case 'D': + config_debug =3D 1; + break; default: optind =3D saved_state; return 0; diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index 5cbe5e1f1b07..6902486fb144 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -491,7 +491,6 @@ static struct common_params {"auto", required_argument, 0, 'a'}, {"bucket-size", required_argument, 0, 'b'}, {"entries", required_argument, 0, 'E'}, - {"debug", no_argument, 0, 'D'}, {"duration", required_argument, 0, 'd'}, {"house-keeping", required_argument, 0, 'H'}, {"help", no_argument, 0, 'h'}, @@ -519,7 +518,7 @@ static struct common_params if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:b:d:e:E:DhH:p:P:r:s:S:t::T:01234:5:6:7:= ", + c =3D getopt_long(argc, argv, "a:b:d:e:E:hH:p:P:r:s:S:t::T:01234:5:6:7:", long_options, NULL); =20 /* detect the end of the options. */ @@ -545,9 +544,6 @@ static struct common_params params->common.hist.bucket_size >=3D 1000000) fatal("Bucket size needs to be > 0 and <=3D 1000000"); break; - case 'D': - config_debug =3D 1; - break; case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index 35db5b73c0d7..4a61fd50b990 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -346,7 +346,6 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) while (1) { static struct option long_options[] =3D { {"auto", required_argument, 0, 'a'}, - {"debug", no_argument, 0, 'D'}, {"duration", required_argument, 0, 'd'}, {"event", required_argument, 0, 'e'}, {"house-keeping", required_argument, 0, 'H'}, @@ -371,7 +370,7 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:d:De:hH:p:P:qr:s:S:t::T:0:1:2:3:", + c =3D getopt_long(argc, argv, "a:d:e:hH:p:P:qr:s:S:t::T:0:1:2:3:", long_options, NULL); =20 /* Detect the end of the options. */ @@ -390,9 +389,6 @@ struct common_params *osnoise_top_parse_args(int argc, = char **argv) if (!trace_output) trace_output =3D "osnoise_trace.txt"; =20 - break; - case 'D': - config_debug =3D 1; break; case 'd': params->common.duration =3D parse_seconds_duration(optarg); diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index 9ecab2bb0f1e..97d20e272583 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -797,7 +797,6 @@ static struct common_params static struct option long_options[] =3D { {"auto", required_argument, 0, 'a'}, {"bucket-size", required_argument, 0, 'b'}, - {"debug", no_argument, 0, 'D'}, {"entries", required_argument, 0, 'E'}, {"duration", required_argument, 0, 'd'}, {"house-keeping", required_argument, 0, 'H'}, @@ -835,7 +834,7 @@ static struct common_params if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:b:d:e:E:DhH:i:knp:P:s:t::T:uU0123456:7:= 8:9\1\2:\3:", + c =3D getopt_long(argc, argv, "a:b:d:e:E:hH:i:knp:P:s:t::T:uU0123456:7:8= :9\1\2:\3:", long_options, NULL); =20 /* detect the end of the options. */ @@ -864,9 +863,6 @@ static struct common_params params->common.hist.bucket_size >=3D 1000000) fatal("Bucket size needs to be > 0 and <=3D 1000000"); break; - case 'D': - config_debug =3D 1; - break; case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 6329c3a489aa..96bca67d419f 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -566,7 +566,6 @@ static struct common_params while (1) { static struct option long_options[] =3D { {"auto", required_argument, 0, 'a'}, - {"debug", no_argument, 0, 'D'}, {"duration", required_argument, 0, 'd'}, {"event", required_argument, 0, 'e'}, {"help", no_argument, 0, 'h'}, @@ -599,7 +598,7 @@ static struct common_params if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:d:De:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7= :", + c =3D getopt_long(argc, argv, "a:d:e:hH:i:knp:P:qs:t::T:uU0:1:2:345:6:7:= ", long_options, NULL); =20 /* detect the end of the options. */ @@ -636,9 +635,6 @@ static struct common_params /* set aa_only to avoid parsing the trace */ params->common.aa_only =3D 1; break; - case 'D': - config_debug =3D 1; - break; case 'd': params->common.duration =3D parse_seconds_duration(optarg); if (!params->common.duration) --=20 2.51.1