Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1214776imm; Wed, 25 Jul 2018 13:43:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpct7O8pPuEKgiKllI4lzIkctg6Gx3uA+5k/mgkDhsg0KNMKxDQpLhgEt7s3ZsAqcV+buYDF X-Received: by 2002:a63:714a:: with SMTP id b10-v6mr21406610pgn.73.1532551431552; Wed, 25 Jul 2018 13:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532551431; cv=none; d=google.com; s=arc-20160816; b=rso+2AjrM25i92u2Q5frQukT7KaeowtRUmF+DtYt+fiKB8tPN7MMF09JIl9+gr5Mqj y6Pv255kelyjAtQnlYvalLnCrwJvgUXtAKsU9MisN+3/b0IDmuBF8LyjgrL1vLetgSvz 1M9IyrpeRhkpnc9hOBRxOYY6g7S9snLlTxoegOVFUVQP1ox1OCOjFhiKo0Zab1140H0g MWte93zuOEtP8m2EggEwjHXCy8SHo/NQXTUXuq5TjgKN7q/WUDAPV8w30aWc8Jeug8FO d2mNFCyRohss7x23ER5xK18bG+RFl3C6oalYChyVG6I/IPjne41PvBB/515mRVlWuk3K l7qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=0oGu1gsJinLjD1HWLt6/gwd0HSQT9opkCv28wD+Wy68=; b=g6QWMbYX03arBs13kmdHZ9UJQcHI2yW0P5Oa4OE7oA5+wcx1Ek0KkuQHkDF98HrYBQ Ihp//52OAeKbmc0AckanT0qORLRaqW6KMNsgbgDXfex1H356DjXSoQ9eH6EWZS4/1prI zwb8oizaofHg5CeC4eItQ44NXInRy/6N0nG8lpPikguXlHzj7kiGIYPuu7fkOawBW+Hx BZBller4k9H8RyvuFICxVPxVjEvS2LXLv4amSSxsalVP8JNte6a00IKpj65NRT+96TtP p5o/rb7qUOvvQq4G1kJKCkFLg5yYp8Ad4qM/o5PKkeCBAkNaEtgZTY6FVxqs86/zOXMr k6HA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si14310756pla.124.2018.07.25.13.43.36; Wed, 25 Jul 2018 13:43:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731400AbeGYVzQ (ORCPT + 99 others); Wed, 25 Jul 2018 17:55:16 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44403 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730623AbeGYVzP (ORCPT ); Wed, 25 Jul 2018 17:55:15 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6PKfTlS498542 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Jul 2018 13:41:29 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6PKfTSI498539; Wed, 25 Jul 2018 13:41:29 -0700 Date: Wed, 25 Jul 2018 13:41:29 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Leo Yan Message-ID: Cc: hpa@zytor.com, kim.phillips@arm.com, acme@redhat.com, mingo@kernel.org, mike.leach@linaro.org, mathieu.poirier@linaro.org, robert.walker@arm.com, tglx@linutronix.de, jolsa@redhat.com, namhyung@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, leo.yan@linaro.org Reply-To: peterz@infradead.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, jolsa@redhat.com, tglx@linutronix.de, robert.walker@arm.com, mike.leach@linaro.org, mingo@kernel.org, mathieu.poirier@linaro.org, kim.phillips@arm.com, acme@redhat.com, hpa@zytor.com In-Reply-To: <1529298599-3876-3-git-send-email-leo.yan@linaro.org> References: <1529298599-3876-3-git-send-email-leo.yan@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf cs-etm: Bail out immediately for instruction sample failure Git-Commit-ID: 6cd4ac6a02c9bc6560faf567ac013902ab9cd039 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6cd4ac6a02c9bc6560faf567ac013902ab9cd039 Gitweb: https://git.kernel.org/tip/6cd4ac6a02c9bc6560faf567ac013902ab9cd039 Author: Leo Yan AuthorDate: Mon, 18 Jun 2018 13:09:55 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 24 Jul 2018 14:48:32 -0300 perf cs-etm: Bail out immediately for instruction sample failure 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; /*