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 13A0C802E4 for ; Mon, 31 Aug 2026 22:48:30 +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 67VMkEsj030859; Tue, 1 Sep 2026 01:46:15 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 67VMkEsj030859 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="l903tY1K" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 67VMk65L030833 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 1 Sep 2026 01:46:06 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 67VMk65L030833 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-484362cb000so211055f8f.0 for ; Mon, 31 Aug 2026 15:46:06 -0700 (PDT) X-Gm-Message-State: AFuF++kPUXjr8zCvGySrxIW9cSu2jMPiSWYnaHlsJHfKzJqvUvWdwiLD h5Rf6atH0wcagtRVF6MGzNMX889urr5DqmwpBuCh5lVCyoLNqhPxtW7NBnWAVLW5b/n/C5emTbl npyGwEPwq9sOq2NQk57c/sUWX/DgrDSoiUFAnRLlywsq8pUStoNKj3A== X-Gm-Gg: AYBFou06pbw8fICXgu205unl5fpB34rhtXqhGbWYMe1JeiWorFVSexo2/SY0x2aOpu+ XovX1C849GswV/zQVcNJkQDejdoZMqdsBazzL+hf9DvWzyJxawBeIOynQKq/CPtoZ4CDBDB2lzY Rmdju0/FrJdL9KbglCHvs46BVU6gTRkv/Ihu7/RpENAngVUKiS+kcFrVnM11+XYWKmXvHHtjKZ/ C2A14DokgCu0HADi0Nu2ZzH+cthMi9bkgcwOQHOj0dxIGPmwm0YgHA5Pww/98Jdp8BcrCljIOYa +ggJB+rLodE8hqhdgG4xaIgqQKTnBvcOWrtU1QAH8I7iPOUfaxc8GOiZzTPLr2beH7KQzyHmVRj 8NWmZvTFaPlOwVoAX+LW6zfB0 X-Received: by 2002:a05:6000:2311:b0:484:3165:ef47 with SMTP id ffacd0b85a97d-48441f72fe3mr2114051f8f.0.1788216366003; Mon, 31 Aug 2026 15:46:06 -0700 (PDT) X-Received: by 2002:a05:6000:2311:b0:484:3165:ef47 with SMTP id ffacd0b85a97d-48441f72fe3mr2114015f8f.0.1788216365537; Mon, 31 Aug 2026 15:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788216365; cv=none; d=google.com; s=arc-20260327; b=F/HYtHF//KhGAb81Jgv+FfK0GCKqN/M+FcmKnwVJFdSziBzmLGDNMKQ5+W90PtX+ch t73q/i0MYtHozCFjjBJzKysiQKQzu/wSKzsA48n6JxlhJaudh2bJUjQuesXWKrW4T1ka ihNg5IJHYeRSnaT3/5sRHoKUYwDYW/8/4Y0uF4Rr3sG6kNa0U3oYguhNXD3JHVYh5A6O e3SEC5JLasPbVqx58jyMox/SCD5FD/7xK2LE5MvH9GR5SxI9U0EXNrjCoo+XYg3mWvzI VBxUS9ardFUxf+R9BYxmzN2poZAlrsEL8Ah9yAMCyiKh/DlpHiJGvB4xC5pUbgm2djsX Zdgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=P019vAkwRKm9+ck3m+mrSPb3XjiJ2WFuJ5qsWRkd6+Q=; fh=WpT6aB7RBAGHZeWZzqAr71yzRFbPTYkPWKsRagLn48Q=; b=dRwbWOLbiLOtEtxuWiJCpUlmEW+y/DLsblHk3sD5SH4ncondnHZr1+ib4LIj0qoLfh lOA6K0pEO3d/P9Y+G5GU5KbDM5pXe+dnS5xMqUrKuoGaCCrfo/iN+GLyIzywDDWEajlr Q/7KDHEz5MB/OVenymu7uRvJZguGgo3IpPhqfj0eDqXKVJX9SZ6H8Q1v8bezNEjNPMu9 sCzVs/90eqxXVFih83svDh7irMeujNImEmHHl053XgKLrwX3N9px7hio5/OGPE7xf/x5 M96+jWNtNIMLuPG/EYpACPfzVaDIAWTSHLz2Z10DYJWq2k6gWGxpjyJ0WAweJiLJkY5C 9wkw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=l903tY1K; 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-48442d859d4si1027403f8f.362.2026.08.31.15.46.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 15:46:05 -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=l903tY1K; 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=P019vAkwRKm9+ck3m+mrSPb3XjiJ2WFuJ5qsWRkd6+Q=; b=l903tY1KpSLf kF6y6o/JQbQqWHJVxKbFtH7ZY64Qzey+HSvwgf4hdYaryudfrp+AbFOyB7Iy8Tf12MBz3oeanEKbT e2akrz3laKAyKrH8sM4rUKCxd9zkqREU48Axm/tVyXzcuPkqKbWAwdh9eez7DK0QeinmwBO51Kfc5 yLy4YkshUtEg14LCed3AwlhScgzVtCilZcrKGBcCJk0NJRFa/3oUfkG7rFUVG8z555mxV0C91iwkv 2JMaO1Gy0nGpZxTwn8xfD1jA8rUTt6mBpzgBrGjyryM2FZgSi1ngtBAFrUyM1ZBt6fqZn4keveft0 RDLBFgnAKIXpGObFbwDggA==; 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 1x1Aj4-009fqa-1d; Tue, 01 Sep 2026 00:45:56 +0200 From: Eva Kurchatova To: khorenko@virtuozzo.com Date: Tue, 1 Sep 2026 01:46:00 +0300 Message-ID: <20260831224603.1641737-3-eva.kurchatova@virtuozzo.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260831224603.1641737-1-eva.kurchatova@virtuozzo.com> References: <20260831224603.1641737-1-eva.kurchatova@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH vz10 3/3] selftests: timers: measure the cpu timers on the clock they count 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 Commit b00385b8d081 ("selftests/posix_timers: Use CLOCK_THREAD_CPUTIME_ID for ITIMER_PROF measurements") gave ITIMER_PROF the clock it counts, as measuring a cpu timer against the wall says nothing on a machine where the task does not have a cpu to itself. The other cpu timers are still measured against CLOCK_REALTIME and fail the same way. With four busy loops on the two cpus of a test machine: not ok 2 ITIMER_VIRTUAL not ok 5 timer_create() per CLOCK_THREAD_CPUTIME_ID not ok 6 timer_create() per CLOCK_PROCESS_CPUTIME_ID ITIMER_VIRTUAL counts the time the task spends in userspace, so take CLOCK_THREAD_CPUTIME_ID for it as well; the loop it runs stays in userspace, so what that clock adds for system time is far inside the half a second the check allows. check_timer_create() arms its timer on the clock it is given, so measure on that one. The test then passes whole on that machine, 19 of 19, busy or idle. https://virtuozzo.atlassian.net/browse/VSTOR-143363 Feature: fix selftests Signed-off-by: Eva Kurchatova --- tools/testing/selftests/timers/posix_timers.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c index 077a98fb1b1d..66993bd632ec 100644 --- a/tools/testing/selftests/timers/posix_timers.c +++ b/tools/testing/selftests/timers/posix_timers.c @@ -112,9 +112,10 @@ static void check_itimer(int which, const char *name) done = 0; - if (which == ITIMER_VIRTUAL) + if (which == ITIMER_VIRTUAL) { + clock_id = CLOCK_THREAD_CPUTIME_ID; signal(SIGVTALRM, sig_handler); - else if (which == ITIMER_PROF) { + } else if (which == ITIMER_PROF) { clock_id = CLOCK_THREAD_CPUTIME_ID; signal(SIGPROF, sig_handler); } @@ -146,7 +147,7 @@ static void check_timer_create(int which, const char *name) struct itimerspec val = { .it_value.tv_sec = DELAY, }; - int clock_id = CLOCK_REALTIME; + int clock_id = which; timer_t id; done = 0; -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel