From nobody Tue Sep 29 06:09:19 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7250F4519A8; Tue, 11 Aug 2026 16:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786464859; cv=none; b=rFEg8RpC0XfZL2Z33J6pOrEjt7yk0S0SVAB8+OEzU/UpYULjsTJMktlWlQN8Fn5SkDb3jq0N5nB/VIr79eJ9RtjFEahaDFhfqtmoR+GsXocrV0YaawzfajqSGn2Us4AH+XnwgRkdIW7354f3O1pqKzUYpk+Rr8m8oWh0tuXsGYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786464859; c=relaxed/simple; bh=V0xFHuL9L85MREYZ/sO1b+FE9lQLtT9fhOLi3JmC+9w=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=grXK938UwLP+spV3t5eMup2gSwpAixC7Tmzb+nUCIXoQEjwMEwqOw5w8sa3U6nMZ1y+m6NL7GeLK1r8UZ16mn2APzGBRM9L7gTykPq2ZuQrRZGsUsutZClOarzAKGZqODNxEokbi9NgpEuK/sBIk3cQ1VEzuGbjgoTk+QvM0ork= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2xI0ooss; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=F/wJRyFp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2xI0ooss"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="F/wJRyFp" Date: Tue, 11 Aug 2026 16:14:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786464857; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DHq8mmOsb8FmxFpZhSxMqexxSn5vC9ojsxwpjSp2uj0=; b=2xI0oosszGaAe7awPfHQJQNXGgIX6XzBDh4imkr33w4NA1va85RQzTt59OrP9sxRyUtHsC syX68cCnrLbjPFCbQP4xL8rH6l0rdB2Ft4F2CGrtiZyVUFYd3mb2Rx/UscU6ynWGna4qoh tLV7wOz9EMzaH8L//UC8HIWrQ/TE7jlL/fsxlRU1RRunYRDPnlrI33KfAoYas5lvBorYOk cG196FCdFT5b7a2duKD9dpeayP2vDEG0JpRnormrvkA1WflikPQD6a1ofehvnsIHBRWTJo sQ9+rYhoqCUN4u3aRiot9Azh43QayGPk064Mgnp5ROPPeMlFTj8AgRNJKS6aKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786464857; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DHq8mmOsb8FmxFpZhSxMqexxSn5vC9ojsxwpjSp2uj0=; b=F/wJRyFpjGFH0QNwt8WaMBhVL7HFKMHkcN5TwwzySF3Oiq7jOxxumKn8BWMe1fcxfdhMem IYCLGJNppGwnB9AA== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh_=28Schneider_Electric=29?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] selftests: Add clock-helpers.h Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , John Stultz , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260803-auxclock-nanosleep-prep-v2-6-910cbd485390@linutronix.de> References: <20260803-auxclock-nanosleep-prep-v2-6-910cbd485390@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178646485540.442315.16564839606331534411.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/core branch of tip: Commit-ID: 431012dd0a291bc135eb88d8a62d7424576800fa Gitweb: https://git.kernel.org/tip/431012dd0a291bc135eb88d8a62d74245= 76800fa Author: Thomas Wei=C3=9Fschuh (Schneider Electric) AuthorDate: Mon, 03 Aug 2026 12:04:37 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 11 Aug 2026 18:11:20 +02:00 selftests: Add clock-helpers.h Multiple selftests duplicate various clock-related functionality. Add a new header to collect and deduplicate those. Signed-off-by: Thomas Wei=C3=9Fschuh (Schneider Electric) Signed-off-by: Thomas Gleixner Acked-by: John Stultz Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-6-910cbd= 485390@linutronix.de --- tools/testing/selftests/clock-helpers.h | 76 ++++++++++++++++++++++++- 1 file changed, 76 insertions(+) create mode 100644 tools/testing/selftests/clock-helpers.h diff --git a/tools/testing/selftests/clock-helpers.h b/tools/testing/selfte= sts/clock-helpers.h new file mode 100644 index 0000000..01451f5 --- /dev/null +++ b/tools/testing/selftests/clock-helpers.h @@ -0,0 +1,76 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __CLOCK_HELPERS_H +#define __CLOCK_HELPERS_H + +#include +#include + +#define MSEC_PER_SEC 1000LL +#define USEC_PER_MSEC 1000LL +#define NSEC_PER_USEC 1000LL +#define NSEC_PER_MSEC 1000000LL +#define USEC_PER_SEC 1000000LL +#define NSEC_PER_SEC 1000000000LL +#define PSEC_PER_SEC 1000000000000LL +#define FSEC_PER_SEC 1000000000000000LL + +#ifndef CLOCK_AUX +#define CLOCK_AUX 16 +#endif + +#ifndef MAX_AUX_CLOCKS +#define MAX_AUX_CLOCKS 8 +#endif + +#ifndef CLOCK_AUX_LAST +#define CLOCK_AUX_LAST (CLOCK_AUX + MAX_AUX_CLOCKS - 1) +#endif + +__attribute__((unused)) +static inline const char *clock_name(clockid_t clockid) +{ + switch (clockid) { + case CLOCK_REALTIME: + return "CLOCK_REALTIME"; + case CLOCK_MONOTONIC: + return "CLOCK_MONOTONIC"; + case CLOCK_PROCESS_CPUTIME_ID: + return "CLOCK_PROCESS_CPUTIME_ID"; + case CLOCK_THREAD_CPUTIME_ID: + return "CLOCK_THREAD_CPUTIME_ID"; + case CLOCK_MONOTONIC_RAW: + return "CLOCK_MONOTONIC_RAW"; + case CLOCK_REALTIME_COARSE: + return "CLOCK_REALTIME_COARSE"; + case CLOCK_MONOTONIC_COARSE: + return "CLOCK_MONOTONIC_COARSE"; + case CLOCK_BOOTTIME: + return "CLOCK_BOOTTIME"; + case CLOCK_REALTIME_ALARM: + return "CLOCK_REALTIME_ALARM"; + case CLOCK_BOOTTIME_ALARM: + return "CLOCK_BOOTTIME_ALARM"; + case CLOCK_TAI: + return "CLOCK_TAI"; + case CLOCK_AUX + 0: + return "CLOCK_AUX0"; + case CLOCK_AUX + 1: + return "CLOCK_AUX1"; + case CLOCK_AUX + 2: + return "CLOCK_AUX2"; + case CLOCK_AUX + 3: + return "CLOCK_AUX3"; + case CLOCK_AUX + 4: + return "CLOCK_AUX4"; + case CLOCK_AUX + 5: + return "CLOCK_AUX5"; + case CLOCK_AUX + 6: + return "CLOCK_AUX6"; + case CLOCK_AUX + 7: + return "CLOCK_AUX7"; + }; + return "UNKNOWN_CLOCKID"; +} + +#endif /* __CLOCK_HELPERS_H */