From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 634D33F1ACE for ; Tue, 2 Jun 2026 15:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780415549; cv=none; b=W+QOuVSZQ3qUIr+HAPtNsB1CuJSHH1/WUiy+h3B9u26oCSahV/5xP0yzEaios9hboV2euSZzkfLm4887OxP0aoU6p40/jsOafg5jNC+iUTCXpxEpY0+GDccdUA8vSWH8PcfTXgcMcgNY5Ilvvz4l6ZM0UpBnG52KPArvNg6cvPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780415549; c=relaxed/simple; bh=GwT9o00dmaLqOv61Un1yDWpqIcsCAtOZcLhfVIcYHpI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QqLz6kKuS4AcNM0r9gI4vRXjswP/hZgdfZdvAa/yKHF6DXn2xi/Oyy4iBNN1KqqrGo3lF8dGC/MS9sJUWivv4WmTiKIbtJYvs9iTHjpnE2NIVnkqhGlJNcI2rcaSREBTLU2cAlrAKiA0FDunKUkXyP0Bu3clagWfUUfelkcbtWw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=C8FdeZre; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C8FdeZre" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-517760dc3c2so500821cf.3 for ; Tue, 02 Jun 2026 08:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780415547; x=1781020347; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=BzVQlUS6Ma27cMpUQ+7FK5Q0dPa4ejPpWzIeqaSTbGc=; b=C8FdeZresXpX7RR+sTmfJxQtbZaxg3GKb+78FnRrOXIahPM7dUOzs0r/mVBZ1JFPmn eISxfntHtLTFHesDKr4+l5jdCzrnGgvh7DEhgKgPqWgD6a0Hqu+ZsMrffTzU1l8mnCqz 4ULDDZpD/L/oo3Ob+lUma/NIgaJouknHzPTwXY/MtRQH2Px+oMmjRKFDWE1FEdVGWtA2 imNnnVnCkxkPw0XbK9co46nq1sCW8ByJ3uWCNabnqB+xsRxl5yIlrQWirMi2D/vqck3I TdDKwoMyvacT8wy/hWYrki1IFDmExo/is2y0MIHWqm8WBVUdKTn4VrV3i73xoRsOSwJa hPyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780415547; x=1781020347; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BzVQlUS6Ma27cMpUQ+7FK5Q0dPa4ejPpWzIeqaSTbGc=; b=L/Z8kGhze7OSfASKLZ6GTlVZ/8Q074PkzrFf3f4IMFE1hjT8aucZA9xvf+lkV93bp3 9NcbtkjX7VGLDS7gdyM5QATsa4yS3AN8TM7hJIMKeg5kesmfSyPEN9Hd3tvx/7msfrY9 /YPMhiW2zgv8X1uE9DNVVPbTt+RrxxU4qF8xrZscfQXpQ8vVQ9os7xS4iC8GVspC6y0M 8BXn94qWDkcNn15pD3MwPK1qCLZuNrn++Xl3s86st3qezWubC/cgL/T5OLW2gqJU70j3 X7xFKDbd8XCcIx3LkwKnXJSn1OQzyNvSq4ziZaDMLcQDkFD5ELlIITSHyKWpWQ8dtudH 38yA== X-Forwarded-Encrypted: i=1; AFNElJ97gUlDZ/ooj6/43BohfihPoV5qc/SQy/rqrUjmk4BnWFfPqeUAyT/9ITU+yotT/5Csw5T0Hq8hTE8yiNk=@vger.kernel.org X-Gm-Message-State: AOJu0YxxHJXxYSrhsgUd7rdgQ7kcf3X+6zlRk+7AFVPvhFqv94hGA0Nh PUYB7Hjhjl/7fGVrc8Z4PkJVjY7Zr7G9SX1/kizVA54+kPtbr/zCVsMubn8Uhw== X-Gm-Gg: Acq92OHkPsoDwgQq3+U7xz+rjTlzO7J/3nc00uFcKPaiWStCZjLBuLgIYiRfvR1h2SJ j0UyxQWdHe8E5zev23YmVioUMZXHVa9BCSTC81HJ9/xSqwQNokluG1eqnkcjzkMdupgwbk+SJNL 3svlBiIV9gv/i+PvlE1oV23ahv0lYw9/Jpr7OcaZkV4jRPfha8qDhV2Deo1n2FgxAXOC2Gf6l1c KPXof6+MfQhprJPjYsG6prMCfxYte4/018GKbehKBode2smiRxaOGRTGnC4A7g4Id8k9xhUxRKm cp1vMlQ3IIsiVzBz1Fi04sUKpRJ5z5zhFrI929QjJWVSoRyuxOyp2iFuHOn/SVhXLx207F+YkP1 GAw0fI2qW7LoIUaSv+pBPX7EdiqHyRRw3VjPACzSlEO/L/K1UlPmFDNu1tVA4WgBMLqlYZyH2eF na2zdxqC7W9PobgQt9mQi6EZ8pc/z2lzcJZ1qRM44y/Nq4X5zTWDxgNAaSgNMbqgQkAw5czWt9s levPJy3xFN6vi96/tz6FNEqE1TgoA== X-Received: by 2002:a05:622a:6843:10b0:516:e74e:cc51 with SMTP id d75a77b69052e-5173a85c1aemr185342511cf.51.1780415547263; Tue, 02 Jun 2026 08:52:27 -0700 (PDT) Received: from Cumhall.redhat.com ([216.209.112.32]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51775e27cc7sm1520351cf.29.2026.06.02.08.52.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 08:52:26 -0700 (PDT) Sender: John Kacur From: John Kacur To: linux-trace-kernel@vger.kernel.org Cc: Steven Rostedt , Tomas Glozar , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] rtla: Add tests for option parsing with attached arguments Date: Tue, 2 Jun 2026 11:52:09 -0400 Message-ID: <20260602155210.60439-3-jkacur@redhat.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260602155210.60439-1-jkacur@redhat.com> References: <20260602155210.60439-1-jkacur@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: 8bit Add tests to verify that short options with attached numeric arguments work correctly for all rtla commands after the parsing fixes. Tests verify four formats for each command: - Short option with space: -p 100 - Short option attached: -p100 - Long option with equals: --period=100 - Long option with space: --period 100 For osnoise and hwnoise commands, the tests also include -r 100 (runtime) to satisfy the osnoise constraint that runtime <= period. These tests complement the existing timerlat hist tests added in commit d489b602c669 ("rtla/timerlat: Add tests for option parsing with attached arguments"). Assisted-by: Claude:claude-sonnet-4-5 Signed-off-by: John Kacur --- tools/tracing/rtla/tests/hwnoise.t | 10 ++++++++++ tools/tracing/rtla/tests/osnoise.t | 18 ++++++++++++++++++ tools/tracing/rtla/tests/timerlat.t | 8 ++++++++ 3 files changed, 36 insertions(+) diff --git a/tools/tracing/rtla/tests/hwnoise.t b/tools/tracing/rtla/tests/hwnoise.t index 23ce250a6852..c61f02bc42fe 100644 --- a/tools/tracing/rtla/tests/hwnoise.t +++ b/tools/tracing/rtla/tests/hwnoise.t @@ -19,4 +19,14 @@ check "enable a trace event trigger" \ "hwnoise -t -e osnoise:irq_noise --trigger=\"hist:key=desc,duration:sort=desc,duration:vals=hitcount\" -d 10s" \ 0 "Saving event osnoise:irq_noise hist to osnoise_irq_noise_hist.txt" +# Option parsing tests - verify attached numeric arguments work correctly +check "verify -p with space" \ + "hwnoise -p 100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify -p without space (attached argument)" \ + "hwnoise -p100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify --period with equals" \ + "hwnoise --period=100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify --period with space" \ + "hwnoise --period 100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" + test_end diff --git a/tools/tracing/rtla/tests/osnoise.t b/tools/tracing/rtla/tests/osnoise.t index 396334608920..1807236431df 100644 --- a/tools/tracing/rtla/tests/osnoise.t +++ b/tools/tracing/rtla/tests/osnoise.t @@ -17,6 +17,24 @@ check "verify the --trace param" \ check "verify the --entries/-E param" \ "osnoise hist -P F:1 -c 0 -r 900000 -d 10s -b 10 -E 25" +# Option parsing tests - verify attached numeric arguments work correctly +check "verify -p with space" \ + "osnoise hist -p 100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify -p without space (attached argument)" \ + "osnoise hist -p100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify --period with equals" \ + "osnoise hist --period=100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify --period with space" \ + "osnoise hist --period 100 -r 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify osnoise top -p with space" \ + "osnoise top -p 100 -r 100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" +check "verify osnoise top -p without space (attached argument)" \ + "osnoise top -p100 -r 100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" +check "verify osnoise top --period with equals" \ + "osnoise top --period=100 -r 100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" +check "verify osnoise top --period with space" \ + "osnoise top --period 100 -r 100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" + # Test setting default period by putting an absurdly high period # and stopping on threshold. # If default period is not set, this will time out. diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests/timerlat.t index 1a63301f5d70..506227412027 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -51,6 +51,14 @@ check "verify --period with equals" \ "timerlat hist --period=100 -c 0 -d 1s" 0 "" "no-irq and no-thread" check "verify --period with space" \ "timerlat hist --period 100 -c 0 -d 1s" 0 "" "no-irq and no-thread" +check "verify timerlat top -p with space" \ + "timerlat top -p 100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" +check "verify timerlat top -p without space (attached argument)" \ + "timerlat top -p100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" +check "verify timerlat top --period with equals" \ + "timerlat top --period=100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" +check "verify timerlat top --period with space" \ + "timerlat top --period 100 -c 0 -d 1s -q" 0 "" "no-irq and no-thread" # Actions tests check "trace output through -t" \ -- 2.54.0