Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp913339lqt; Fri, 7 Jun 2024 02:30:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWthSS5xLGMR/AvMYfEfKKRW82t7I95oabBS0VcA3w1/90UAqJoN+MH3xmlNLLlMyePg4ZzWQ+kiUh3srXEDhWiFfGWYlV6NDWd+woAGQ== X-Google-Smtp-Source: AGHT+IGXHL4rp1lsPwQDYXsMLIf0RntjlGgIwf2ODh4Mo1DDyvri1yGAccaoAEny1z7AYy+qbFtW X-Received: by 2002:a05:6a20:12ce:b0:1b3:fa57:647f with SMTP id adf61e73a8af0-1b3fa57656fmr703978637.31.1717752602733; Fri, 07 Jun 2024 02:30:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717752602; cv=pass; d=google.com; s=arc-20160816; b=Kcu9KcXm6ZFYXU5h8ZbRndV3Kc8LZOcCdONNmXM5e8kt/P33iAJnK0inAdW84itSAr g9oVrQYDms0cns/bbe6ypav2o0Pb1tyM9IQVhpNCtEf1dfJ9VRRxKfOqBe/4XT3wrMLc bRA+bpsVbK6bY9XgFsgNJW/PmyooTdLkR3zkKWzZ08W8qqZAnD4jq9nyQxF7+qaosaMc lVTGVWaYGbSwbB8DDmha/RelDhPdYPzOKX938KoH+cDlnNN5vkR6r25ncbtOgS2KcVsg +o0VCQaV80GsPwEsMyuB6jeOdL1UiDuxoTl049FerOCbWLjGXF9NQCQgm3ILeUB3Td5I 9KNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=jED6M5gH3RYjK5/rTB5Iwp7CAcL8ltMwQc0RkjOqabk=; fh=xag433GPxgyfcCLG5MlL1g2kOnj2205DtBt9mVkxQpw=; b=I7fNUEpkwbArTOgiYW4O/NtXZ9yLx/fcxU+4/OqrCwYsvByKqf0wZG0fQGD1Yi5YWk Zd5vd3d0UdNBsIqqnKB4xKwAGLktb7q5i55sotxxhBh8k8t+bYm0IlBuwvWz/Btl2DjO MkH4bI4TGIQLrXBU/PFashcByTHD6wVUgDqjrSKpcgVo/BvZxlmrJGUYcCgEg36ThCpb FXBDp65O9EZ/J7xR5kjgjQHtoWf7UZP9dmhwBwwtc6+cgLIuQIfoh7mXdS0ynwv1e4Cu fx8NkM5mRSEqkTJajVpKqkUN19ELgqt4wuc+8ZpPPBLWlopEi5k4/Au/AX/2GgurlVVF 9/Rg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-205716-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd81ef18si26875865ad.550.2024.06.07.02.30.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 02:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205716-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-205716-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DC211B23887 for ; Fri, 7 Jun 2024 09:24:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EDB015B96C; Fri, 7 Jun 2024 09:24:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6FBB15B139; Fri, 7 Jun 2024 09:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717752254; cv=none; b=GTq34TCIkxwKT/qzE8UBNW1to5J6nOC7piFqrCb2YleOELVyPbth43lTFMlXR19M3H4QHooY10m1FwGUK0kGXV9505BB05xLXE5kPtbttYZty9VMqMvknkvxkj+1xm4dEy6YrHlllH931VqeWwupt7NjY9ckG4C5+mSdm3LtVi0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717752254; c=relaxed/simple; bh=lrsNpKHlXm+fqyomkyTMZ4TzIB2arKsSoxi2W72FzVg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GboVbkh0qURxH4j4pOaDUVidP5MzFW44K41uYvh4VL/15e4aWCnKZiTYPhhCY4x/RXx2ehUIyiX//JugQ7xscxomfkWitekcvDw5d3oRVO7B5jNe7fj5k2H7lqnpzd2ZtTfwZ5ROzRLkTGDnnth852NYhbSALP6Sx+0CCKLwWNk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7EB3D2F4; Fri, 7 Jun 2024 02:24:35 -0700 (PDT) Received: from [10.57.70.246] (unknown [10.57.70.246]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B5B43F762; Fri, 7 Jun 2024 02:24:09 -0700 (PDT) Message-ID: <4f0732ed-1355-436f-be66-c7486e3cf1e7@arm.com> Date: Fri, 7 Jun 2024 10:24:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests: mm: Make map_fixed_noreplace test names stable Content-Language: en-GB To: Mark Brown , Andrew Morton , Shuah Khan , Muhammad Usama Anjum Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240605-kselftest-mm-fixed-noreplace-v1-1-a235db8b9be9@kernel.org> From: Ryan Roberts In-Reply-To: <20240605-kselftest-mm-fixed-noreplace-v1-1-a235db8b9be9@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 05/06/2024 23:36, Mark Brown wrote: > KTAP parsers interpret the output of ksft_test_result_*() as being the > name of the test. The map_fixed_noreplace test uses a dynamically > allocated base address for the mmap()s that it tests and currently > includes this in the test names that it logs so the test names that are > logged are not stable between runs. It also uses multiples of PAGE_SIZE > which mean that runs for kernels with different PAGE_SIZE configurations > can't be directly compared. Both these factors cause issues for CI > systems when interpreting and displaying results. > > Fix this by replacing the current test names with fixed strings > describing the intent of the mappings that are logged, the existing > messages with the actual addresses and sizes are retained as diagnostic > prints to aid in debugging. > > Fixes: 4838cf70e539 ("selftests/mm: map_fixed_noreplace: conform test to TAP format output") > Signed-off-by: Mark Brown Reviewed-by: Ryan Roberts > --- > tools/testing/selftests/mm/map_fixed_noreplace.c | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > > diff --git a/tools/testing/selftests/mm/map_fixed_noreplace.c b/tools/testing/selftests/mm/map_fixed_noreplace.c > index b74813fdc951..d53de2486080 100644 > --- a/tools/testing/selftests/mm/map_fixed_noreplace.c > +++ b/tools/testing/selftests/mm/map_fixed_noreplace.c > @@ -67,7 +67,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error: munmap failed!?\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() 5*PAGE_SIZE at base\n"); > > addr = base_addr + page_size; > size = 3 * page_size; > @@ -76,7 +77,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error: first mmap() failed unexpectedly\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() 3*PAGE_SIZE at base+PAGE_SIZE\n"); > > /* > * Exact same mapping again: > @@ -93,7 +95,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error:1: mmap() succeeded when it shouldn't have\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() 5*PAGE_SIZE at base\n"); > > /* > * Second mapping contained within first: > @@ -111,7 +114,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error:2: mmap() succeeded when it shouldn't have\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() 2*PAGE_SIZE at base+PAGE_SIZE\n"); > > /* > * Overlap end of existing mapping: > @@ -128,7 +132,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error:3: mmap() succeeded when it shouldn't have\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() 2*PAGE_SIZE at base+(3*PAGE_SIZE)\n"); > > /* > * Overlap start of existing mapping: > @@ -145,7 +150,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error:4: mmap() succeeded when it shouldn't have\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() 2*PAGE_SIZE bytes at base\n"); > > /* > * Adjacent to start of existing mapping: > @@ -162,7 +168,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error:5: mmap() failed when it shouldn't have\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() PAGE_SIZE at base\n"); > > /* > * Adjacent to end of existing mapping: > @@ -179,7 +186,8 @@ int main(void) > dump_maps(); > ksft_exit_fail_msg("Error:6: mmap() failed when it shouldn't have\n"); > } > - ksft_test_result_pass("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_print_msg("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p); > + ksft_test_result_pass("mmap() PAGE_SIZE at base+(4*PAGE_SIZE)\n"); > > addr = base_addr; > size = 5 * page_size; > > --- > base-commit: c3f38fa61af77b49866b006939479069cd451173 > change-id: 20240605-kselftest-mm-fixed-noreplace-44e7e55c861a > > Best regards,