From nobody Tue Dec 2 01:25:10 2025 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 29F60351FC9 for ; Fri, 21 Nov 2025 17:45:55 +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=1763747157; cv=none; b=NBnRpp/VaOERxSloQMhD/mX4Zrd8CuacThtzHZ5s+NVyHrndPMnMf7qQuqbgnbr3HNKnLCdDPAq8AbhtFUdGwHydUkPjSmWOGcwwTotR0zSc9FXuD5EyLZBta0U4OLllY5Ch/lx4H844YPYMojXhS72rewnXOfpOQCBYQeEBSMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763747157; c=relaxed/simple; bh=D1AdlKWho2by+4CzgvcoFl74FcN82SAXeg9cfxfzFB8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q33x7ZaskFUqpfQQCe5btUowX4zLCCqFo74enK3VfvVVbHuYcP1jbVsMTyHawFFNTppOfkUsP+kEbUjJT/0ceLbD9yP3NBBeih/6sjGpSLaVHqqNVkWhSSiAiK/jJ7A61rGR81/lftaA3DLylm1IGnrIVXteTy5gow+w0d8A7j4= 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=CAUqpo6g; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Y6I//ppT; 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="CAUqpo6g"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y6I//ppT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763747155; 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=4isV2YzTCHizoKjzYDGn0aeaubcmK1LCw5702FwMQNE=; b=CAUqpo6gfmoqODMxXvcNDnUwyQeIcNfC4QNiP24BQQvTjZ3+SivndEIIObXdvms5dO4Pdo l7YMNfjNpVPoVLcL+uzMlyn+BzklkI6WA2VkwciapDjWf14yIJee9etVWJXRtZqkSR4GjH YIzIaJfOIoJyYlr8c43Af6mTDX+FVO4= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-52-yAn0C-mCNvyDLwvGV_u5yQ-1; Fri, 21 Nov 2025 12:45:53 -0500 X-MC-Unique: yAn0C-mCNvyDLwvGV_u5yQ-1 X-Mimecast-MFC-AGG-ID: yAn0C-mCNvyDLwvGV_u5yQ_1763747152 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-40cfb98eddbso1675138f8f.0 for ; Fri, 21 Nov 2025 09:45:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1763747152; x=1764351952; 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=4isV2YzTCHizoKjzYDGn0aeaubcmK1LCw5702FwMQNE=; b=Y6I//ppT5rCKr8SoensmGdmkhETA2wsNwUs3bmVk1eE6GMUvzmrI/K5mNfUSywREbG rFyzi26mYXYLzZmuxPqRKYPsqzqbQEROvf9CyoxNNTYLOZxCXeQmOte8Wa5Z73hRFNFT k/xAUg9d5Se+PkulYGobGUQvywF7l1FgeBTVDpyOuXiTOL6zVhq0Gl+KJG//VBcTMMyU Gwp5RGMncRBHnQ8IDjmVwFh7U85MvYXiGS7IhFj7PVpRv3sRylXJaeb5kYRaxvZUSyju 48mKhDo1qQVIQPoLK6J39I2AO6Qkura6OVp+xVQmgYE8sJ5o5XqzYJDDQcRh/jOBjFm+ ESow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763747152; x=1764351952; 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=4isV2YzTCHizoKjzYDGn0aeaubcmK1LCw5702FwMQNE=; b=Mm8llK1C4dewRzzU8gjZlkxhhN2CBfWW91CISbZKWkezu8uUMvzoF8pBLV8QvuUXjd qMXI/ue7zcUvSaku4928l1NMHZ8I5+kkinjWDTu/RGIhPN9eb6ZycDnNeMi/AUOqv8nb VIF9JFuHBlEqKx0Z6R4XC7QoAkPZrJ37z3HdWT7Z9+JwXhKLTpArQ4uCsSmkeeiuca4D MZgHXlTa2DzbZvNPDYzSH6YOxJICTW103UPJ8L/EAkLQIl0xniMUOj0KW4RDBMg4EvCG GnjIkkkb6MEDXCEgAe+g8xSp3Kwl76x+1BaRExQRDzVXGWXHDbIFz5hf8K/2DTT7xHFv 8ObA== X-Forwarded-Encrypted: i=1; AJvYcCX29npWS1Xi/niuXnpp/V0uK9KkQlB0Ln+yA9ZYZJFqvI6xQ2c2XkjsJLpmRsCaxxibwpvsSCVNQG73ahE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0NoEE3ivba9Z387ee1bKyG4O44mH8bod/FQW6IWSSPGozkbn8 FHzl2e3lsCra2RtHP7Fom0wCUfejSgyr6hhJUyIBTM0r/JmBBdsRPAY6QXomxkxc54kN2Wb7WW3 2JnuGQMf7FETYRWW+/PPNrQ8eeR6y4tQ1Tu7IjsCIIYLIMPsUFiP7HkpkU98lwbGidw== X-Gm-Gg: ASbGncsYRzLQ7xpEVGJJKwlCGQBOlsn/8AXDZpu6ja08ZwXb0CGC7T4laETCGvROkBp GRJmlRIivo1T7qLTkThW41/n0QPbs4p2Jmo1M8ALeW7lBIVzt3ReElyO8qBvR1Ssq9vV2y4ikIU w4R5U5teKJL+07P7NNpyKdH1UcUhvdoim/Prnf8VcLaQVL+Wz9+l+R4yD2vD0hWTtwXHlbMZDa/ eWcyP1ggsUjasNOcRvZrYHeT4Zv1ljdCFWegblsnAekg1qdVePtNlgXs6b4jvreFRS7WT+3wrjD s/f/PfUB2Z6GoJMPJdTropUbiPlZzXrCZPzb4bfmX0EqA6wy0bZFb9AVTIekkG5Obz60jSvl3vo 038D1EU0yv7HkP4tZYEl8z8CV X-Received: by 2002:a5d:5f54:0:b0:42b:3108:5671 with SMTP id ffacd0b85a97d-42cba7c4d96mr8095366f8f.29.1763747151992; Fri, 21 Nov 2025 09:45:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEM8NKpwRcn40VnEReWwYMQNvRZKJQwoTcUDLfVIQM9E7znbRvegTyP8bUUSuZwUOgLpRPQYw== X-Received: by 2002:a5d:5f54:0:b0:42b:3108:5671 with SMTP id ffacd0b85a97d-42cba7c4d96mr8095340f8f.29.1763747151498; Fri, 21 Nov 2025 09:45:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 09:45:51 -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 8/8] tools/rtla: Consolidate -H/--house-keeping option parsing Date: Fri, 21 Nov 2025 19:45:04 +0200 Message-ID: <20251121174504.519230-9-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 -H/--house-keeping. Migrate the option parsing from individual tools to the common_parse_options(). Signed-off-by: Costa Shulyupin --- tools/tracing/rtla/src/common.c | 8 +++++++- tools/tracing/rtla/src/osnoise_hist.c | 9 +-------- tools/tracing/rtla/src/osnoise_top.c | 9 +-------- tools/tracing/rtla/src/timerlat_hist.c | 9 +-------- tools/tracing/rtla/src/timerlat_top.c | 9 +-------- 5 files changed, 11 insertions(+), 33 deletions(-) diff --git a/tools/tracing/rtla/src/common.c b/tools/tracing/rtla/src/commo= n.c index dd67c6b47eaa..9d047a64146b 100644 --- a/tools/tracing/rtla/src/common.c +++ b/tools/tracing/rtla/src/common.c @@ -62,12 +62,13 @@ int common_parse_options(int argc, char **argv, struct = common_params *common) {"debug", no_argument, 0, 'D'}, {"duration", required_argument, 0, 'd'}, {"event", required_argument, 0, 'e'}, + {"house-keeping", required_argument, 0, 'H'}, {"priority", required_argument, 0, 'P'}, {0, 0, 0, 0} }; =20 opterr =3D 0; - c =3D getopt_long(argc, argv, "c:C::Dd:e:P:", long_options, NULL); + c =3D getopt_long(argc, argv, "c:C::Dd:e:H:P:", long_options, NULL); =20 switch (c) { case 'c': @@ -96,6 +97,11 @@ int common_parse_options(int argc, char **argv, struct c= ommon_params *common) tevent->next =3D common->events; common->events =3D tevent; break; + case 'H': + common->hk_cpus =3D 1; + if (parse_cpu_set(optarg, &common->hk_cpu_set)) + fatal("Error parsing house keeping CPUs"); + break; case 'P': if (parse_prio(optarg, &common->sched_param) =3D=3D -1) fatal("Invalid -P priority"); diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index 6ed5f5594960..1ebd3b48b2d3 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -490,7 +490,6 @@ static struct common_params {"auto", required_argument, 0, 'a'}, {"bucket-size", required_argument, 0, 'b'}, {"entries", required_argument, 0, 'E'}, - {"house-keeping", required_argument, 0, 'H'}, {"help", no_argument, 0, 'h'}, {"period", required_argument, 0, 'p'}, {"runtime", required_argument, 0, 'r'}, @@ -514,7 +513,7 @@ static struct common_params if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:b:E:hH:p:r:s:S:t::T:01234:5:6:7:", + c =3D getopt_long(argc, argv, "a:b:E:hp:r:s:S:t::T:01234:5:6:7:", long_options, NULL); =20 /* detect the end of the options. */ @@ -550,12 +549,6 @@ static struct common_params case '?': osnoise_hist_usage(); break; - case 'H': - params->common.hk_cpus =3D 1; - retval =3D parse_cpu_set(optarg, ¶ms->common.hk_cpu_set); - if (retval) - fatal("Error parsing house keeping CPUs"); - break; case 'p': params->period =3D get_llong_from_str(optarg); if (params->period > 10000000) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index d2dfad960440..02e5e6e18e8d 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -345,7 +345,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'}, - {"house-keeping", required_argument, 0, 'H'}, {"help", no_argument, 0, 'h'}, {"period", required_argument, 0, 'p'}, {"quiet", no_argument, 0, 'q'}, @@ -366,7 +365,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:hH:p:qr:s:S:t::T:0:1:2:3:", + c =3D getopt_long(argc, argv, "a:hp:qr:s:S:t::T:0:1:2:3:", long_options, NULL); =20 /* Detect the end of the options. */ @@ -390,12 +389,6 @@ struct common_params *osnoise_top_parse_args(int argc,= char **argv) case '?': osnoise_top_usage(params); break; - case 'H': - params->common.hk_cpus =3D 1; - retval =3D parse_cpu_set(optarg, ¶ms->common.hk_cpu_set); - if (retval) - fatal("Error parsing house keeping CPUs"); - break; case 'p': params->period =3D get_llong_from_str(optarg); if (params->period > 10000000) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index e7ba083b5eb4..d1a6cf0c2e0d 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 {"auto", required_argument, 0, 'a'}, {"bucket-size", required_argument, 0, 'b'}, {"entries", required_argument, 0, 'E'}, - {"house-keeping", required_argument, 0, 'H'}, {"help", no_argument, 0, 'h'}, {"irq", required_argument, 0, 'i'}, {"nano", no_argument, 0, 'n'}, @@ -830,7 +829,7 @@ static struct common_params if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:b:E:hH:i:knp:s:t::T:uU0123456:7:8:9\1\2= :\3:", + c =3D getopt_long(argc, argv, "a:b:E:hi:knp:s:t::T:uU0123456:7:8:9\1\2:\= 3:", long_options, NULL); =20 /* detect the end of the options. */ @@ -869,12 +868,6 @@ static struct common_params case '?': timerlat_hist_usage(); break; - case 'H': - params->common.hk_cpus =3D 1; - retval =3D parse_cpu_set(optarg, ¶ms->common.hk_cpu_set); - if (retval) - fatal("Error parsing house keeping CPUs"); - break; case 'i': params->common.stop_us =3D get_llong_from_str(optarg); break; diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 8250bea4b2fd..12e3d8c6f850 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 static struct option long_options[] =3D { {"auto", required_argument, 0, 'a'}, {"help", no_argument, 0, 'h'}, - {"house-keeping", required_argument, 0, 'H'}, {"irq", required_argument, 0, 'i'}, {"nano", no_argument, 0, 'n'}, {"period", required_argument, 0, 'p'}, @@ -594,7 +593,7 @@ static struct common_params if (common_parse_options(argc, argv, ¶ms->common)) continue; =20 - c =3D getopt_long(argc, argv, "a:hH:i:knp:qs:t::T:uU0:1:2:345:6:7:", + c =3D getopt_long(argc, argv, "a:hi:knp:qs:t::T:uU0:1:2:345:6:7:", long_options, NULL); =20 /* detect the end of the options. */ @@ -635,12 +634,6 @@ static struct common_params case '?': timerlat_top_usage(); break; - case 'H': - params->common.hk_cpus =3D 1; - retval =3D parse_cpu_set(optarg, ¶ms->common.hk_cpu_set); - if (retval) - fatal("Error parsing house keeping CPUs"); - break; case 'i': params->common.stop_us =3D get_llong_from_str(optarg); break; --=20 2.51.1