Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3506995imm; Sun, 17 Jun 2018 22:11:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJTOcixFdE2q251H8V35Rg8PIQYHfmT+W7VIkwzPWK6kHgdsuW4vy25eKWcVOrytxScm7HC X-Received: by 2002:a62:4e07:: with SMTP id c7-v6mr11993394pfb.149.1529298716637; Sun, 17 Jun 2018 22:11:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529298716; cv=none; d=google.com; s=arc-20160816; b=AT/ODm8HzneNXdwe6jWW9ZDZ8AWkvWayMUwmm1zF6lQjAz/vtQgwjL22azcfuWSXi1 Ki77cN+wwLvVcOw9cwozcuZ3hSkBJHynN1TM7ZwjTykzYoxZW6jV0WDjbyWk9AZjoCjd WYi4nsxQjyG8B4r5aCpHeQS+QBZ5dO91FrPOXiGDh3Bbcv6h4F9uHjRO5ZjDCZ5Y1zBy ZLowMbqonpmxyyUEkHeOWCfARSFb4YPp+ro5cyebTqUTi9z5t+1QpPxeHvwW132HSzPM yaPTqRPZSd2H4kRxxuCRxYdiuXZO0Jbi57m850pJvJilqwAHH2Ip45kUweu7Sj0INoef HCBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=P8F/rdx0Dg+tbAP4xRKVzOUZryhhTxWfkI38tLb+Eck=; b=B6IwuvgqmeAedTgV+Jg+VfjkvVspCe0z+d+XfHn6JljA/6StOAUHR/+E9/DTQHcJSm lWPaD/IrRofWnh8EKFtO5bOCa3M0nv8rLkd36UuJa62D1EmXQ3awmmJPk6RXkSvd2IRZ NfvNAbG9Rf1ZP9GbpxwTtj24FrzpRgtaVoNkGavNPWXUZfp58DDPGkB+agKQxoiIVuTF eRrQ0gRT6x1igHOX/mZK10s6RLozYxsCxnyN6l8vx97IV5DxTsJvDKD5d9uGmHL8eQf2 PktNoe3iwCTIbcjaFXzKjm0BpvKZj2Bkimou7KsyFm5n+w0Bb/XpnIrJ4pTuBBAPwBk0 x9fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AJPw/IX/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g23-v6si15808968pli.110.2018.06.17.22.11.34; Sun, 17 Jun 2018 22:11:56 -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; dkim=pass header.i=@linaro.org header.s=google header.b="AJPw/IX/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754670AbeFRFKn (ORCPT + 99 others); Mon, 18 Jun 2018 01:10:43 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36587 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754288AbeFRFKk (ORCPT ); Mon, 18 Jun 2018 01:10:40 -0400 Received: by mail-pg0-f66.google.com with SMTP id m5-v6so6966261pgd.3 for ; Sun, 17 Jun 2018 22:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P8F/rdx0Dg+tbAP4xRKVzOUZryhhTxWfkI38tLb+Eck=; b=AJPw/IX/VN0XwcK1Ched1kGfQBYDjuanEYGEs/y4J+hLXkavQTnpY6xZNhinOXqWvP PE1fQ4QPcFombM4wCpzkn2u7sslK0CiLeOW1//tilXlowC3BtVpVJ1LtSLA8qeyaiduA xrgUHPr0fPSe175W02wB8+lHCUmhx1OiZiucM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P8F/rdx0Dg+tbAP4xRKVzOUZryhhTxWfkI38tLb+Eck=; b=CZL5uwNfWexJheLtjbU8t9nTnrCJxx5ZRQswJMeo+kwW+KBZRpaKBNiCLDj70UWN73 93yT1QfK1E0OfpfILsXA2UtEqcbL7PborF7SuqIxFTEBcR6DjC6xgb1uaVqTKQSCR8sq v2wx7cJ/8tDWJuiwTzxwchDqRjIgobHfUL7I275n7nC0erbCr9rE/sZ1RtuBLbGKkGFk +Ho1rCbzWcpg91q1i84A/PSZ55/ImSLgY/R7JXA+syIepOIRNFvrI/daFmPsRTzABNC6 Xdcd6kJoHPFuIh06npD0j953X/IduqxcPR2r5+Ojsn8hmuPm5yIFBPv0yBiMq9XKRcB6 eZsQ== X-Gm-Message-State: APt69E35WcooU7/B2kv7emgM2DqTJVBY+DVGduLqLIHrNslxFr1IFHKb cH61ghzTFC5IzZwyNIHmblLpRQ== X-Received: by 2002:a63:902:: with SMTP id 2-v6mr9540897pgj.3.1529298640259; Sun, 17 Jun 2018 22:10:40 -0700 (PDT) Received: from localhost.localdomain (li1181-92.members.linode.com. [45.79.82.92]) by smtp.gmail.com with ESMTPSA id l15-v6sm29051710pfg.88.2018.06.17.22.10.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Jun 2018 22:10:39 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mike Leach , Robert Walker , Kim Phillips Cc: Leo Yan Subject: [PATCH v1 2/6] perf cs-etm: Bail out immediately for instruction sample failure Date: Mon, 18 Jun 2018 13:09:55 +0800 Message-Id: <1529298599-3876-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529298599-3876-1-git-send-email-leo.yan@linaro.org> References: <1529298599-3876-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 822ba91..8b2c099 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; /* -- 2.7.4