Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19277001rwd; Wed, 28 Jun 2023 07:20:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yLBi/GALUb8Ezsy4eembHu3GX6UkMB7TrQZDS+p7fsDeT6bs5dmZK+A8nT7zOZR6k1AvZ X-Received: by 2002:aa7:df13:0:b0:51d:9b4d:66bd with SMTP id c19-20020aa7df13000000b0051d9b4d66bdmr6560918edy.9.1687962055322; Wed, 28 Jun 2023 07:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687962055; cv=none; d=google.com; s=arc-20160816; b=sMrRokAn2ZjwFES3GZUdBKK5m2fYDjPzJvhx4AIIvhqrqwhmvV/ItC0pJqysWyg3jX OwUG53gDw89c0HisfVsfp43+oICOtlknnEwnscYSseoMbXRSwMJVNH2KsoHXqcS3mCcT AOjFLSe2zIM/bADYYpDWlyZlU1HnevMrGTbnMHtccDM5bhIBUn9ff/U5Z4JBt0SxvpI6 cAW6V/OSxSHLPOwnqz3gCX8kNv/+MY/4Feir4SMaOtRlKHD6NwIIkO8v2JA+4HrgPvPg eLfEvjKO1yDqeq4oUsa15LHhpMjTk+bgA4FunxopntlXb1aHuJV4+ys7MpWgy7qlIbPS HIwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=jx1H3w34ACIMaLVWvSca81U4jwC/GKx0y7Ovlp56PX4=; fh=uqnq0Qb/7FVIdzrFugyD8nVYSOX7Xb9Jl3IPgYgQixw=; b=aOZj54Y5wmPh1WP9Q3ULGtFhzSJgVudf+MhsTwlZ4LsaaCLqpqw0MoxNJGaLcrKu0p YhttEnabd+CZtGEmcVRMNvPna0T+s3tzZDkSrZw7EwclKUKi7GRWNKqdN5adkiVPBvFv JLmvBCzDgzVhkhAxKtFTOE48e99GqsKixiUxVGGGHssdcQDJ3LGtzF6yZ5atS0CGTIlT nE4BArFE9xub98jdzf8EdXaIdVxdL58kyWtjnV6TC25dDVlwZjMScoB9aennziwhURk+ VkFY3rXUyeeHps/rTqejCmoyv1Vd5u36v0f9f1siDDtU8hTkWgX0ZcrTYqpxD3/06Ha0 pcyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u5-20020aa7d985000000b0051db006e404si1774537eds.168.2023.06.28.07.20.29; Wed, 28 Jun 2023 07:20:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbjF1N7j (ORCPT + 99 others); Wed, 28 Jun 2023 09:59:39 -0400 Received: from bg4.exmail.qq.com ([43.154.54.12]:32819 "EHLO bg4.exmail.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230270AbjF1N7i (ORCPT ); Wed, 28 Jun 2023 09:59:38 -0400 X-QQ-mid: bizesmtp81t1687960768txfbx7ok Received: from linux-lab-host.localdomain ( [116.30.129.193]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 28 Jun 2023 21:59:27 +0800 (CST) X-QQ-SSF: 01200000000000D0V000000A0000000 X-QQ-FEAT: 3M0okmaRx3gDav7CaNYoc8l+gmSORKcvAWMjW8AYWgV1jU5Cu6ZsaZwBaB68o WDWE0r+dSiN0x+n3VgqosM3HGI/3cZAsOnoUeGBXRXE91kEo6cx+oj3gGeAV8AtOiIuFge/ YH/PQ8SvRi/6iaEuxLVPTi2sEg2H1+3vFa78BrUIxt9mNxf2ZEOdKyGjePmvTMTHm7k4zK9 xc1A1TFNJ15UKf4YfFJMQJgHStQTDvG+pPE7SqGDp682hXeP7TnY8IbrileQdKVjq+jwlRF rEp+YO8Aon5IAJA65PldOBwyY/67znldtuDH1KmC9gLa0mbzqj4ygh35T0HwR3OfwgboAV0 Rdm1yCF1xLaXgxkesOKe9tXO2qZ38CT+KjHI44uQCWVAZhVlteIZ7IWUddcMG+ZqgC8slOA X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5794258169231260803 From: Zhangjin Wu To: falcon@tinylab.org, thomas@t-8ch.de Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, w@1wt.eu Subject: [PATCH v1 05/17] selftests/nolibc: stat_timestamps: remove procfs dependency Date: Wed, 28 Jun 2023 21:59:22 +0800 Message-Id: <20230628135922.97298-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <5f80f3dae60f77c6b746578113e56c8fa6454143.1687344643.git.falcon@tinylab.org> References: <5f80f3dae60f77c6b746578113e56c8fa6454143.1687344643.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrsz:qybglogicsvrsz3a-3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thomas I'm preparing a revision for this series, in the past days, when I was working on testing our new 'minimal' kernel config support for all of the architectures, the time cost (and wait) is really appreciable and the repeated develop and test is really a big pain, I can also image when you was working on stack-protector and Willy was working on lots of old features ;-) As you explained before, I knew the idea of using '/proc/self' here is important to not using a fixed-time file, besides our proposed method (make sure it at least not fail, just skip for !procfs): - CASE_TEST(stat_timestamps); EXPECT_SYSZR(1, test_stat_timestamps()); break; + CASE_TEST(stat_timestamps); EXPECT_SYSZR(proc, test_stat_timestamps()); break; To further avoid skip it for !procfs (I don't mean relaly disable it for the default tinyconfig support, which need more discuss, at least provide the possibility to pass without procfs), do you like this change? it doesn't depend on 'proc' now. - if (stat("/proc/self/", &st)) + if (stat("/proc/self/", &st) && stat("/init", &st) && stat("/", &st)) The "/init" is compiled for 'run' target every time, so, the time stamp should be dynamic enough, for libc-test, the /proc/self should be always there (if still not enough, we can reuse the init file list here), the "/" here is only for the worst-case scene ;-) Thanks, Zhangjin > Since it is not really necessary to use /proc/self here, instead of > adding a condition check, we use the always existing '/' path instead of > /proc/self, this eventually let it work without procfs. > > Signed-off-by: Zhangjin Wu > --- > tools/testing/selftests/nolibc/nolibc-test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c > index ebec948ec808..2ef44176f7a9 100644 > --- a/tools/testing/selftests/nolibc/nolibc-test.c > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > @@ -520,7 +520,7 @@ static int test_stat_timestamps(void) > if (sizeof(st.st_atim.tv_sec) != sizeof(st.st_atime)) > return 1; > > - if (stat("/proc/self/", &st)) > + if (stat("/", &st)) > return 1; > > if (st.st_atim.tv_sec != st.st_atime || st.st_atim.tv_nsec > 1000000000) > -- > 2.25.1