From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id B768D80162 for ; Tue, 8 Sep 2026 21:33:15 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 688LVtbZ011798; Wed, 9 Sep 2026 00:31:56 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 688LVtbZ011798 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="MSarRL83" Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 688LVr6N011791 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 9 Sep 2026 00:31:54 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 688LVr6N011791 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-482e538ad9fso4527770f8f.0 for ; Tue, 08 Sep 2026 14:31:54 -0700 (PDT) X-Gm-Message-State: AFuF++mP7r5LRoK2UIykLRsKX7hYrtawOexzOGP437QSss+NPjZPpLq7 2XxVMTYuxmHP3fKAwpasipAjHTprK5Rkj8fGoi8zA4FQdyU/87atXdby2KrwkS4k6JdYQWXTeyq nGIySD2GnjScF+qNba6O7bS9soME2F5QW5QlPPFvnqZXO4AGv7Qyg+Q== X-Gm-Gg: AYBFou2bMgbLUdeZ0n+ckKhbA6K6YdnzPZHhZVmYugAzkudAmYFIc99jfNCKPv2QRYQ 6bd+91i/U5rGtcC7RZUrjrmea3UQ2s7fTzIlpYrKohC0Z5hKDTAkw5sWNrms9tneTkI0t2ifKDU w5WMsYpX2Wfl+FbjLoXhB7fGmIc8MuSQNHpEhW8ybAP7XLGpBm46hcR2F0eaW/PvJSwnSOaZe3K AVJcah/SsZ5GyUVLQ0Q1HSJxXyc41yceDjjlxkgD1XE53LHyvL3NM7DT0pMniFW4b8sKtLLy2ox KSEaz1EQSX3ALdmrzAHPJlLw4rEHQ83mzGgYfUR+afccp2EisUpzGoS7TgZXx/dEjDega4bQnms usgtQvdwexEKhLDXvLDYuTig4aw== X-Received: by 2002:a5d:5f92:0:b0:485:8c16:a328 with SMTP id ffacd0b85a97d-4858c16a6ffmr29676141f8f.29.1788903113580; Tue, 08 Sep 2026 14:31:53 -0700 (PDT) X-Received: by 2002:a5d:5f92:0:b0:485:8c16:a328 with SMTP id ffacd0b85a97d-4858c16a6ffmr29676104f8f.29.1788903113059; Tue, 08 Sep 2026 14:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788903113; cv=none; d=google.com; s=arc-20260327; b=YWgdJ1YrijHM7C2lsNjVxw7yHkSlKu6XxyC8WMDfu7xIzlp2Ny/+3N8LZlwrf6Zo/v BRU2eACV0QzntOWlvk6Dgve+9HIjUPmUO48RvGoxVmyMS+Rf0+rETX6bsJPWq2w7z4Zf ymACJXudbsafPhiSenDdY7uuXW3JoeD5tv+RzSAOeOTM1aNVZ0TLXVSUvbWZCA412LS0 DarWDsZ+L1zpC/fqds6PsC9elN/KkC2I3h0Ky2XaW0EJKT8omXzGzTjBbGO9FNMbNio6 L1bxZdSb945U10J+ykaMrSConB6klRpzV4GkWMEWx+JIbz4mzr1UbuFYuJ4WAp5e28U/ mMog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=MPzzfDTpQaqcNq7mHns+vxYCe6CXnG9FmIPmGg7nwtA=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=a2iLFNCJCzLTPJk5/hbDxytXEF57zdmehKIyH8ECUJ0J7Jtrksamp/4YttaewAVZk9 Eb+EOfxiTE5haKz800szzMTrbTVLrGAfBeKccW1/1ro4atlEQ9t8QC6HKiPn8jN+wWji X8y6RpDA3iafu/CLXKdobmZ5a2um1w8GJc4d+7iPu/kXlNmd2lClCqNBOqsrwuZjsQky FMjG3Je8w0xTThP6Yx9ZGX0U6B4hYzRlxLCLE+l9asOHy+itDF4lwVrQP3sKOh3ZhWCY ZJvvHRS1cMUr/CtBKBUFV0fHgdsBzZmASDORuVS/9DXVRF2SREwXMARz+XntrAxqd7ye P4ag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=MSarRL83; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-485885b9c74si29031200f8f.202.2026.09.08.14.31.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2026 14:31:52 -0700 (PDT) Received-SPF: pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=MSarRL83; spf=pass (google.com: domain of eva.kurchatova@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=eva.kurchatova@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=MPzzfDTpQaqcNq7mHns+vxYCe6CXnG9FmIPmGg7nwtA=; b=MSarRL83wuAg j+iPtqTpLkCjqgdBSfJ+/9k9wUa96oTf2boWIc6Fs2klcR0wtWhfx99f1rAtdSGjaUdWdbTYuhw3k qDa+i/zatpj1kPLjee+lEF5W0QGGYEf5hHEMru6tjLPq4cBsXrYStA+PCp1dcv+/mYvBejYXrtaT2 +JiEZxEUm8y0S/5FxrFzNjKAaxnQNNClUY/2W3ai2oJ6ehGGmswvkXkmYFQVehIF4js8rKVO17Xst oKhyrZh8p2lYTckTrt6lO4GmxyeUaiGbwfD8U6atq2kpQt19bSwW8/BSb5mkE2+zqQcSNUCHvvHaq QHF0Hco/2wOeA0ZhDlCNpg==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=LekKit-T14) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x43NR-002VTt-2T; Tue, 08 Sep 2026 23:31:42 +0200 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Wed, 9 Sep 2026 00:31:47 +0300 Message-ID: <20260908213150.2677032-1-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH vz10 1/2] ms/selftests/tracing: Fix false failure of subsystem event test X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Steven Rostedt The subsystem event test enables all "sched" events and makes sure there's at least 3 different events in the output. It used to cat the entire trace file to | wc -l, but on slow machines, that could last a very long time. To solve that, it was changed to just read the first 100 lines of the trace file. This can cause false failures as some events repeat so often, that the 100 lines that are examined could possibly be of only one event. Instead, create an awk script that looks for 3 different events and will exit out after it finds them. This will find the 3 events the test looks for (eventually if it works), and still exit out after the test is satisfied and not cause slower machines to run forever. Link: https://lore.kernel.org/r/20250721134212.53c3e140@batman.local.home Reported-by: Tengda Wu Closes: https://lore.kernel.org/all/20250710130134.591066-1-wutengda@huaweicloud.com/ Fixes: 1a4ea83a6e67 ("selftests/ftrace: Limit length in subsystem-enable tests") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan (cherry picked from commit 213879061a9c60200ba971330dbefec6df3b4a30) https://virtuozzo.atlassian.net/browse/VSTOR-144622 Feature: fix selftests coverage Signed-off-by: Eva Kurchatova --- .../ftrace/test.d/event/subsystem-enable.tc | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 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 b7c8f29c09a9..65916bb55dfb 100644 --- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc +++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc @@ -14,11 +14,35 @@ fail() { #msg exit_fail } +# As reading trace can last forever, simply look for 3 different +# events then exit out of reading the file. If there's not 3 different +# events, then the test has failed. +check_unique() { + cat trace | grep -v '^#' | awk ' + BEGIN { cnt = 0; } + { + for (i = 0; i < cnt; i++) { + if (event[i] == $5) { + break; + } + } + if (i == cnt) { + event[cnt++] = $5; + if (cnt > 2) { + exit; + } + } + } + END { + printf "%d", cnt; + }' +} + echo 'sched:*' > set_event yield -count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` +count=`check_unique` if [ $count -lt 3 ]; then fail "at least fork, exec and exit events should be recorded" fi @@ -29,7 +53,7 @@ echo 1 > events/sched/enable yield -count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l` +count=`check_unique` if [ $count -lt 3 ]; then fail "at least fork, exec and exit events should be recorded" fi -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel