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 D7D52C3DA79 for ; Mon, 15 Jan 2024 06:52:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 684926B007E; Mon, 15 Jan 2024 01:52:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 634786B0080; Mon, 15 Jan 2024 01:52:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D4936B0081; Mon, 15 Jan 2024 01:52:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3BE0B6B007E for ; Mon, 15 Jan 2024 01:52:32 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F31631207C5 for ; Mon, 15 Jan 2024 06:52:31 +0000 (UTC) X-FDA: 81680626902.10.F7FD48C Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by imf27.hostedemail.com (Postfix) with ESMTP id 3AA9E4000A for ; Mon, 15 Jan 2024 06:52:30 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=06lOMNTT; spf=pass (imf27.hostedemail.com: domain of jiaqiyan@google.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=jiaqiyan@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705301550; 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=TcGqD0gtcFtuZcZ7u66zOaQO/inZ6mabGTo1Ra0lyoY=; b=puEIST6Rs1AHN+JXcbyLCfzHtTD9gG/3ieESo3M/Mvajzg989eLyf7PhU1eSMS21pLmoGR lha6hUog+0XujQXkzEogVZkp6w6MPbCZP9EcUgcDX3+5oMLV4tHda4AGBH+KIKE8ff0Z5n 9bZi6rWUH4JkRs8jfSnlHBTexm9Lm4U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705301550; a=rsa-sha256; cv=none; b=d++YwYfsWuvvvUplVRGI9XAd4IxlK2XtHyPkDDNlbmmphBcrCH4Wv/Impned5RoqG5lt2M IZkzGacyGULC/OL78EVkXZW+2+XwyXAGjICgXA0/7WU4IhnDHpECbKptZudt7UshjVTsAm 9N4YjHMFuUgOrRXDE/KcK9FK6sGX3DM= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=06lOMNTT; spf=pass (imf27.hostedemail.com: domain of jiaqiyan@google.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=jiaqiyan@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-dbed729a51eso6979528276.0 for ; Sun, 14 Jan 2024 22:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705301549; x=1705906349; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TcGqD0gtcFtuZcZ7u66zOaQO/inZ6mabGTo1Ra0lyoY=; b=06lOMNTTMoXJXgvSeolLiAK5J9YjUxPH3mmVAr08b/zXxPd+Mzt+msG1kp/Y8RUWed naWA0Mfc70StpYa6Pu1qCrO+wKPBLQYN/njLAnxX8ehUSwAQmM94JqSb4Nxae9s8cMWx IuKzzsbj22HzFhgn+9/LvJv1iJ4NUc15pGyUB2tk048Oy9Py8+soFxLM+e4EJRNoOOmx /tTd/BZjhbMOSW/OYWGv5juW1vO6doAtZPEoceWX9uHI2gGT9makiKe4GWcoOdTNBHnb V7uwjpSJ1ukqfQGfVRD++46JkDGW2x+jeD/1r39/KAtdFA22oOj1M0enZarScDf2sgMv vs1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705301549; x=1705906349; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TcGqD0gtcFtuZcZ7u66zOaQO/inZ6mabGTo1Ra0lyoY=; b=w7/SVzaTi4m3hgPVwPIMNYXRnAUilPdHPwkGnTPxI4iRX8UY//dED3cST3Z9ov8lb2 B+lKu/7iwP+0ZkmJeRua3FgL1GKL7b74rX6+WWLV+3sWTRwHKsafXG3zk9w+26O+459V w6T2CMPwjStQSCWTend1PTi49E85VkP7qc6FOKSCV2jHk1X1l0462v0n7QYvaFQgoFDw khnhC1GuRFcbC3pVIYlXHw4Nei3Ou2Zo4XKMNuvjA3NWxohAjc3M7OgXEC0XTvJRHgLm IKa1vnBgoP3ZWL4VvilNa+FZ2CX41kyl20K6UfbR9OGsVYYXg8LeuFUGX6sNE/7L9AYp vVyA== X-Gm-Message-State: AOJu0YzxA4t8LAjsOqbXp5JnS30myPP4cUpKAn9Y8A5h0vH9GsKLhk8+ wAI/S5WdqoyB3h9EGMFc/3HqpX/YmcGSv4p6am1z5O9xt7SB+8Lf0HaHwHTvgzF7 X-Google-Smtp-Source: AGHT+IFOsPa7sJyXBjQzRjtNJAbXpF0xdrOIkcc43KF1+7HJ0A2Q5sACGMkY1TIfBxhwqsac+A4ctLWTvO2OFRFlPh0= X-Received: by 2002:a25:8a01:0:b0:dbd:a56e:891c with SMTP id g1-20020a258a01000000b00dbda56e891cmr1980810ybl.2.1705301548996; Sun, 14 Jan 2024 22:52:28 -0800 (PST) MIME-Version: 1.0 References: <20240112072144.620098-1-usama.anjum@collabora.com> <20240112072144.620098-5-usama.anjum@collabora.com> <0b5a7c8c-d46b-496c-b705-fafc54a91ff0@collabora.com> In-Reply-To: <0b5a7c8c-d46b-496c-b705-fafc54a91ff0@collabora.com> From: Jiaqi Yan Date: Sun, 14 Jan 2024 22:52:16 -0800 Message-ID: Subject: Re: [PATCH v2 5/7] selftests/mm: hugetlb-read-hwpoison: conform test to TAP format output To: Muhammad Usama Anjum Cc: Andrew Morton , Shuah Khan , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 3AA9E4000A X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: b8iyfiho6wd4z1mr3bxkj8nbmsarzedz X-HE-Tag: 1705301550-674887 X-HE-Meta: U2FsdGVkX1/0EOPaXPM/wPpGpMAMUM7KfgISXrXcmpOXqaIhVW9PzCHv3zWJUtqeyXN+nTd3o6iWwsQFa3/Jjm0TpCZhef+7eYHKynXuNqCX/jWnqb1Q21QweaTFF3oOm2By0u3B7Jv+8LJb4IpB6U+ZGmB5VYZ9gn/CAfEGTUHVNQUbU0sdH/ZbZcOhh5A6q9AHfrZWdUYcPeoSlnixA+r7qRwVyztPGV47pD8EVKX36CYjpWu4HQ3aFAHJFonRNadETStH0lnfWPaWZsltMEUtHDBpawbcGFqCAUCvQEAr9iM4cyzO0L8cOWi3wq6KrhE9r6gpsTfdZSLtljAUQsKl5VPf8LDHfb12p90iarQPtBlnrNrXrAX4lbExw+Up0DucafHfi1F/p0c6y83/MyMqkptMmRRtWqmUczud20xpaYKip0uthVegP3nuvwLGAvsmDX+0uQQLIzpBGekMeltfFsWt+PJ95AtpIj+j76W3P8mBJIrFcxCRMEHUMQI454z9UCB+NCpKLI5I1tvrZGDH0w4Ugca3srna11krb6hATmlXDWUwyr4siaopsg/NqJY9kdFGyTbx3b7okzmAac4b7VnF31F/1C283PG/8mBqnUC0nC0XBYqWT2eS8l7thYJNQn7RPVSBRdaK3ZLWIGu/kXb+BVgx1gXvLwk/lVcfXjlk0stnWL4gsSSpBjqDA7/w66LPt/Y0bzwC72pXZOhJ0mswQ+VJFO7sIQmn2I0fB6xEIEmS30EcXEm5VKRcMpXPB9Gb2XIQd9tW+RzLwF570kg/8pry72HymTa6rN5bUsLsMJWkxMHB/dB/3KGkYxDOoMvCh0XPr4MiJxZLCbQIbg12COloR3zx5+UIDegd95FdFb3AAnW65XBvHzT1eaODrsyrlELlBD9K3FrW4WgYSPzdeqAiVuSIJyHWG23nlUWUpr8psoHCOmD6ijk3ObFTfI/l90aZgpbQsMj ht/UfZGH Lz+bArJUJXsgepQrWCA0lebfapwMex33n6nytbAWd2wJ0cz85IvlNlI2N6Tg61tmM4DekshWmwrSHeRZYK9HA3JEnqnmPqC5CVGE9G22oJA9k2KMHJkjnWAMcsO3+KXGuS1dr0Ook3sJKxjhJeeGtHu+b+GUnB28feqddVmFgJ/gkJfEiS+R40kwM1GhfBpjZITSqaUqma3iNM4p/tdcb7Ljq+AaaSUn7u4AxMHN8daHfZ9+BawLybj6HMk66a5NHU20MKUQrHHz70vB6HCYSUZhiV7+btHfI8/O0/oKH7FDDs6LqR4RClzJ7/Zhu6VFG4FjyScjtVWodtwi7gvIlL/ri+i0v34tgtXm7erVW25kCxWwTXU0xg41Zm0Ex3On7OAd7SULjgdOvwd0= 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: On Sun, Jan 14, 2024 at 10:32=E2=80=AFPM Muhammad Usama Anjum wrote: > > On 1/13/24 6:08 AM, Jiaqi Yan wrote: > > On Thu, Jan 11, 2024 at 11:21=E2=80=AFPM Muhammad Usama Anjum > > wrote: > >> > >> Conform the layout, informational and status messages to TAP. No > >> functional change is intended other than the layout of output messages= . > >> > >> Signed-off-by: Muhammad Usama Anjum > >> --- > >> Tested this by reverting the patch a08c7193e4f18dc8508f2d07d0de2c5b94c= b39a3 > >> ("mm/filemap: remove hugetlb special casing in filemap.c") as it has > >> broken the test. The bug report can be found at [1]. > >> > >> Tested with proposed fix as well [2]. > >> > >> [1] https://lore.kernel.org/all/079335ab-190f-41f7-b832-6ffe7528fd8b@c= ollabora.com > >> [2] https://lore.kernel.org/all/a20e7bdb-7344-306d-e8f5-5ee69af7d5ea@o= racle.com > >> --- > >> .../selftests/mm/hugetlb-read-hwpoison.c | 116 +++++++++--------= - > >> 1 file changed, 56 insertions(+), 60 deletions(-) > >> > >> diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tool= s/testing/selftests/mm/hugetlb-read-hwpoison.c > >> index ba6cc6f9cabc..193ad7275df5 100644 > >> --- a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c > >> +++ b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c > >> @@ -58,8 +58,8 @@ static bool verify_chunk(char *buf, size_t len, char= val) > >> > >> for (i =3D 0; i < len; ++i) { > >> if (buf[i] !=3D val) { > >> - printf(PREFIX ERROR_PREFIX "check fail: buf[%l= u] =3D %u !=3D %u\n", > >> - i, buf[i], val); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "check fail= : buf[%lu] =3D %u !=3D %u\n", > >> + i, buf[i], val); > >> return false; > >> } > >> } > >> @@ -75,9 +75,9 @@ static bool seek_read_hugepage_filemap(int fd, size_= t len, size_t wr_chunk_size, > >> ssize_t total_ret_count =3D 0; > >> char val =3D offset / wr_chunk_size + offset % wr_chunk_size; > >> > >> - printf(PREFIX PREFIX "init val=3D%u with offset=3D0x%lx\n", va= l, offset); > >> - printf(PREFIX PREFIX "expect to read 0x%lx bytes of data in to= tal\n", > >> - expected); > >> + ksft_print_msg(PREFIX PREFIX "init val=3D%u with offset=3D0x%l= x\n", val, offset); > >> + ksft_print_msg(PREFIX PREFIX "expect to read 0x%lx bytes of da= ta in total\n", > >> + expected); > >> if (lseek(fd, offset, SEEK_SET) < 0) { > >> perror(PREFIX ERROR_PREFIX "seek failed"); > >> return false; > >> @@ -86,7 +86,7 @@ static bool seek_read_hugepage_filemap(int fd, size_= t len, size_t wr_chunk_size, > >> while (offset + total_ret_count < len) { > >> ret_count =3D read(fd, buf, wr_chunk_size); > >> if (ret_count =3D=3D 0) { > >> - printf(PREFIX PREFIX "read reach end of the fi= le\n"); > >> + ksft_print_msg(PREFIX PREFIX "read reach end o= f the file\n"); > >> break; > >> } else if (ret_count < 0) { > >> perror(PREFIX ERROR_PREFIX "read failed"); > >> @@ -98,8 +98,8 @@ static bool seek_read_hugepage_filemap(int fd, size_= t len, size_t wr_chunk_size, > >> > >> total_ret_count +=3D ret_count; > >> } > >> - printf(PREFIX PREFIX "actually read 0x%lx bytes of data in tot= al\n", > >> - total_ret_count); > >> + ksft_print_msg(PREFIX PREFIX "actually read 0x%lx bytes of dat= a in total\n", > >> + total_ret_count); > >> > >> return total_ret_count =3D=3D expected; > >> } > >> @@ -112,15 +112,15 @@ static bool read_hugepage_filemap(int fd, size_t= len, > >> ssize_t total_ret_count =3D 0; > >> char val =3D 0; > >> > >> - printf(PREFIX PREFIX "expect to read 0x%lx bytes of data in to= tal\n", > >> - expected); > >> + ksft_print_msg(PREFIX PREFIX "expect to read 0x%lx bytes of da= ta in total\n", > >> + expected); > >> while (total_ret_count < len) { > >> ret_count =3D read(fd, buf, wr_chunk_size); > >> if (ret_count =3D=3D 0) { > >> - printf(PREFIX PREFIX "read reach end of the fi= le\n"); > >> + ksft_print_msg(PREFIX PREFIX "read reach end o= f the file\n"); > >> break; > >> } else if (ret_count < 0) { > >> - perror(PREFIX ERROR_PREFIX "read failed"); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "read faile= d"); > > > > Should we also include strerror(errno) in log msg, like you did below? > Looks like I missed it. I'll post a v3. > > > > Actually, would ksft_perror be a better choice for perror()s? > It may or may not be. There aren't ksft_*_perror macros for printing the > logs at this time. I prefer using just whatever macros are available. The= y > aren't generic enough. Maybe mm tests use perror whenever error occurs, b= ut > other tests don't. can't you use this ksft_perror available today? https://github.com/torvalds/linux/blob/master/tools/testing/selftests/kself= test.h#L161C25-L172 > > > > >> > >> break; > >> } > >> ++val; > >> @@ -129,8 +129,8 @@ static bool read_hugepage_filemap(int fd, size_t l= en, > >> > >> total_ret_count +=3D ret_count; > >> } > >> - printf(PREFIX PREFIX "actually read 0x%lx bytes of data in tot= al\n", > >> - total_ret_count); > >> + ksft_print_msg(PREFIX PREFIX "actually read 0x%lx bytes of dat= a in total\n", > >> + total_ret_count); > >> > >> return total_ret_count =3D=3D expected; > >> } > >> @@ -142,14 +142,15 @@ test_hugetlb_read(int fd, size_t len, size_t wr_= chunk_size) > >> char *filemap =3D NULL; > >> > >> if (ftruncate(fd, len) < 0) { > >> - perror(PREFIX ERROR_PREFIX "ftruncate failed"); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "ftruncate failed: = %s\n", strerror(errno)); > >> return status; > >> } > >> > >> filemap =3D mmap(NULL, len, PROT_READ | PROT_WRITE, > >> MAP_SHARED | MAP_POPULATE, fd, 0); > >> if (filemap =3D=3D MAP_FAILED) { > >> - perror(PREFIX ERROR_PREFIX "mmap for primary mapping f= ailed"); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "mmap for primary m= apping failed: %s\n", > >> + strerror(errno)); > >> goto done; > >> } > >> > >> @@ -162,7 +163,8 @@ test_hugetlb_read(int fd, size_t len, size_t wr_ch= unk_size) > >> munmap(filemap, len); > >> done: > >> if (ftruncate(fd, 0) < 0) { > >> - perror(PREFIX ERROR_PREFIX "ftruncate back to 0 failed= "); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "ftruncate back to = 0 failed : %s\n", > >> + strerror(errno)); > >> status =3D TEST_FAILED; > >> } > >> > >> @@ -179,14 +181,15 @@ test_hugetlb_read_hwpoison(int fd, size_t len, s= ize_t wr_chunk_size, > >> const unsigned long pagesize =3D getpagesize(); > >> > >> if (ftruncate(fd, len) < 0) { > >> - perror(PREFIX ERROR_PREFIX "ftruncate failed"); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "ftruncate failed: = %s\n", strerror(errno)); > >> return status; > >> } > >> > >> filemap =3D mmap(NULL, len, PROT_READ | PROT_WRITE, > >> MAP_SHARED | MAP_POPULATE, fd, 0); > >> if (filemap =3D=3D MAP_FAILED) { > >> - perror(PREFIX ERROR_PREFIX "mmap for primary mapping f= ailed"); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "mmap for primary m= apping failed: %s\n", > >> + strerror(errno)); > >> goto done; > >> } > >> > >> @@ -201,7 +204,7 @@ test_hugetlb_read_hwpoison(int fd, size_t len, siz= e_t wr_chunk_size, > >> */ > >> hwp_addr =3D filemap + len / 2 + pagesize; > >> if (madvise(hwp_addr, pagesize, MADV_HWPOISON) < 0) { > >> - perror(PREFIX ERROR_PREFIX "MADV_HWPOISON failed"); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "MADV_HWPOISON fail= ed: %s\n", strerror(errno)); > >> goto unmap; > >> } > >> > >> @@ -228,7 +231,8 @@ test_hugetlb_read_hwpoison(int fd, size_t len, siz= e_t wr_chunk_size, > >> munmap(filemap, len); > >> done: > >> if (ftruncate(fd, 0) < 0) { > >> - perror(PREFIX ERROR_PREFIX "ftruncate back to 0 failed= "); > >> + ksft_print_msg(PREFIX ERROR_PREFIX "ftruncate back to = 0 failed: %s\n", > >> + strerror(errno)); > >> status =3D TEST_FAILED; > >> } > >> > >> @@ -240,27 +244,32 @@ static int create_hugetlbfs_file(struct statfs *= file_stat) > >> int fd; > >> > >> fd =3D memfd_create("hugetlb_tmp", MFD_HUGETLB); > >> - if (fd < 0) { > >> - perror(PREFIX ERROR_PREFIX "could not open hugetlbfs f= ile"); > >> - return -1; > >> - } > >> + if (fd < 0) > >> + ksft_exit_fail_msg(PREFIX ERROR_PREFIX "could not open= hugetlbfs file: %s\n", > >> + strerror(errno)); > >> > >> memset(file_stat, 0, sizeof(*file_stat)); > >> + > >> if (fstatfs(fd, file_stat)) { > >> - perror(PREFIX ERROR_PREFIX "fstatfs failed"); > >> - goto close; > >> + close(fd); > >> + ksft_exit_fail_msg(PREFIX ERROR_PREFIX "fstatfs failed= : %s\n", strerror(errno)); > >> } > >> if (file_stat->f_type !=3D HUGETLBFS_MAGIC) { > >> - printf(PREFIX ERROR_PREFIX "not hugetlbfs file\n"); > >> - goto close; > >> + close(fd); > >> + ksft_exit_fail_msg(PREFIX ERROR_PREFIX "not hugetlbfs = file\n"); > >> } > >> > >> return fd; > >> -close: > >> - close(fd); > >> - return -1; > >> } > >> > >> +#define KSFT_PRINT_MSG(status, fmt, ...) = \ > >> + do { = \ > >> + if (status =3D=3D TEST_SKIPPED) = \ > >> + ksft_test_result_skip(fmt, __VA_ARGS__); = \ > >> + else = \ > >> + ksft_test_result(status =3D=3D TEST_PASSED, fm= t, __VA_ARGS__); \ > >> + } while (0) > >> + > >> int main(void) > >> { > >> int fd; > >> @@ -273,50 +282,37 @@ int main(void) > >> }; > >> size_t i; > >> > >> + ksft_print_header(); > >> + ksft_set_plan(12); > >> + > >> for (i =3D 0; i < ARRAY_SIZE(wr_chunk_sizes); ++i) { > >> - printf("Write/read chunk size=3D0x%lx\n", > >> - wr_chunk_sizes[i]); > >> + ksft_print_msg("Write/read chunk size=3D0x%lx\n", > >> + wr_chunk_sizes[i]); > >> > >> fd =3D create_hugetlbfs_file(&file_stat); > >> - if (fd < 0) > >> - goto create_failure; > >> - printf(PREFIX "HugeTLB read regression test...\n"); > >> + ksft_print_msg(PREFIX "HugeTLB read regression test...= \n"); > >> status =3D test_hugetlb_read(fd, file_stat.f_bsize, > >> wr_chunk_sizes[i]); > >> - printf(PREFIX "HugeTLB read regression test...%s\n", > >> - status_to_str(status)); > >> + KSFT_PRINT_MSG(status, PREFIX "HugeTLB read regression= test...%s\n", > >> + status_to_str(status)); > >> close(fd); > >> - if (status =3D=3D TEST_FAILED) > >> - return -1; > >> > >> fd =3D create_hugetlbfs_file(&file_stat); > >> - if (fd < 0) > >> - goto create_failure; > >> - printf(PREFIX "HugeTLB read HWPOISON test...\n"); > >> + ksft_print_msg(PREFIX "HugeTLB read HWPOISON test...\n= "); > >> status =3D test_hugetlb_read_hwpoison(fd, file_stat.f_= bsize, > >> wr_chunk_sizes[i],= false); > >> - printf(PREFIX "HugeTLB read HWPOISON test...%s\n", > >> - status_to_str(status)); > >> + KSFT_PRINT_MSG(status, PREFIX "HugeTLB read HWPOISON t= est..%s\n", > >> + status_to_str(status)); > >> close(fd); > >> - if (status =3D=3D TEST_FAILED) > >> - return -1; > >> > >> fd =3D create_hugetlbfs_file(&file_stat); > >> - if (fd < 0) > >> - goto create_failure; > >> - printf(PREFIX "HugeTLB seek then read HWPOISON test...= \n"); > >> + ksft_print_msg(PREFIX "HugeTLB seek then read HWPOISON= test...\n"); > >> status =3D test_hugetlb_read_hwpoison(fd, file_stat.f_= bsize, > >> wr_chunk_sizes[i],= true); > >> - printf(PREFIX "HugeTLB seek then read HWPOISON test...= %s\n", > >> - status_to_str(status)); > >> + KSFT_PRINT_MSG(status, PREFIX "HugeTLB seek then read = HWPOISON test...%s\n", > >> + status_to_str(status)); > >> close(fd); > >> - if (status =3D=3D TEST_FAILED) > >> - return -1; > >> } > >> > >> - return 0; > >> - > >> -create_failure: > >> - printf(ERROR_PREFIX "Abort test: failed to create hugetlbfs fi= le\n"); > >> - return -1; > >> + ksft_finished(); > >> } > >> -- > >> 2.42.0 > >> > >> > > > > -- > BR, > Muhammad Usama Anjum