From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AD35C54E90 for ; Thu, 22 May 2025 17:39:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 076F26B0085; Thu, 22 May 2025 13:39:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EF5656B0088; Thu, 22 May 2025 13:39:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D94D56B0089; Thu, 22 May 2025 13:39:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B66836B0085 for ; Thu, 22 May 2025 13:39:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6C043C0197 for ; Thu, 22 May 2025 17:39:19 +0000 (UTC) X-FDA: 83471255238.29.787C429 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf28.hostedemail.com (Postfix) with ESMTP id A703FC0004 for ; Thu, 22 May 2025 17:39:17 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bZKEEf2k; spf=pass (imf28.hostedemail.com: domain of broonie@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747935557; h=from:from:sender: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:dkim-signature; bh=vSxE+vO2Q0zgxS1mH2+Ru1cf4OrSpskOTn6Bs5IdoKc=; b=flhf+1cixVHKJO4JIodOYTxuUorQPBlZEofQpN6XwectTCLMNtWm3RKD3JOcp6qQUb7m80 psbqEWw6XR4SeWXiwDth19paJufLmY3pkRR4F63hHPIQWQhe0kg426ThgvzYzmTfC5NVWa xasrUQTA3wxOskFSjFtfmvo9N2RZCbE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bZKEEf2k; spf=pass (imf28.hostedemail.com: domain of broonie@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747935557; a=rsa-sha256; cv=none; b=J/HEStuvs8OIiacYVkoUVEg0pabnWiUBGpeZU0lBzRuJtNrPU19gK7bFLxQKDuyv8WA08t ViQQM7doHG/Nc1opldwUgagdlCsOzj39CD/04qH3wRRHevcwbX0iz1vKYABSdWSYFa/5/c 4XeNJwNTPN4lOdRV/UM7jPfMDDdk0ac= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id E42D162A29; Thu, 22 May 2025 17:39:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E770C4CEE4; Thu, 22 May 2025 17:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747935556; bh=BfV3xzhjunrMLDK9cWHpUfmqXZar03TrfugoHRogF2k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bZKEEf2kmgWS8SMxr95A7OurYGQNSLzhSxXIghZQnB74rli2wfofyjQC3jbgcQCeu 4pjQmW3HdB/eOktv9Hcnk1gfqlPUU/Qs0irdRqh2Ia1EZuFH0kFwg0I/XimT0UAXjL HCuJh8DFQ69SEddP5i6YVIAZcviw/Cex28eCMZqxxHQ3hXOQErZtiPTMkDrInzhMkO ZK9JL58OumY4/UJ3EqQHAne8EEcLXEtndi/EfgblywYralx/2Zvz3O+bW9NpVPATyd nj7BcRIep2wZ3nfdfPSmMBXpOHqyGwiYgScgBGztxzN+pKEOfMEaa4TRZBQZrX8giS G0c3Zj/i2E8tQ== From: Mark Brown Date: Thu, 22 May 2025 18:38:51 +0100 Subject: [PATCH 2/4] selftest/mm: Add helper for logging test start and results MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250522-selftests-mm-cow-dedupe-v1-2-713cee2fdd6d@kernel.org> References: <20250522-selftests-mm-cow-dedupe-v1-0-713cee2fdd6d@kernel.org> In-Reply-To: <20250522-selftests-mm-cow-dedupe-v1-0-713cee2fdd6d@kernel.org> To: Andrew Morton , Shuah Khan , David Hildenbrand Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2420; i=broonie@kernel.org; h=from:subject:message-id; bh=BfV3xzhjunrMLDK9cWHpUfmqXZar03TrfugoHRogF2k=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBoL2E7O39pUMyl3dQ+mcq8nzpDDPVlGvzoAqNsnaJP kuc1PSiJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCaC9hOwAKCRAk1otyXVSH0CxUB/ kB2R1vX+3cCm7FLaenjY7igzq8Hh7eHaGLYXArBg5H571Am5bniAKcnivXRgPeUuVslt37mL8BuROS aaDyL+QKrMhKjy5Tr4coNZce7Xaw20QyvfWJvhXCkfyua9huedcQ3f7600VPcdanRDE6XwRfWZPDOQ 08xWB22bzic4y41tqKHz1rNFI3BPQA7HmvMygneY/s/xZBnrKTAV7Q3t7yIbe22X5Uq//Av5zuhot9 5rtiMactb/SJYZ2o2kKXaZAiY/vDuc91RVWZ7KwTfR4/V0po5rAAa8nwlRBfVD/OsPlV163UZJqc7M hDMGlXswISPftH9WB28hrR8BF/y4uC X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Stat-Signature: zesu8s8nr3h4kurdubg4wsxx7rdxci9g X-Rspamd-Queue-Id: A703FC0004 X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1747935557-538527 X-HE-Meta: U2FsdGVkX1+M83OzVkA97HQNO29udTRX0Z86mkmv523ZX4DeR5O8MWhzqem1TBCAWwFN2cvaZcRV5BtZuNc2OKSZyH6yrwqloqFNWnJSM4NhbTkgrvY0Y5Oi1HI0mWxrJigRyzRBPb7q8CmAjiwOX1Z+GBYZR8u2XkVV+ALIjUh+Bmp/YiXkUW4y4MmfBekyHvBgmM0b2QqrW9RSdCSvUBqbux9BgP5Ov7mw8oRAUsFl9WE17fw5C1W3zmjAeIX0y7/slwEp+Nz1g8I62olIrOFjrKhWkiZS0sxQ/ayc0OlzCkA6jyvW3dVD0FR9SrUCMdmULn1w3PtHB9Gl5zTHrWP2Mqax8JhcTJP7QybFhnWQRkqQPI0N/0QRQSskOwoHYTHI6lNDm3YhaGfdZCZ21pZzeMAGgpCc+HhqwooqCbOAUrSiYb5/6faV0xPkl9xy2PO8QHWTHsdqpuwP8NEHlILWuZkayUXbXftER8WZq4pEG8ALXesC96kwVbOYQB0dGRKVM33qhcwXlnts3DkdbFqSvtBMxuJC7P77EROo1ikyJaDyf47qyT1iQ1J2cXqWqV/9SwtxbEDiodhQ2J+m9HU/rp1U3bo76Q3i+4srzpOPRt1vh1GkrPhkBYZ2zif101XhaNHLzVQPOj6GoKtXYRSw2kBnJ2yzqIwJU1bzHRDMx2/IFC8Keh6Qq1TIzHhBJhPQUBoTTpaPI7uddPPWi9X3WjFSzMCe0vhFrkNC3j8G8qbGBx0Vc1PaPWFqOkD59buA+Yyg1H+huVbKDLYR69nC9kFHWPKxabl+sTiOrkw1Lk4OwE0AW/uWVXyukegBulIa3J/12b1qLfARp6tU8FtA5t5NjRpFdW3RzIguvFDDrwTaC9bB/n1zqXk3/14Vlbt1/Ttcmdk1kWDclWWYS0snCW2sstzotq6GarVCLkXMoVjL8WUapJpUe6S/L8uqp5BuEh4U4IiCPguwnxY 0D7pASdv aOElJhIwRzUx59ir1n9xXnM6ipjfXTIzSgtzEKY1wjHNEMfrx2xjj9MNcxbGa2o+gmKiZeQ63mh2Xbog0KysVzM6t9VYPTExWCVxaZEu4yCePJk3YffvhnsfCMOlNj3WJjjclD+LVqVifmuAz35yVG6ikhLZjIX7CvPGlwNW3leJQrinl2VNdQo8IGyXgf+ibLqTZXA8qc6gjn52Rag+0eAJfyAqdmnMsIv7D2qSu7eBUqVbwH9egth/a/3EFvX3sgr46ltRuUGxA4A8L0D8xbgnJTg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Several of the MM tests have a pattern of printing a description of the test to be run then reporting the actual TAP result using a generic string not connected to the specific test, often in a shared function used by many tests. The name reported typically varies depending on the specific result rather than the test too. This causes problems for tooling that works with test results, the names reported with the results are used to deduplicate tests and track them between runs so both duplicated names and changing names cause trouble for things like UIs and automated bisection. As a first step towards matching these tests better with the expectations of kselftest provide helpers which record the test name as part of the initial print and then use that as part of reporting a result. This is not added as a generic kselftest helper partly because the use of a variable to store the test name doesn't fit well with the header only implementation of kselftest.h and partly because it's not really an intended pattern. Ideally at some point the mm tests that use it will be updated to not need it. Signed-off-by: Mark Brown --- tools/testing/selftests/mm/vm_util.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 6effafdc4d8a..4944e4c79051 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -3,6 +3,7 @@ #include #include #include +#include #include /* ffsl() */ #include /* _SC_PAGESIZE */ #include "../kselftest.h" @@ -74,6 +75,25 @@ int uffd_register_with_ioctls(int uffd, void *addr, uint64_t len, unsigned long get_free_hugepages(void); bool check_vmflag_io(void *addr); +/* These helpers need to be inline to match the kselftest.h idiom. */ +static char test_name[1024]; + +static inline void log_test_start(const char *name, ...) +{ + va_list args; + va_start(args, name); + + vsnprintf(test_name, sizeof(test_name), name, args); + ksft_print_msg("[RUN] %s\n", test_name); + + va_end(args); +} + +static inline void log_test_result(int result) +{ + ksft_test_result_report(result, "%s\n", test_name); +} + /* * On ppc64 this will only work with radix 2M hugepage size */ -- 2.39.5