From patchwork Wed Jul 25 17:59:38 2018 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: 10544547 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 1C6E7112E for ; Wed, 25 Jul 2018 18:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 075D92A9DE for ; Wed, 25 Jul 2018 18:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFE052A9E6; Wed, 25 Jul 2018 18:01:03 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 9B5C62A9CB for ; Wed, 25 Jul 2018 18:01:03 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=BDNdkpEESDU9jIlZ3v1JQjIECzzzOAT9OGiH6gFOSaQ=; b=b1GwwG7cGnxl/gotucYVNkNBqN GkFCBEXAYfCp/E53XVLEWXfiKBAZvSj7g51kJgDxiaHO3N4rIzfohro7WYpG9Uhxy/MYd9j2JKgSl nUSAFmEmLugOpj9Gm9xZmk72yH0anXImwsK61oj8Kwanjt/p6Qg5FU3DEEqnHxH8chR+fDZCn9fFV 8t+QNHk9OdjiciNQEnohwDELFhTyKOFSAwGqwcMute0oksL6vVlzD5MgzDd/beqiXSYFywu5ayiJF Cp15pLNSMlYRDJEKStkn2YTPgoNIvSqXLLYKpmOLe4SclkkSb5YIClrMUeKJwYkWdjDEhs1Vfrk6a QrwV9N0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiO5o-00022X-02; Wed, 25 Jul 2018 18:00:56 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiO5j-0001uc-D3 for linux-arm-kernel@lists.infradead.org; Wed, 25 Jul 2018 18:00:53 +0000 Received: from jouet.infradead.org (189-94-96-116.3g.claro.net.br [189.94.96.116]) (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 EC06C20833; Wed, 25 Jul 2018 18:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532541647; bh=ppmIxlNOnW1PVQKGK3DbtHWZMJUw0wXV/Jl4Rr/6cfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ov1zL8Z41hEJDCixcQMTM3hvsr4Smpc6OKD/jc1HjGLbmv8dIL7AFUfO+2PDYKSKM 3Zbc2ZxnCU1so1EIgAfkXZKRx2fhL+Z02kXJy0bemdKVw5JbvWtOwlId/Nuzy2jiPA hemGTJ6Fkx9jIW2GjLoXNvt4mQ1W+KCi0QsSg/tw= From: Arnaldo Carvalho de Melo To: Ingo Molnar Subject: [PATCH 04/27] perf cs-etm: Bail out immediately for instruction sample failure Date: Wed, 25 Jul 2018 14:59:38 -0300 Message-Id: <20180725180001.15108-5-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180725180001.15108-1-acme@kernel.org> References: <20180725180001.15108-1-acme@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180725_110051_553536_DEBA19AA X-CRM114-Status: GOOD ( 10.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnaldo Carvalho de Melo , Kim Phillips , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Shishkin , Peter Zijlstra , Leo Yan , Namhyung Kim , Robert Walker , Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach MIME-Version: 1.0 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: Leo Yan If the instruction sample failure has happened, it isn't necessary to execute to the end of the function cs_etm__flush(). This commit is to bail out immediately and return the error code. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1529298599-3876-3-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 822ba915d144..8b2c099e750a 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -939,6 +939,9 @@ static int cs_etm__flush(struct cs_etm_queue *etmq) err = cs_etm__synth_instruction_sample( etmq, addr, etmq->period_instructions); + if (err) + return err; + etmq->period_instructions = 0; /*