Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp317615rdb; Mon, 22 Jan 2024 23:52:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFYQ0NmdvTtJGQ7nmuwCJ9ATDK9lhAUg+x+LBnyNS1hv2GXg5OqfQc6B1u/a5e1m8IHjix X-Received: by 2002:a05:6214:19c2:b0:685:20b0:e5c7 with SMTP id j2-20020a05621419c200b0068520b0e5c7mr425239qvc.18.1705996338192; Mon, 22 Jan 2024 23:52:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705996338; cv=pass; d=google.com; s=arc-20160816; b=s1LyWgu2eYNDHK1MgcqROxCiSCNagqBwpaEuP0/EgMGNDMWQuZsSSGeTxohL3lDJoS Bc/2i0VTbM2l3lwVysPBxG8CVD2FtPHbVcKELmPwuhgPh8uslMzJs2ajKgoI/UI8Sox6 ccbIcJm79SNx0SXIf2pO4Fn8kXPgTSQSDJDOLZ67XcF6WF+aoFkcNZH2D5PbffZfC0fe KcEb/Atx80RKaTfmsmC8Wj09RHiIruHtTCZ/8A80FemKSzsfbKBhFBQn27t0mdCcUBNs 9Os9xF8vg0ZgdyDviU/jqrznk3LDJxBc/DbPI8dBIUCu7TL/sxkaXkJmA/7aHBuRi/et 2OMg== 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:to :content-language:subject:cc:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=U4jBxtMg1/g50fV2wjOV5C4gWz3brpU0h47v6AWOV64=; fh=kFNNzKGhlVNc2X2/CgOLrRI1EZYCysRtlzpozXRE2gc=; b=NxWuwL9jZXbnyVS9WtMUotkZvY5JTw5Yo1Zk0rs0YxbnWrTuBH5uvp+83qyCwxLMUT /m3vV8EJeeqbUTDxaFxU5F6nqS4pQn3TocNFHq7IHKbh0FfQKJVqTVUlYxsTh0vNeh2L 4d2umq+BnLnLHGzbWvjP3/7mbMyM5zjVFEwJkMv0yE/qpqOYnvHIh2MA9mjtLE3Aj4IA PMwJNw+RiyoSOhS8E+w7pxzJZrWTg6fGz+H+qKrWvOg+P4N3kE1oSsuR+WHH8ii85j03 hBushUHK7Fc5nmRzc0d0qxd2IFWqwZKbZyKlbfC3Yqq0EjDlFOXifUrL++i9k2YMv+iP VMyA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SPfiKPLY; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-34849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a2-20020a0c8bc2000000b006819935f9casi7623330qvc.8.2024.01.22.23.52.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 23:52:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SPfiKPLY; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-34849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DF2FC1C24301 for ; Tue, 23 Jan 2024 07:52:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06AC75473D; Tue, 23 Jan 2024 07:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="SPfiKPLY" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 CD31853E2E; Tue, 23 Jan 2024 07:52:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705996331; cv=none; b=n4E1GrgbZKgXYePcsiEc4qnauty8/Efr+uGeJrsL7omMh++Q0d0jfcK9bTIFYIQXL+uJF5a8d18V3XEzpn3Vvm3sttOq7+5mNzrYvvbc9ugbif7WPOH7BVvXYGxEBhVZiSdN8Iqb06dnP1YkODyJhAj1G4KBSG/eIcAuDCxyXmY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705996331; c=relaxed/simple; bh=K6k2QYxpHaMZ2H7zY/M+E12/FkVtZ9PqhUpBbAY4yvo=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=PmgwfHUIeQ+wlz8ichsNwpp/DiL4v9L1AcdQjF727QV7jODkK0IrpOc3ypPG4qurTkLwtWGvMl/yAghEWdztkJWl66E7mAzMCKvma12w4ibshf+VH47QkRPkG594AyvJ2xAonjMPAnLvXG35mZfsM4+WgUWpCGuwr9FtY1wK/k4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=SPfiKPLY; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705996327; bh=K6k2QYxpHaMZ2H7zY/M+E12/FkVtZ9PqhUpBbAY4yvo=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=SPfiKPLY5BytPAwfWFsIu6RvNfW9rLkcEqNoDbKMXsCTrz1xvBcpDNRrya6jfH+Ho m1lY6Xf0msHKHHHNmB8DcEk7e6pAnWjdti3y0epaeU2Q48Ww/HArLmm4G7iQqZwSFo tYRVhzjvokTH/g1PsYSa7/+SzvlYcO069Yk9F1cgV/b4RYvxjY00oniw8WbJBU2Ilu hxxR3VjqVlkSi0EIZt2mtZrz/6Dv6hA08xobu4BgfKA+iDURWwnmUGXUMuPJTy+r97 kXulpIUNR3tlHZ70027ywlg6kyDui6XrvC6sL7FrHKOXj4nigqyH362YKVNkq7Ioie b9IPvROSQGvIw== Received: from [100.96.234.34] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A1A293782066; Tue, 23 Jan 2024 07:52:05 +0000 (UTC) Message-ID: <965acceb-9aa1-473f-a873-40eaaebe5d0c@collabora.com> Date: Tue, 23 Jan 2024 12:52:20 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan Subject: Re: [PATCH v3 1/7] selftests/mm: hugepage-shm: conform test to TAP format output Content-Language: en-US To: Andrew Morton References: <20240115073247.1280266-1-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: <20240115073247.1280266-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Andrew, There hasn't been any comment on these. I guess, they can be picked up now? Thanks, On 1/15/24 12:32 PM, 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. > > The "." was being printed inside for loop to indicate the writes > progress. This was extraneous and hence removed in the patch. > > Signed-off-by: Muhammad Usama Anjum > --- > tools/testing/selftests/mm/hugepage-shm.c | 47 +++++++++++------------ > 1 file changed, 22 insertions(+), 25 deletions(-) > > diff --git a/tools/testing/selftests/mm/hugepage-shm.c b/tools/testing/selftests/mm/hugepage-shm.c > index 478bb1e989e9..f949dbbc3454 100644 > --- a/tools/testing/selftests/mm/hugepage-shm.c > +++ b/tools/testing/selftests/mm/hugepage-shm.c > @@ -34,11 +34,10 @@ > #include > #include > #include > +#include "../kselftest.h" > > #define LENGTH (256UL*1024*1024) > > -#define dprintf(x) printf(x) > - > /* Only ia64 requires this */ > #ifdef __ia64__ > #define ADDR (void *)(0x8000000000000000UL) > @@ -54,44 +53,42 @@ int main(void) > unsigned long i; > char *shmaddr; > > + ksft_print_header(); > + ksft_set_plan(1); > + > shmid = shmget(2, LENGTH, SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W); > - if (shmid < 0) { > - perror("shmget"); > - exit(1); > - } > - printf("shmid: 0x%x\n", shmid); > + if (shmid < 0) > + ksft_exit_fail_msg("shmget: %s\n", strerror(errno)); > + > + ksft_print_msg("shmid: 0x%x\n", shmid); > > shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS); > if (shmaddr == (char *)-1) { > - perror("Shared memory attach failure"); > shmctl(shmid, IPC_RMID, NULL); > - exit(2); > + ksft_exit_fail_msg("Shared memory attach failure: %s\n", strerror(errno)); > } > - printf("shmaddr: %p\n", shmaddr); > > - dprintf("Starting the writes:\n"); > - for (i = 0; i < LENGTH; i++) { > + ksft_print_msg("shmaddr: %p\n", shmaddr); > + > + ksft_print_msg("Starting the writes:"); > + for (i = 0; i < LENGTH; i++) > shmaddr[i] = (char)(i); > - if (!(i % (1024 * 1024))) > - dprintf("."); > - } > - dprintf("\n"); > + ksft_print_msg("Done.\n"); > > - dprintf("Starting the Check..."); > + ksft_print_msg("Starting the Check..."); > for (i = 0; i < LENGTH; i++) > - if (shmaddr[i] != (char)i) { > - printf("\nIndex %lu mismatched\n", i); > - exit(3); > - } > - dprintf("Done.\n"); > + if (shmaddr[i] != (char)i) > + ksft_exit_fail_msg("\nIndex %lu mismatched\n", i); > + ksft_print_msg("Done.\n"); > > if (shmdt((const void *)shmaddr) != 0) { > - perror("Detach failure"); > shmctl(shmid, IPC_RMID, NULL); > - exit(4); > + ksft_exit_fail_msg("Detach failure: %s\n", strerror(errno)); > } > > shmctl(shmid, IPC_RMID, NULL); > > - return 0; > + ksft_test_result_pass("Completed test\n"); > + > + ksft_finished(); > } -- BR, Muhammad Usama Anjum