From patchwork Mon Jul 15 21:11:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 11045041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E193746 for ; Mon, 15 Jul 2019 21:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BD66283AF for ; Mon, 15 Jul 2019 21:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F7AD28492; Mon, 15 Jul 2019 21:14:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7B75283AF for ; Mon, 15 Jul 2019 21:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PbSDxyOI7XcKtk82ni8uKfWMXJiFdN88h8WCN/JAa+s=; b=UtHSTSmDYKOP18 BzXO9syHHx5klaafF5B26rix8wGW8rM8Wb3RchJGTIYzSR4xx9Bd2BrbZPEgqgDNKmQ4YHZqFZyVB kVeZ1S5EG1UdesXUIeWpSidZPZZoIhv6odHqexrrsi3svG3AL1yElz+1jthk6SjNXV3vYgTmFSnW3 NeH3zJXXW5QDc02OHcwQevPklMQxHHYYjiI9fQ2BdRbv2FTKEp50NhoWl+eOGKjVNRevZboSQ5v6H +GcBtAg+Ljt27yluqaCqvUIVUra8LLG07FH9dkqUSdeYKa5j/wF4E06C9d8VGXpgAuQ++Q0ogBmiK XP809BamBW5SpzfFnR1Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hn8Iz-0001CN-7b; Mon, 15 Jul 2019 21:14:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hn8Il-00010K-HI for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2019 21:14:29 +0000 Received: from quaco.ghostprotocols.net (179-240-129-12.3g.claro.net.br [179.240.129.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E4BA82173C; Mon, 15 Jul 2019 21:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563225267; bh=7gF33XVGPWPehjsDTM+Wd6unH/O+yYsqP9r8KeEOR5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N6BvSvBtkrtPOoEh4mcgu0/G9qLKqc47wrDqxvhb6L3iwhQTG8S9PGJg48OR/yrGJ hLDyk7oVhm6SVpUeqDoLC90CwHS9nZZEo9CNUc009OIedGvImOk8DxV7PD/+NivQV9 FNuRNlmIzwGfHH6PBDJD7IGeIARrpK/XpIkpo5RQ= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Subject: [PATCH 26/28] perf cs-etm: Return errcode in cs_etm__process_auxtrace_info() Date: Mon, 15 Jul 2019 18:11:58 -0300 Message-Id: <20190715211200.10984-27-acme@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190715211200.10984-1-acme@kernel.org> References: <20190715211200.10984-1-acme@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190715_141427_660150_ED4651CD X-CRM114-Status: GOOD ( 11.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki Poulouse , Clark Williams , YueHaibing , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Shishkin , Peter Zijlstra , Jiri Olsa , Namhyung Kim , Jiri Olsa , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: YueHaibing The 'err' variable is set in the error path, but it's not returned to callers. Don't always return -EINVAL, return err. Signed-off-by: YueHaibing Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: linux-arm-kernel@lists.infradead.org Fixes: cd8bfd8c973e ("perf tools: Add processing of coresight metadata") Link: http://lkml.kernel.org/r/20190321023122.21332-3-yuehaibing@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 2e9f5bc45550..3d1c34fc4d68 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -2517,8 +2517,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event, session->auxtrace = &etm->auxtrace; etm->unknown_thread = thread__new(999999999, 999999999); - if (!etm->unknown_thread) + if (!etm->unknown_thread) { + err = -ENOMEM; goto err_free_queues; + } /* * Initialize list node so that at thread__zput() we can avoid @@ -2530,8 +2532,10 @@ int cs_etm__process_auxtrace_info(union perf_event *event, if (err) goto err_delete_thread; - if (thread__init_map_groups(etm->unknown_thread, etm->machine)) + if (thread__init_map_groups(etm->unknown_thread, etm->machine)) { + err = -ENOMEM; goto err_delete_thread; + } if (dump_trace) { cs_etm__print_auxtrace_info(auxtrace_info->priv, num_cpu); @@ -2575,5 +2579,5 @@ int cs_etm__process_auxtrace_info(union perf_event *event, err_free_hdr: zfree(&hdr); - return -EINVAL; + return err; }