From patchwork Mon Apr 15 16:23:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 789068 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 AE27F29414 for ; Mon, 15 Apr 2024 16:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198196; cv=none; b=LZOODXyw0zoiu9w835G45zBrt/mlEafnR1MM3VXa/dE5jOybHuQOZsfJprp08EEoJad6iXEBOopkSKIrIMezu1UOEb16xC+bxMk4tanI/pH0G5BgxoMVoYqhhDc0kbLVl9DH4BwDmQumOrTWE4Be0YwjCwRqQr36jdrwcq4ziJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198196; c=relaxed/simple; bh=IztYwKZ/VaVkKmnd9d5+3jv+XxvhkFJkenC+M8BvwQU=; h=Content-Type:Message-ID:Date:MIME-Version:To:Cc:From:Subject; b=X6EVpxqrAHMEwMGi9RJ7n64ZP3VV3PmEOUi/e6fHHUkxXAh/SpE4ToAY2HfA3cWM39Z9CZFE5Vp8PGlNtnulEFmC0DeGd8QqJQHLEPCfcEP5iICjGB9ri4BI6naZvTm2kSZ/uGQubDO+8jpdbpdnB79IXuZuMdKJT2eiRngLUlc= 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=Vzpt0IrT; arc=none smtp.client-ip=209.85.215.170 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="Vzpt0IrT" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-5f760eebd79so70125a12.1 for ; Mon, 15 Apr 2024 09:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1713198194; x=1713802994; darn=vger.kernel.org; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=0/Z51JDqeCMIYAogMv4e7mjxOubQ/EaWsQPKXTj8RQ4=; b=Vzpt0IrT4UmI/8l2V4DdwEdp8olYOeS0Ax+R9NARoHlKti3i30gfSyDvqaZbDySlj4 I2J52A41IUNsNq8PT4HZzyX4XI1iQEvIDX+XclN/NipNIbS/btZnTbTj6nTSc5u8d8V2 efrCFrdGCiDK2H7s1/1sTtESSZUxLyWdn/kdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713198194; x=1713802994; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0/Z51JDqeCMIYAogMv4e7mjxOubQ/EaWsQPKXTj8RQ4=; b=INjdeclJRdCdSAoYwyNLJLOKlYCXuErFnxjjfCH7F08+RSgKAcfoHu6yqTswPSRtjZ SoRfP0WxZ8OYg0kctKbGrOSCTduFpWxBQUdOeYGWfv2JW+JUgTPKRdnjNsaE36/fZsPw 04UWLlP2RCfeQlODb0MrB5jzaEVa8DjtlvUPBNlLTGQK99RLDH0tzMaK3sw+cyCDmuqm L510FlOs+L6HrlVl2V4J4XVkR4CmqpxBLPZT2H+aaQ8m08OcTzEAucwwNcmKoF7+jaz1 V0P0K29I5MV0izTzkIQsGD/vXyEhd/hP3smtJetuvAvNaOh85UEmJ8omnOqN3TJ58ya4 N0wQ== X-Forwarded-Encrypted: i=1; AJvYcCXYd0YQNYzKwSOtVDMdKGWsmTnVQaAOntougtTzP4RpS1C82Bq59efAI1s11azg14tePvI9hchrZijcain8x6HvHLXK4fBsIJqAsX9sqZC6 X-Gm-Message-State: AOJu0Yx9g7xYwLaM74B4HUw5IcVYY66d5ZQhyX4BTA5XV/ZL+GUKtP6S RKhBD/WHgVZ+liIyJUPtV31MHWvTYL9EwRtAYzuEBtVXgcnSX64R8Mih26edsRQ= X-Google-Smtp-Source: AGHT+IGGW7en+6bXWtgxTwQRzlAn+FGmigqcoxLVLENAYPJ4AFSUjBaYrm1Wyp93UhbyFXXF7OuKDg== X-Received: by 2002:a17:902:da8c:b0:1e2:c544:9bb0 with SMTP id j12-20020a170902da8c00b001e2c5449bb0mr12201217plx.0.1713198193865; Mon, 15 Apr 2024 09:23:13 -0700 (PDT) Received: from [172.20.9.236] ([209.37.221.130]) by smtp.gmail.com with ESMTPSA id b11-20020a170902650b00b001e509d4d6ddsm8293062plk.1.2024.04.15.09.23.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Apr 2024 09:23:13 -0700 (PDT) Message-ID: Date: Mon, 15 Apr 2024 10:23:12 -0600 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Linus Torvalds Cc: shuah , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org From: Shuah Khan Subject: [GIT PULL] Kselftest fixes update for Linux 6.9-rc5 Hi Linus, Please pull the following kselftest fixes update for Linux 6.9-rc5. This kselftest fixes update for Linux 6.9-rc5 consists of a fix to kselftest harness to prevent infinite loop triggered in an assert in FIXTURE_TEARDOWN and a fix to a problem seen in being able to stop subsystem-enable tests when sched events are being traced. diff is attached. thanks, -- Shuah ---------------------------------------------------------------- The following changes since commit 224fe424c356cb5c8f451eca4127f32099a6f764: selftests: dmabuf-heap: add config file for the test (2024-03-29 13:57:14 -0600) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-fixes-6.9-rc5 for you to fetch changes up to 72d7cb5c190befbb095bae7737e71560ec0fcaa6: selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN (2024-04-04 10:50:53 -0600) ---------------------------------------------------------------- linux_kselftest-fixes-6.9-rc5 This kselftest fixes update for Linux 6.9-rc5 consists of a fix to kselftest harness to prevent infinite loop triggered in an assert in FIXTURE_TEARDOWN and a fix to a problem seen in being able to stop subsystem-enable tests when sched events are being traced. ---------------------------------------------------------------- Shengyu Li (1): selftests/harness: Prevent infinite loop due to Assert in FIXTURE_TEARDOWN Yuanhe Shu (1): selftests/ftrace: Limit length in subsystem-enable tests tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc | 6 +++--- tools/testing/selftests/kselftest_harness.h | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------- diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc index b1ede6249866..b7c8f29c09a9 100644 --- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc +++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc @@ -18,7 +18,7 @@ echo 'sched:*' > set_event yield -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` +count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` if [ $count -lt 3 ]; then fail "at least fork, exec and exit events should be recorded" fi @@ -29,7 +29,7 @@ echo 1 > events/sched/enable yield -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` +count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` if [ $count -lt 3 ]; then fail "at least fork, exec and exit events should be recorded" fi @@ -40,7 +40,7 @@ echo 0 > events/sched/enable yield -count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` +count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` if [ $count -ne 0 ]; then fail "any of scheduler events should not be recorded" fi diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 4fd735e48ee7..230d62884885 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -383,6 +383,7 @@ FIXTURE_DATA(fixture_name) self; \ pid_t child = 1; \ int status = 0; \ + bool jmp = false; \ memset(&self, 0, sizeof(FIXTURE_DATA(fixture_name))); \ if (setjmp(_metadata->env) == 0) { \ /* Use the same _metadata. */ \ @@ -399,8 +400,10 @@ _metadata->exit_code = KSFT_FAIL; \ } \ } \ + else \ + jmp = true; \ if (child == 0) { \ - if (_metadata->setup_completed && !_metadata->teardown_parent) \ + if (_metadata->setup_completed && !_metadata->teardown_parent && !jmp) \ fixture_name##_teardown(_metadata, &self, variant->data); \ _exit(0); \ } \