From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46]) (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 DB5F33E63B9 for ; Mon, 27 Apr 2026 17:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311903; cv=none; b=XS9uhQX+z9MBGBdJVoEnuQtTaYlzsl2gJJmAJIDbUc7LOdkzSpwju1Km5uMrYTA07VdaSiESmU+9cS/9wGt46vUCKbSzJsnN8t9zsLeNr+oM+t4BhziVDd0P7VlouNxPT1gh5ZZ7zjWiCnk/9cU4EEyoR/6eQZ1RdEpCa0FVHdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777311903; c=relaxed/simple; bh=4Y4O3agHDFOBx+xyDha/Oc3P8x3xjQzyHRXVKrvNyAM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aBMKHT+UYpMaW1J8N8wPPJ+Igzfh5S6z8kmDqnNRblV4wBM5GKF1PMbMJQl58/EaJoK3Fc7oGekg86J5nXgA44YfiExCvyzIjaLybiP7RtWHChpLXxZlYF05SCzh+nc0LRSeoF8s1bYVTakHwwvNSQzTuFNSFRx3CQmCdWZWIOc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YF2ltafx; arc=none smtp.client-ip=74.125.82.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YF2ltafx" Received: by mail-dl1-f46.google.com with SMTP id a92af1059eb24-12c637089ccso1355193c88.1 for ; Mon, 27 Apr 2026 10:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1777311898; x=1777916698; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9D2K1vsMEYoTo0SmC/YpuFOBiDy6YrczCVTaUbkCqYs=; b=YF2ltafxYQfnwjMybByuwxiJX5hpz7KLNzPgFc6ZpRTY/ZnyvimTZhTPb5950qgW7u gIGZvnnSg2rTFdXtxfSJeqU62Wl4gQDVihfK/oRNY2y6HBzq+hD+VUFgFhbaGZEWvC0d v/Nkia7QfaqMo/lHdKeNaf2Pt4Wt4QfEZWxYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777311898; x=1777916698; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9D2K1vsMEYoTo0SmC/YpuFOBiDy6YrczCVTaUbkCqYs=; b=RyppijMds1NpfpkQCbmhKfCsTWeL9mpzShgklD6Ag7WAPkgqWsgfq3ujO2owuoHUr+ noR6goz4WT/zKnnUzxQNSMGxcf9pOcPfcOHkbKOW7CcLwgkOgIAcrB1xskQ7rECwJoZB UxO5KRl41KC7QNDP36MxT+WVcnDhdiQ2OF6rmpqp0pJ5T5hw5raxbOeJFH7SdbjrDPGJ rthGUjdWcAClXbSKnSpdMHb6eV0CKMC273NdNtJrAKEyrRC6QJQISxuIq56I05AIRokr qYivU+B2AweOrpomjCkGfqq463tGw1nAbFUhxwCYGUEpYLysFsf2uarHyRfs/+5uJEVy 7GgA== X-Forwarded-Encrypted: i=1; AFNElJ+xza4dX0y3Wq8Aeq448unUjvGcfK2TTGqPCc+BEBC0boBhYdpOXDcxroOykavQeAhevb/2s/vxyxpNwcU=@vger.kernel.org X-Gm-Message-State: AOJu0YzgZ9e+iIpa6lZa4Nvsa6Jq09OBpDqeSlz/VOlQge0AymmrwkxM sn1wzAs9NvmA1OmFJXu4Mwq2uj4c3mI+K6CDzdY+r8qlPU3qjvzxmXJXdB/wgPuekcY= X-Gm-Gg: AeBDietjLROKsXmU7b/ac3Xa9c7KWIw0HlK4ahib/+amUpKLLtwVjr3OrkmGLjV6Q4W saPS09uz6a2WXwJvacnnL4Jc24E+Y3s5MzaVsTiGl6xb/Ec7hsT01p/epdlyFhtf5Zx53S+K18I tgG1zXImRbScKtC6L9baHqe03PDCqIXBZP395l3K5/+karIYC4fmNNtUlnAcuCjaj+NCrfbuKCY OvcJS2hIYtbJ1pZ5h9hbWRh3dhnlWkqMUq6Gjxdv8S+SdfkjM/mZvEhjUCOIOL9oPK13YOyrxQN /0k/leia7D+ILhYSaBBQmzGgW8/f55cMsd2g0xhQ/g+ekcgon0wZwXqjJUKQvRN5IAEP6guiIdC S7hHEwhaAmngWUHK0jV6WJvqFE777zZPcaL5lZ1MxFbGgxnCGkwEg1b0uSqP6yVhbB0uTUB675D QXRszCmVKmPWGSzwBqti65zyT6HUz9J1maGYgOZYfY5i4M X-Received: by 2002:a05:7022:fe0a:b0:12a:72af:83d1 with SMTP id a92af1059eb24-12ddd50b1dbmr148212c88.11.1777311897824; Mon, 27 Apr 2026 10:44:57 -0700 (PDT) Received: from [172.30.76.185] ([50.224.25.13]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12dca2c1c16sm14378525c88.5.2026.04.27.10.44.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Apr 2026 10:44:57 -0700 (PDT) Message-ID: <7b424355-58bf-470f-ab5a-071ef9c5646f@linuxfoundation.org> Date: Mon, 27 Apr 2026 11:44:56 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests: kselftest: fix wrong test number in ksft_exit_skip To: Sarthak Sharma , shuah@kernel.org Cc: pbonzini@redhat.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20260427112447.147985-1-sarthak.sharma@arm.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <20260427112447.147985-1-sarthak.sharma@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/27/26 05:24, Sarthak Sharma wrote: > ksft_exit_skip() increments ksft_xskip before printing the KTAP > result. As a result, ksft_test_num() already includes the skipped > test. > > Adding 1 to ksft_test_num() increments the printed test number > again, producing an incorrect test number and wrong KTAP output. > > Drop the extra increment and print ksft_test_num() directly. I applied this patch to linux-kselftest fixes branch. I ran a few tests and couldn't really see the problem this patch fixes with and without the patch. Can you send me before and after for mm or timers test runs? > > Fixes: b85d387c9b09 ("kselftest: fix TAP output for skipped tests") > Signed-off-by: Sarthak Sharma > --- > tools/testing/selftests/kselftest.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h > index afbcf8412ae5..827b47cf4df8 100644 > --- a/tools/testing/selftests/kselftest.h > +++ b/tools/testing/selftests/kselftest.h > @@ -449,7 +449,7 @@ static inline __noreturn __printf(1, 2) void ksft_exit_skip(const char *msg, ... > */ > if (ksft_plan || ksft_test_num()) { > ksft_cnt.ksft_xskip++; > - printf("ok %u # SKIP ", 1 + ksft_test_num()); > + printf("ok %u # SKIP ", ksft_test_num()); > } else { > printf("1..0 # SKIP "); > } thanks, -- Shuah