From patchwork Mon Dec 13 10:01:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12673549 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 9C3D6C433EF for ; Mon, 13 Dec 2021 10:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237387AbhLMKGF (ORCPT ); Mon, 13 Dec 2021 05:06:05 -0500 Received: from esa4.hc1455-7.c3s2.iphmx.com ([68.232.139.117]:16668 "EHLO esa4.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237482AbhLMKEE (ORCPT ); Mon, 13 Dec 2021 05:04:04 -0500 IronPort-SDR: kaBtCZP1JuahjalfLthOECjI86x+KNdF13slxeMa65490JGaGf0Le+BEIBGQuaxvT3ihTfCB4l LSb8V72rytJSesR4IzgLplHVLkVvkapt1rzOQIgcJyj4GjJlZ2n5TF4MJyL0gugMAT63bsUqjz Y7Moa7CVuHS5SQ9vcG7SzhzzotPTIAc38Te4cISEG5IyXkaRLpEAlSvIy99zO/w+a3lSIHsO/Q t8L78W/ooOF3WSe0NGvnj3dmfEeyJggw+xgjEKoikdVco0JS1TTPpd9dZMdPYm3mmwn8QLoNOB lhwZD7Uaqs1FAKd9+sHgnUmZ X-IronPort-AV: E=McAfee;i="6200,9189,10196"; a="55986502" X-IronPort-AV: E=Sophos;i="5.88,202,1635174000"; d="scan'208";a="55986502" Received: from unknown (HELO oym-r2.gw.nic.fujitsu.com) ([210.162.30.90]) by esa4.hc1455-7.c3s2.iphmx.com with ESMTP; 13 Dec 2021 19:04:00 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id DA786E6883; Mon, 13 Dec 2021 19:03:59 +0900 (JST) Received: from oym-om3.fujitsu.com (oym-om3.o.css.fujitsu.com [10.85.58.163]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 3375ED95E8; Mon, 13 Dec 2021 19:03:59 +0900 (JST) Received: from localhost.localdomain (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om3.fujitsu.com (Postfix) with ESMTP id 14491403F134C; Mon, 13 Dec 2021 19:03:59 +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 v2 1/5] selftests/resctrl: Kill the child process created by fork() when the SIGTERM signal comes Date: Mon, 13 Dec 2021 19:01:50 +0900 Message-Id: <20211213100154.180599-2-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211213100154.180599-1-tan.shaopeng@jp.fujitsu.com> References: <20211213100154.180599-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 there is a limited time for each sub test, when the time limit comes SIGTEM signal will be sent to sub test by "timeout --foregroup " command. In resctrl_tests, fork() is used to create a child process. This commit ensures child process to be killed before parent process exiting if SIGTERM signal comes. 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 Mon Dec 13 10:01:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12673551 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 4AF70C433F5 for ; Mon, 13 Dec 2021 10:06:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235585AbhLMKGK (ORCPT ); Mon, 13 Dec 2021 05:06:10 -0500 Received: from esa3.hc1455-7.c3s2.iphmx.com ([207.54.90.49]:6505 "EHLO esa3.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237325AbhLMKEI (ORCPT ); Mon, 13 Dec 2021 05:04:08 -0500 IronPort-SDR: 2I6qqPeUxZp7WvyJX0ll1H9MELDyVx13PSy9pWk8fjGJ9zOD8SUWuaopYLGabe4fv1F/YlCtrA z7qYbrBJxRSa5LXwImMURjmBodPx06NlYqqi/bdbDTP47fCNzGUD+6R8tsXYja3k0/mZBh7sf4 xzs/bcWt68m5/ojgD9xFfyJPT8oDBxeicg48CgPHOvQILc8wzXxXem2fiPxCibaZ4/BJZD95qr tj8UdpowbGJKtPvqrDYPZtr4YPmIGK6PB5jBamkHqdqeUOGBVMPuSNwXdEnUkCK1MnG6DCYTqT t/j+xy4qFjo9z4hoxML/7big X-IronPort-AV: E=McAfee;i="6200,9189,10196"; a="56174873" X-IronPort-AV: E=Sophos;i="5.88,202,1635174000"; d="scan'208";a="56174873" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP; 13 Dec 2021 19:04:05 +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 E50871FA82C; Mon, 13 Dec 2021 19:04:03 +0900 (JST) Received: from oym-om3.fujitsu.com (oym-om3.o.css.fujitsu.com [10.85.58.163]) by oym-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id 3C68B123094C; Mon, 13 Dec 2021 19:04:03 +0900 (JST) Received: from localhost.localdomain (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om3.fujitsu.com (Postfix) with ESMTP id 27B46404398A2; Mon, 13 Dec 2021 19:04:03 +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 v2 2/5] selftests/resctrl: Make resctrl_tests run using kselftest framework Date: Mon, 13 Dec 2021 19:01:51 +0900 Message-Id: <20211213100154.180599-3-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211213100154.180599-1-tan.shaopeng@jp.fujitsu.com> References: <20211213100154.180599-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 This commit enables resctrl_tests to be built/run in kselftest framework. Build/run resctrl_tests by building/running all tests of kselftest, or by using the "TARGETS" variable on the make command line to specify resctrl_tests. This commit modified the Makefile of kernel kselftest set and the Makefile of resctrl_tests. Signed-off-by: Shaopeng Tan --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/resctrl/Makefile | 20 ++++++-------------- 2 files changed, 7 insertions(+), 14 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..c9e8540fc594 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -1,17 +1,9 @@ -CC = $(CROSS_COMPILE)gcc -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -SRCS=$(wildcard *.c) -OBJS=$(SRCS:.c=.o) +CFLAGS += -g -Wall -O2 -D_FORTIFY_SOURCE=2 -all: resctrl_tests +TEST_GEN_PROGS := resctrl_tests +EXTRA_SOURCES := $(wildcard *.c) -$(OBJS): $(SRCS) - $(CC) $(CFLAGS) -c $(SRCS) +all: $(TEST_GEN_PROGS) -resctrl_tests: $(OBJS) - $(CC) $(CFLAGS) -o $@ $^ - -.PHONY: clean - -clean: - $(RM) $(OBJS) resctrl_tests +$(TEST_GEN_PROGS): $(EXTRA_SOURCES) +include ../lib.mk From patchwork Mon Dec 13 10:01:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12673555 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 35C1BC433EF for ; Mon, 13 Dec 2021 10:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235157AbhLMKGR (ORCPT ); Mon, 13 Dec 2021 05:06:17 -0500 Received: from esa11.hc1455-7.c3s2.iphmx.com ([207.54.90.137]:19252 "EHLO esa11.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237213AbhLMKEK (ORCPT ); Mon, 13 Dec 2021 05:04:10 -0500 IronPort-SDR: aOVFJMKbL92M9prUSKctYmiUt85C8r+XrZeWPgo6mPEVyHr02euAGs9RHOC1gziAaUZlsdqxlZ 5pxHt8fGZNIoTfzNf+qO8VJ8h2ZaZ1hbMQzXIC8BTTVG/JUOmgdyiOdHfSTOHi6n6SMW/yf9bX 3p3GoSBb1hneZ84wQX5LzVtLwhgOLqrFxNNc7Ea5DUbn0c2WvECSqdMPmKOb4VVu/DdBJTGmMw tejLKp871VJ/WJ0Ux8LeK3qMdMVj0KONVqC0gw/3oiiQqLDGVPQ1DeEt60XJon/rVo4IjCOH/4 5W/2yU47LYZAYhlfw7j/FZgh X-IronPort-AV: E=McAfee;i="6200,9189,10196"; a="35759555" X-IronPort-AV: E=Sophos;i="5.88,202,1635174000"; d="scan'208";a="35759555" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP; 13 Dec 2021 19:04:06 +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 C8F811FA82F; Mon, 13 Dec 2021 19:04:05 +0900 (JST) Received: from oym-om3.fujitsu.com (oym-om3.o.css.fujitsu.com [10.85.58.163]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 0969ADD76E; Mon, 13 Dec 2021 19:04:05 +0900 (JST) Received: from localhost.localdomain (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om3.fujitsu.com (Postfix) with ESMTP id DDA7D40425CD3; Mon, 13 Dec 2021 19:04:04 +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 v2 3/5] selftests/resctrl: Add license to resctrl_test Makefile Date: Mon, 13 Dec 2021 19:01:52 +0900 Message-Id: <20211213100154.180599-4-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211213100154.180599-1-tan.shaopeng@jp.fujitsu.com> References: <20211213100154.180599-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 Software Package Data Exchange license information to resctrl_test 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 c9e8540fc594..adfd92145e12 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -1,3 +1,5 @@ +#SPDX-License-Identifier: GPL-2.0 + CFLAGS += -g -Wall -O2 -D_FORTIFY_SOURCE=2 TEST_GEN_PROGS := resctrl_tests From patchwork Mon Dec 13 10:01:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12673553 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 AD30CC433F5 for ; Mon, 13 Dec 2021 10:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239510AbhLMKGO (ORCPT ); Mon, 13 Dec 2021 05:06:14 -0500 Received: from esa3.hc1455-7.c3s2.iphmx.com ([207.54.90.49]:6510 "EHLO esa3.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237866AbhLMKEK (ORCPT ); Mon, 13 Dec 2021 05:04:10 -0500 IronPort-SDR: MgIkQiG//Tf0LrLd5Dth3FEuy0dRC802hTIRZ+vgu3NgRyXm42XI9IYKIkYVuosuAcZ2TlCOYn kzNb8TEbj7JyJ0saKGlUxluM52emoxh744NbvYHFMaufuMrXfFdUD1e3dpfveAosXSZXaEUFDD DG9Hy0DSY9ruJATKR8jWYVGHX1YMd0nbmkLDfzLhcSFIS/3GvyovKGo4X/HbaWH7UrpDuKVOc1 k7Bo8NfVHmu1cK5glpo6fCVqmwDsWvDDXXmyuzbH3yElXLkvVwe/usGIU8HT5errUWe40U7Xqi BXHubpix2gtlIC7KJ1fkzE+m X-IronPort-AV: E=McAfee;i="6200,9189,10196"; a="56174878" X-IronPort-AV: E=Sophos;i="5.88,202,1635174000"; d="scan'208";a="56174878" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa3.hc1455-7.c3s2.iphmx.com with ESMTP; 13 Dec 2021 19:04:08 +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 59A331FA82C; Mon, 13 Dec 2021 19:04:07 +0900 (JST) Received: from oym-om3.fujitsu.com (oym-om3.o.css.fujitsu.com [10.85.58.163]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 9E9D23D7466; Mon, 13 Dec 2021 19:04:06 +0900 (JST) Received: from localhost.localdomain (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om3.fujitsu.com (Postfix) with ESMTP id 80A4340467B71; Mon, 13 Dec 2021 19:04:06 +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 v2 4/5] selftests/resctrl: Change default limited time to 120 seconds for resctrl_tests Date: Mon, 13 Dec 2021 19:01:53 +0900 Message-Id: <20211213100154.180599-5-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211213100154.180599-1-tan.shaopeng@jp.fujitsu.com> References: <20211213100154.180599-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 This commit changed the default limited time(45s) to 120 seconds for resctrl_tests by adding "setting" file. Since 45 seconds may not be enough on some machine environments. 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 Mon Dec 13 10:01:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaopeng Tan X-Patchwork-Id: 12673557 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 6C084C4332F for ; Mon, 13 Dec 2021 10:06:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237129AbhLMKGS (ORCPT ); Mon, 13 Dec 2021 05:06:18 -0500 Received: from esa11.hc1455-7.c3s2.iphmx.com ([207.54.90.137]:19255 "EHLO esa11.hc1455-7.c3s2.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237076AbhLMKEP (ORCPT ); Mon, 13 Dec 2021 05:04:15 -0500 IronPort-SDR: VdqbBJIheXs0VE/AdTLa77zW0Dx1vM3WaNFsBwQcqo0BM6e6CFbwvbEugrZg15doZidICzt/DD AKCNCI2oiScz2TZ4oHbN9GOla7OtEWkAyUSUPqSvV+5x4APWQQSBllxhgaWCN70VnNZplWlGcO E99G2HzHje4sjWiz5GFUhn4IdJ0FOq9JcRsygOjPgDZopPfPUFepaPJl5k3yeHrs3zrB4uOOUz GTHxQw7opvr6vtwS5M4Q28db3+ijXS/54Va9r7XRyFLolHpdu2AM1IN9YjcaWufHnzW6zqjZ+v q2SrC9VHjcm18mVALUC1JgI4 X-IronPort-AV: E=McAfee;i="6200,9189,10196"; a="35759563" X-IronPort-AV: E=Sophos;i="5.88,202,1635174000"; d="scan'208";a="35759563" Received: from unknown (HELO oym-r2.gw.nic.fujitsu.com) ([210.162.30.90]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP; 13 Dec 2021 19:04:09 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id B4FFEE6881; Mon, 13 Dec 2021 19:04:08 +0900 (JST) Received: from oym-om3.fujitsu.com (oym-om3.o.css.fujitsu.com [10.85.58.163]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 0567FE6A52; Mon, 13 Dec 2021 19:04:08 +0900 (JST) Received: from localhost.localdomain (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om3.fujitsu.com (Postfix) with ESMTP id DB15A40467B4A; Mon, 13 Dec 2021 19:04:07 +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 v2 5/5] selftests/resctrl: Return KSFT_SKIP(4) if resctrlfile system is not supported or resctrl is not run as root Date: Mon, 13 Dec 2021 19:01:54 +0900 Message-Id: <20211213100154.180599-6-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211213100154.180599-1-tan.shaopeng@jp.fujitsu.com> References: <20211213100154.180599-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 To unify the return code of resctrl_tests with the return code of selftest set, return KSFT_SKIP (4) if resctrl file system is not supported or resctrl is not run as root. 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..3be0895c492b 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, abort testing.\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\n"); filter_dmesg();