Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2835666pxv; Mon, 12 Jul 2021 03:07:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyca7u2jhFBvelz8MmNFGTWjAphF+1iZq6Gcmdgk9zjV5xym7potTH35Hqa53XlBtOsnxoh X-Received: by 2002:a02:8206:: with SMTP id o6mr3329409jag.92.1626084478472; Mon, 12 Jul 2021 03:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626084478; cv=none; d=google.com; s=arc-20160816; b=QRtyd5VxWDW4K3LcHDrZP7FwmNdEzQH8+0mAVme0UXUkVSFcvtrorxVwPuHhIykj7e 31mHYUK6abnc0nHC0AsELVRC4DWx+KjmWI5Ne2v9/pPcDgRAG76PHnGPh8DdRfg/7jb1 6/7xPtMx1tF7EDVy8P2FYvqaRvR90YTeon7XWpu2RljbUn/pTAS54W+cHEZdfOdILD2K VfKPVHcXBBV+zsZW2dtRhH2nlq5TUJR/1lhWDPm915PKR5pBrXg8Sg0rEerd1zfk4Q2Y 8O9vbXkFFl7YdFce1rHy+RpStfYFVj6h02zHvVgnRROxbHuIr4UjcW+DmjmN7O7F7r+r Tr8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=oMo4NgxzUqho2zq6oZZ97C8U2svYeL6NE3ZRLNfIELc=; b=UZwisXTvemDWXNJ5K4x2R0hSG7nBGJu8HYhE/mTIYkzIjZtACs35S9uiTFdZ3Jurao OT7STTo6DsX4WJqJoGQNvFrfyEp0NQSwjctEMqjYyu5ZOfsLqJVjCXQVmGKDN0prcQEC pBKC3V9p9DKShRO/sHRQtMrGugV2UMBbTRDhJCyXyI952tWKYnZP2FyVRVZFbRKfRxsf eyq+iBqLf4ng/kGg/uPx1mR4/6y3r3L6efwvZSlx6N8QAnHObU2cUSI2zmG8Z2sAo1jc r+SOXA4dvYNYgnHkhl9U1j/QSe3PfdL5mOqqjYkbSVWbv9WRatGPUILZ/zjNn61KCKun 4Dfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d198si17165129jac.70.2021.07.12.03.07.47; Mon, 12 Jul 2021 03:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349046AbhGLHt6 (ORCPT + 99 others); Mon, 12 Jul 2021 03:49:58 -0400 Received: from mga03.intel.com ([134.134.136.65]:27441 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240471AbhGLHPj (ORCPT ); Mon, 12 Jul 2021 03:15:39 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10042"; a="209975955" X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="209975955" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 00:12:51 -0700 X-IronPort-AV: E=Sophos;i="5.84,232,1620716400"; d="scan'208";a="501901343" Received: from xshen14-linux.bj.intel.com ([10.238.155.105]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 00:12:48 -0700 From: Xiaochen Shen To: stable@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org Cc: shuah@kernel.org, tony.luck@intel.com, fenghua.yu@intel.com, reinette.chatre@intel.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, pei.p.jia@intel.com, xiaochen.shen@intel.com Subject: [PATCH 5.12] selftests/resctrl: Fix incorrect parsing of option "-t" Date: Mon, 12 Jul 2021 15:55:23 +0800 Message-Id: <1626076523-924-1-git-send-email-xiaochen.shen@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <16260087708135@kroah.com> References: <16260087708135@kroah.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 1421ec684a43379b2aa3cfda20b03d38282dc990 upstream. Resctrl test suite accepts command line argument "-t" to specify the unit tests to run in the test list (e.g., -t mbm,mba,cmt,cat) as documented in the help. When calling strtok() to parse the option, the incorrect delimiters argument ":\t" is used. As a result, passing "-t mbm,mba,cmt,cat" throws an invalid option error. Fix this by using delimiters argument "," instead of ":\t" for parsing of unit tests list. At the same time, remove the unnecessary "spaces" between the unit tests in help documentation to prevent confusion. Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest") Fixes: 78941183d1b1 ("selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest") Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test") Fixes: 034c7678dd2c ("selftests/resctrl: Add README for resctrl tests") Cc: stable@vger.kernel.org Signed-off-by: Xiaochen Shen Reviewed-by: Tony Luck Signed-off-by: Shuah Khan --- tools/testing/selftests/resctrl/README | 2 +- tools/testing/selftests/resctrl/resctrl_tests.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/README b/tools/testing/selftests/resctrl/README index 6e5a0ff..20502cb 100644 --- a/tools/testing/selftests/resctrl/README +++ b/tools/testing/selftests/resctrl/README @@ -47,7 +47,7 @@ Parameter '-h' shows usage information. usage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits] -b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CQM default benchmark is builtin fill_buf - -t test list: run tests specified in the test list, e.g. -t mbm, mba, cqm, cat + -t test list: run tests specified in the test list, e.g. -t mbm,mba,cqm,cat -n no_of_bits: run cache tests using specified no of bits in cache bit mask -p cpu_no: specify CPU number to run the test. 1 is default -h: help diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c index ac22696..bd98746 100644 --- a/tools/testing/selftests/resctrl/resctrl_tests.c +++ b/tools/testing/selftests/resctrl/resctrl_tests.c @@ -40,7 +40,7 @@ static void cmd_help(void) printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CQM"); printf("\t default benchmark is builtin fill_buf\n"); printf("\t-t test list: run tests specified in the test list, "); - printf("e.g. -t mbm, mba, cqm, cat\n"); + printf("e.g. -t mbm,mba,cqm,cat\n"); printf("\t-n no_of_bits: run cache tests using specified no of bits in cache bit mask\n"); printf("\t-p cpu_no: specify CPU number to run the test. 1 is default\n"); printf("\t-h: help\n"); @@ -98,7 +98,7 @@ int main(int argc, char **argv) return -1; } - token = strtok(NULL, ":\t"); + token = strtok(NULL, ","); } break; case 'p': -- 1.8.3.1