From mboxrd@z Thu Jan 1 00:00:00 1970 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 0B09FC6FA91 for ; Fri, 16 Sep 2022 02:22:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229897AbiIPCWN (ORCPT ); Thu, 15 Sep 2022 22:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbiIPCWK (ORCPT ); Thu, 15 Sep 2022 22:22:10 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75AFB8A7E4 for ; Thu, 15 Sep 2022 19:22:09 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MTHmX0sV9zmVGB; Fri, 16 Sep 2022 10:18:20 +0800 (CST) Received: from kwepemm600008.china.huawei.com (7.193.23.88) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 16 Sep 2022 10:22:07 +0800 Received: from huawei.com (10.175.100.227) by kwepemm600008.china.huawei.com (7.193.23.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 16 Sep 2022 10:22:02 +0800 From: Shang XiaoJing To: , , , , , , , CC: Subject: [PATCH 4/8] perf record: Fix error return code in cmd_record Date: Fri, 16 Sep 2022 10:56:23 +0800 Message-ID: <20220916025627.13967-5-shangxiaojing@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220916025627.13967-1-shangxiaojing@huawei.com> References: <20220916025627.13967-1-shangxiaojing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600008.china.huawei.com (7.193.23.88) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org Set untimely updated error return code in cmd_record as -EINVAL when there encounters the error. Signed-off-by: Shang XiaoJing --- tools/perf/builtin-record.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 9df77b81a3bb..b18692a4d776 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -3997,10 +3997,12 @@ int cmd_record(int argc, const char **argv) if (record__threads_enabled(rec)) { if (rec->opts.affinity != PERF_AFFINITY_SYS) { pr_err("--affinity option is mutually exclusive to parallel streaming mode.\n"); + err = -EINVAL; goto out_opts; } if (record__aio_enabled(rec)) { pr_err("Asynchronous streaming mode (--aio) is mutually exclusive to parallel streaming mode.\n"); + err = -EINVAL; goto out_opts; } } @@ -4143,6 +4145,7 @@ int cmd_record(int argc, const char **argv) if (evlist__fix_hybrid_cpus(rec->evlist, rec->opts.target.cpu_list)) { pr_err("failed to use cpu list %s\n", rec->opts.target.cpu_list); + err = -EINVAL; goto out; } -- 2.17.1