From patchwork Fri Mar 4 10:38:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12768938 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40869C433F5 for ; Fri, 4 Mar 2022 10:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236135AbiCDKkU (ORCPT ); Fri, 4 Mar 2022 05:40:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236165AbiCDKkS (ORCPT ); Fri, 4 Mar 2022 05:40:18 -0500 Received: from esa11.hc1455-7.c3s2.iphmx.com (esa11.hc1455-7.c3s2.iphmx.com [207.54.90.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B120117ED9B; Fri, 4 Mar 2022 02:39:29 -0800 (PST) IronPort-SDR: 99OgVtSJNOWFx2gCepKjFLs5kcjH1fJ6ZO63J02raI5ccdKOqseXVitSmv/sgnPa+R688bXjH3 P9/JMZKPg1S9TTRWW+171oSUishiu6cUg8XfD1CxPOGgravV77kfeOyw5WNFM0jQwCzWkxdbBw IgqimyPzYRgWbo4J0JWF4oFUzQgTqanyx4iq5vGzb5Fh2soHbXNQG1ubZKEIIXV43mnBXb3LCc 55jGpVsqciT7EE1Bgd+zd9/6CVdV5iw8KC/sH0hlnDR0PcWrT6OfzkoVABz4K8xqu7IIthFN1n y0V5aDqgcfpJ8XwfqwSC/YO6 X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="44657797" X-IronPort-AV: E=Sophos;i="5.90,154,1643641200"; d="scan'208";a="44657797" Received: from unknown (HELO yto-r4.gw.nic.fujitsu.com) ([218.44.52.220]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Mar 2022 19:39:26 +0900 Received: from yto-m2.gw.nic.fujitsu.com (yto-nat-yto-m2.gw.nic.fujitsu.com [192.168.83.65]) by yto-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id 13263D7704; Fri, 4 Mar 2022 19:39:26 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by yto-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id A55DF1ED62F; Fri, 4 Mar 2022 19:39:24 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id 6797340450F6A; Fri, 4 Mar 2022 19:39:24 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com, Shuah Khan Subject: [PATCH v4 1/6] selftests/resctrl: Kill child process before parent process terminates if SIGTERM is received Date: Fri, 4 Mar 2022 19:38:29 +0900 Message-Id: <20220304103834.486892-2-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> References: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org In kselftest framework, a sub test is run using the timeout utility and it will send SIGTERM to the test upon timeout. In resctrl_tests, a child process is created by fork() to run benchmark but SIGTERM is not set in sigaction(). If SIGTERM signal is received, the parent process will be killed, but the child process still exists. kill child process before parent process terminates if SIGTERM signal is received. Reviewed-by: Shuah Khan Signed-off-by: Shaopeng Tan --- tools/testing/selftests/resctrl/resctrl_val.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 95224345c78e..b32b96356ec7 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -678,6 +678,7 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param) sigemptyset(&sigact.sa_mask); sigact.sa_flags = SA_SIGINFO; if (sigaction(SIGINT, &sigact, NULL) || + sigaction(SIGTERM, &sigact, NULL) || sigaction(SIGHUP, &sigact, NULL)) { perror("# sigaction"); ret = errno; From patchwork Fri Mar 4 10:38:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12768939 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAF92C433EF for ; Fri, 4 Mar 2022 10:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236192AbiCDKkZ (ORCPT ); Fri, 4 Mar 2022 05:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbiCDKkY (ORCPT ); Fri, 4 Mar 2022 05:40:24 -0500 Received: from esa4.hc1455-7.c3s2.iphmx.com (esa4.hc1455-7.c3s2.iphmx.com [68.232.139.117]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2029117CC47; Fri, 4 Mar 2022 02:39:35 -0800 (PST) IronPort-SDR: fsgG0/gjIi5acOHtx6D6MiIuVKwoe/VpW5F4YQCOg5fT7fWvatHfzwWt2hu8PB2d7nDqBfF/em +sBuN6BMzggvszGd1kV9anmLXXvZHfF3Z0QOWT8dvLujOq9qfBILOC83XABIt0lVypTYHXMQz9 avMvmBZp8BwyECPL7u+22SVpJn+kxxrvlD8XL0ITke6HldJdNMEFlNcQWIM9KJ9Bhjuee6GVlp jchL+1NWxPqPFRe4G8zmsfjYMJ9sIHQZSBqjm36FGS2thFVYwhhQvg5Ra70NHcMZEAFPIaoEP6 9HelEAeLWMYaa4qtQ0BeaQKl X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="64939550" X-IronPort-AV: E=Sophos;i="5.90,154,1643641200"; d="scan'208";a="64939550" Received: from unknown (HELO oym-r4.gw.nic.fujitsu.com) ([210.162.30.92]) by esa4.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Mar 2022 19:39:32 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id CB81031311; Fri, 4 Mar 2022 19:39:31 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 5078DFF2A; Fri, 4 Mar 2022 19:39:30 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id 282BE40451C6F; Fri, 4 Mar 2022 19:39:30 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com, Shuah Khan Subject: [PATCH v4 2/6] selftests/resctrl: Change the default limited time to 120 seconds Date: Fri, 4 Mar 2022 19:38:30 +0900 Message-Id: <20220304103834.486892-3-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> References: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org When testing on a Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz the resctrl selftests fail due to timeout after exceeding the default time limit of 45 seconds. On this system the test takes about 68 seconds. Since the failing test by default accesses a fixed size of memory, the execution time should not vary significantly between different environment. A new default of 120 seconds should be sufficient yet easy to customize with the introduction of the "settings" file for reference. Reviewed-by: Shuah Khan Signed-off-by: Shaopeng Tan --- tools/testing/selftests/resctrl/settings | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/testing/selftests/resctrl/settings diff --git a/tools/testing/selftests/resctrl/settings b/tools/testing/selftests/resctrl/settings new file mode 100644 index 000000000000..6091b45d226b --- /dev/null +++ b/tools/testing/selftests/resctrl/settings @@ -0,0 +1 @@ +timeout=120 From patchwork Fri Mar 4 10:38:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12768943 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A6DAC433F5 for ; Fri, 4 Mar 2022 10:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236992AbiCDKla (ORCPT ); Fri, 4 Mar 2022 05:41:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234714AbiCDKl3 (ORCPT ); Fri, 4 Mar 2022 05:41:29 -0500 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 04 Mar 2022 02:40:42 PST Received: from esa8.hc1455-7.c3s2.iphmx.com (esa8.hc1455-7.c3s2.iphmx.com [139.138.61.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21C0A1AAA6C; Fri, 4 Mar 2022 02:40:41 -0800 (PST) IronPort-SDR: /XpGn0MPJ/xl47bOdczlEV42ipOTrZWl4DxUG6oOg59wiRhvwgfnJ3WVG+vs4jGP5REFLTYEuk dIY4XnzXl+mAObTysOdCF9vYHrJcy7MomWb/8Xv94V0xS/oO8uEhl99wxrHkiyxm3ujb4HG86p Pju1mPxJfxDJ4EbneE2dGfCxq2LEXMSdfutDJdmRTQP9wNHz/cyS6URRy1RtL2uiKyKAGZQa2y U+rGAMT8wX+xFxGYUazNRk59ShRcskQJI7DtZynhu095fbsRDpBqwlXG7+YbFxlRgk68uxiJcV cF/e0VjjO/euZu8711M7hyDl X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="53044691" X-IronPort-AV: E=Sophos;i="5.90,154,1643641200"; d="scan'208";a="53044691" Received: from unknown (HELO oym-r4.gw.nic.fujitsu.com) ([210.162.30.92]) by esa8.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Mar 2022 19:39:34 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id DDBD1E07E0; Fri, 4 Mar 2022 19:39:33 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 26634D95E9; Fri, 4 Mar 2022 19:39:33 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id 06B3140451C6F; Fri, 4 Mar 2022 19:39:33 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com, Shuah Khan Subject: [PATCH v4 3/6] selftests/resctrl: Fix resctrl_tests' return code to work with selftest framework Date: Fri, 4 Mar 2022 19:38:31 +0900 Message-Id: <20220304103834.486892-4-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> References: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org In kselftest framework, if a sub test can not run by some reasons, the test result should be marked as SKIP rather than FAIL. Return KSFT_SKIP(4) instead of KSFT_FAIL(1) if resctrl_tests is not run as root or it is run on a test environment which does not support resctrl. - ksft_exit_fail_msg(): returns KSFT_FAIL(1) - ksft_exit_skip(): returns KSFT_SKIP(4) Reviewed-by: Shuah Khan Signed-off-by: Shaopeng Tan --- tools/testing/selftests/resctrl/resctrl_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index 973f09a66e1e..a44afb05b848 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -205,7 +205,7 @@ int main(int argc, char **argv) * 2. We execute perf commands */ if (geteuid() != 0) - return ksft_exit_fail_msg("Not running as root, abort testing.\n"); + return ksft_exit_skip("Not running as root. Skipping...\n"); /* Detect AMD vendor */ detect_amd(); @@ -235,7 +235,7 @@ int main(int argc, char **argv) sprintf(bm_type, "fill_buf"); if (!check_resctrlfs_support()) - return ksft_exit_fail_msg("resctrl FS does not exist\n"); + return ksft_exit_skip("resctrl FS does not exist. Enable X86_CPU_RESCTRL and PROC_CPU_RESCTRL config options.\n"); filter_dmesg(); From patchwork Fri Mar 4 10:38:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12768940 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86F36C433EF for ; Fri, 4 Mar 2022 10:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbiCDKke (ORCPT ); Fri, 4 Mar 2022 05:40:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236401AbiCDKkd (ORCPT ); Fri, 4 Mar 2022 05:40:33 -0500 Received: from esa3.hc1455-7.c3s2.iphmx.com (esa3.hc1455-7.c3s2.iphmx.com [207.54.90.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D07D1AA07F; Fri, 4 Mar 2022 02:39:44 -0800 (PST) IronPort-SDR: xF+BeZIf+xO7V5pKKVNI4Vlh4NJroVuqbkz5P8ukxusYbk0K/BghZEGw9SN962c9NCCMDy0mAd kK3r7eO8MBQjmRUliPHJFh+KnzPoPch9JzCSu3va5MpoegajUWmfbDo+yq+eNJumZu9KXtq6M6 CzeKCKkrwj/F9pptb9sQYionIN6M014BUEC8oyaT4Mgd3GpytRu8Is190Y4ZTloD+TE5+A19+t I7boJ7rwqH6P9cZcFLsVSNzeo80VMgUvXjQ/zA+PKOtIxelI7WoHctuDizyh8SEgUQMImUdopS +/EQTt93V9dskUchMHNijHoy X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="65111056" X-IronPort-AV: E=Sophos;i="5.90,154,1643641200"; d="scan'208";a="65111056" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Mar 2022 19:39:40 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id C7D1ACC141; Fri, 4 Mar 2022 19:39:38 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 0EF10D9467; Fri, 4 Mar 2022 19:39:38 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id E692D40450F6A; Fri, 4 Mar 2022 19:39:37 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com Subject: [PATCH v4 4/6] selftests/resctrl: Make resctrl_tests run using kselftest framework Date: Fri, 4 Mar 2022 19:38:32 +0900 Message-Id: <20220304103834.486892-5-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> References: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org In kselftest framework, all tests can be build/run at a time, and a sub test also can be build/run individually. As follows: $ make kselftest-all TARGETS=resctrl $ make -C tools/testing/selftests run_tests $ make -C tools/testing/selftests TARGETS=resctrl run_tests However, resctrl_tests cannot be run using kselftest framework, users have to change directory to tools/testing/selftests/resctrl/, run "make" to build executable file "resctrl_tests", and run "sudo ./resctrl_tests" to execute the test. To build/run resctrl_tests using kselftest framework. Modify tools/testing/selftests/Makefile and tools/testing/selftests/resctrl/Makefile. Even after this change, users can still build/run resctrl_tests without using framework as before. Signed-off-by: Shaopeng Tan --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/resctrl/Makefile | 18 +++--------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index c852eb40c4f7..7df397c6893c 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -51,6 +51,7 @@ TARGETS += proc TARGETS += pstore TARGETS += ptrace TARGETS += openat2 +TARGETS += resctrl TARGETS += rlimits TARGETS += rseq TARGETS += rtc diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile index 6bcee2ec91a9..30af27b07d21 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -1,17 +1,5 @@ -CC = $(CROSS_COMPILE)gcc -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -SRCS=$(wildcard *.c) -OBJS=$(SRCS:.c=.o) +TEST_GEN_PROGS := resctrl_tests -all: resctrl_tests +include ../lib.mk -$(OBJS): $(SRCS) - $(CC) $(CFLAGS) -c $(SRCS) - -resctrl_tests: $(OBJS) - $(CC) $(CFLAGS) -o $@ $^ - -.PHONY: clean - -clean: - $(RM) $(OBJS) resctrl_tests +$(OUTPUT)/resctrl_tests: $(wildcard *.c) From patchwork Fri Mar 4 10:38:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12768941 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E88EFC433F5 for ; Fri, 4 Mar 2022 10:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236585AbiCDKkk (ORCPT ); Fri, 4 Mar 2022 05:40:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236401AbiCDKkh (ORCPT ); Fri, 4 Mar 2022 05:40:37 -0500 Received: from esa6.hc1455-7.c3s2.iphmx.com (esa6.hc1455-7.c3s2.iphmx.com [68.232.139.139]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8CA1AA07F; Fri, 4 Mar 2022 02:39:49 -0800 (PST) IronPort-SDR: 4JRLpRH0MTmQaM76LzZ93iR5poDRcfLHQbVY8aFCw6bEhjDY2G5A6dcTHW5UutfqH90PftWJQv pd3wZrvouXQLBK8nGp0UuHf8OqjeCqhHUnk3ywdZAWSSRI95p9KGP3CLf04WqK+ddP2pOOW2bO c3EXm6P+2X2y3HI7zuSWwFVIyRjIedHsHWmUyahF2RqvcoARUhWEU+5eauKBm+yoAyCFxv435k GdYbpdSbbLzQZQCq11Bz4DQLNmNjh+Ac95p4gQHt11vmhE+HCeYztLv5xeLbEIgW6d2LdwFCCC g9Xn+FnX1NykpL0JQtOTAYRg X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="65486340" X-IronPort-AV: E=Sophos;i="5.90,154,1643641200"; d="scan'208";a="65486340" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa6.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Mar 2022 19:39:47 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 84351E0550; Fri, 4 Mar 2022 19:39:45 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id BB30CDCCF2; Fri, 4 Mar 2022 19:39:44 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id 9EFDD40451C6F; Fri, 4 Mar 2022 19:39:44 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com Subject: [PATCH v4 5/6] selftests/resctrl: Update README about using kselftest framework to build/run resctrl_tests Date: Fri, 4 Mar 2022 19:38:33 +0900 Message-Id: <20220304103834.486892-6-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> References: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org In this patch series, I make restrl_tests build/run using kselftest framework, but some users do not known how to build/run resctrl_tests using kseltest framework. Add manual of how to make resctrl_tests build/run using kselftest framework into README. Signed-off-by: Shaopeng Tan --- tools/testing/selftests/resctrl/README | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/README b/tools/testing/selftests/resctrl/README index 3d2bbd4fa3aa..268cf3f95bd5 100644 --- a/tools/testing/selftests/resctrl/README +++ b/tools/testing/selftests/resctrl/README @@ -12,9 +12,37 @@ Allocation test on Intel RDT hardware. More tests will be added in the future. And the test suit can be extended to cover AMD QoS and ARM MPAM hardware as well. +resctrl_tests can be run with or without kselftest framework. + +USE KSELFTEST FRAMEWORK +----------------------- + +BUILD +----- + +Execute the following command in top level directory of the kernel source. + +Build resctrl: + $ make -C tools/testing/selftests TARGETS=resctrl + +RUN +--- + +Run resctrl: + $ make -C tools/testing/selftests TARGETS=resctrl run_tests + +Using kselftest framework, the ./resctrl_tests will be run without any parameters. + +More details about kselftest framework as follow. +Documentation/dev-tools/kselftest.rst + +NOT USE KSELFTEST FRAMEWORK +--------------------------- + BUILD ----- +Execute the following command in this directory(tools/testing/selftests/resctrl/). Run "make" to build executable file "resctrl_tests". RUN @@ -24,7 +52,8 @@ To use resctrl_tests, root or sudoer privileges are required. This is because the test needs to mount resctrl file system and change contents in the file system. -Executing the test without any parameter will run all supported tests: +Executing the test without any parameter will run all supported tests. +It takes about 68 seconds on a Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz. sudo ./resctrl_tests From patchwork Fri Mar 4 10:38:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12768942 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4AC0C433F5 for ; Fri, 4 Mar 2022 10:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236716AbiCDKku (ORCPT ); Fri, 4 Mar 2022 05:40:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236874AbiCDKks (ORCPT ); Fri, 4 Mar 2022 05:40:48 -0500 Received: from esa5.hc1455-7.c3s2.iphmx.com (esa5.hc1455-7.c3s2.iphmx.com [68.232.139.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD14B1AA07F; Fri, 4 Mar 2022 02:39:54 -0800 (PST) IronPort-SDR: lzNUqQbOPP96TaNDtt7S+53Gz/3z2ZwEP0EPe6A0oESEbJuL4nWKTtrx/owsCawcdwebyT3OKx VGb0WJaLvGVXyUZBxwdB0FZzXB7rCCnocP2efLX4ERogNQRsGjCz+jVaF5vKgNxocRmJIvx4Wm WiBqahtgEqD/gCy9+Kd6mfV3+5nExoD6kPKGizex1vz7OE4wGZWC1oiHVmkMCy5hcbJ1c8wEej RkDPJnF0KshxEonqb2k0KU2XRlybO/aUUXp7qfu77KCFCfHhgnBsmFZfpmLM+9IUq4hL7eUHA9 pwpAwx79pTh35dlPMOhngllc X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="64700885" X-IronPort-AV: E=Sophos;i="5.90,154,1643641200"; d="scan'208";a="64700885" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa5.hc1455-7.c3s2.iphmx.com with ESMTP; 04 Mar 2022 19:39:52 +0900 Received: from oym-m1.gw.nic.fujitsu.com (oym-nat-oym-m1.gw.nic.fujitsu.com [192.168.87.58]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 14206E0548; Fri, 4 Mar 2022 19:39:51 +0900 (JST) Received: from oym-om4.fujitsu.com (oym-om4.o.css.fujitsu.com [10.85.58.164]) by oym-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id 4DAC3D9950; Fri, 4 Mar 2022 19:39:50 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om4.fujitsu.com (Postfix) with ESMTP id 2931140451C78; Fri, 4 Mar 2022 19:39:50 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com Subject: [PATCH v4 6/6] selftests/resctrl: Add missing SPDX license to Makefile Date: Fri, 4 Mar 2022 19:38:34 +0900 Message-Id: <20220304103834.486892-7-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> References: <20220304103834.486892-1-tan.shaopeng@jp.fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Add the missing SPDX(SPDX-License-Identifier) license header to tools/testing/selftests/resctrl/Makefile. Signed-off-by: Shaopeng Tan --- tools/testing/selftests/resctrl/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile index 30af27b07d21..71e80bb19dd6 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0 + TEST_GEN_PROGS := resctrl_tests include ../lib.mk