Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp642881pxv; Thu, 15 Jul 2021 12:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxljbLjCsd/ku4Znn3o5AhoZ965FKpxmNIF9IvLQhjQo6f0RE3nNio+iHsIkoprWc/wpQ2Q X-Received: by 2002:a17:907:7203:: with SMTP id dr3mr7150299ejc.52.1626376597922; Thu, 15 Jul 2021 12:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376597; cv=none; d=google.com; s=arc-20160816; b=KPyw4M4qziLLVLrURWzgUxHFZOrZcsJ7PCdiLvTI86v+IsGRfkBdkEoI/++SvJy2Ig H/1d8PhtewjXxTmi8UO/a8CfmejfMgD7HyO6mN4Ixn++0Oj3pWcyUa7vjLHxc4Bf/E2W qUph7HnqepSOYioheD0180N/G0tPQymaRqsfn7vhAvf3t4y64JvdkEgqr+FMzs0rfJK7 OLeH+bixkmncXiKmryp81Ryo50LYISgHsHhRRQpw2k1f+IUYfaRcQ/ZCFr2Ru7sUt7BE IhtpTOVrjTtWH8Uep7cvssHUQhq6XHU4hOUztFA56BdflC1iN3LfZ+fGTi3mUnACIaJF kIVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WvZfpyi2ZdSAw/xnPsfQLM4XKrC4yz6bir8cs5dZ1AU=; b=j1zYgwFBPASMhywFndxS3UgAbDMloKF18nGFqwZWyvurnYCmi5TMHX1dRiuA3QJuWP XKu8zfI/+dADjc/4gAg4deb8aPHgoIZO+Tnd6/JLs8975w3iXvTHHUekEU6S+f2bwXE5 VXJW0XbJZlcSSTPRX4WxfgWOok1sohOWGkbR5Gjxni63XvhHB8ZUDWh2uTpWX8NF8qJv kAY0tSvFZWog/gFaWT3D3v2FGiBOuoScmippILYGcrQg5J9Ma9CC/MPvUnSxSZ9cdtP8 gYyYp/sgDZAgROsmx2GXb2GJhK0ShY1eIpDLs/0RvH+dOZgBNYLREZC+E2sqbPRRPhqg 3WqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gwFkPODq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh10si917255ejb.419.2021.07.15.12.16.14; Thu, 15 Jul 2021 12:16:37 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gwFkPODq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243257AbhGOTRV (ORCPT + 99 others); Thu, 15 Jul 2021 15:17:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:38800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243363AbhGOTEU (ORCPT ); Thu, 15 Jul 2021 15:04:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B564613DF; Thu, 15 Jul 2021 19:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375603; bh=gWwBBg4a6xmnU0NOxAxZXtYOk15quw5sP7AcEnJZ1rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gwFkPODqthd0p6OMfzQHDYCDy7GI9l284PYBP+/v//DTuQbFyvS85jBibgt3OOQDf jiht0/ob/bySs+0UQaWInb/i8FrQs4FlcFLpOowVPLn/cOhbwItHIgK1m+d3hm6la3 fLwj+xklE3PijC09MHhW9Kr1VgZjKyRRouvDOJUo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaochen Shen , Tony Luck , Shuah Khan Subject: [PATCH 5.12 155/242] selftests/resctrl: Fix incorrect parsing of option "-t" Date: Thu, 15 Jul 2021 20:38:37 +0200 Message-Id: <20210715182620.485014708@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiaochen Shen 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 Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/resctrl/README | 2 +- tools/testing/selftests/resctrl/resctrl_tests.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- 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 --- 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':