Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp214813imm; Wed, 11 Jul 2018 00:48:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc7+SJcp9Oo2q73n6n3oFVDfml9iDb0f4JqLGr2FCBirTBW2KkRF1qj0Lvzf5p35OJzH2py X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr27175634plc.241.1531295288271; Wed, 11 Jul 2018 00:48:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531295288; cv=none; d=google.com; s=arc-20160816; b=0Gq4yi7FYqduB6vQoDXuhPvSSecs3EutbocTFomzYrnH0Isv+H/bDV/2MihKcqFPu0 kpSKcm/wINFfg88GhjtV1Z1Y+rahZNwHHEAHJHOxfpjPWQK4iFUSClLzEF3qzPkYpZYr 6yEIgCrcko/k6acBmcnP9UyD+M2/fTdSP/Zeb2OuzkZsa5LziRkLxF28VWGv/eFMcUrl bg9JLFcou3anymZOvG4dpECwHfWan8LNjrdw4A7JALLzMQ4rxsyrScv5AsArV6rai37L 4OA8q4HEa0Zko9DUduzIvlbiVpwgFsEgMo2AgeDfFWFSeUevgfRkF3ku8F576yDin7Yt fMNQ== 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=IOhFeWQKL4l7VSWl48ZwW81Bvvd5Dpc7t8AlhIsqGMU=; b=Lytdj8149JU4QHNha64YPWucJHqBB6Wfn278LzJMxAi5l6xSOjugiaJNt+BCynmWOS VRi9VGT5o2Nnj7957BkYvUHZZWx1qDBeqmqB6pJNeInXUrSssSvy6gssUge4M3MXF86y M0p+fDC7qACCEzwg8jOWjcbfjobRa+ekNrGc4RyP46NkdVK2qoCAqeVcgPQFMVhePXop EoA/ghQvcrcUogRgpLKNPEvQM3nAm8HlRwpLqEXg7mUsxkSglkkYEwdfBQWPB0zPvyho K/HoD7dtDopukZVFv5ieIwdECdEcl6nMw1ymVqo7RQKcmzO1S6iDJe1XjgapIyaOT63y nMPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z7TFSBa7; 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 207-v6si17963417pga.113.2018.07.11.00.47.53; Wed, 11 Jul 2018 00:48:08 -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=Z7TFSBa7; 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 S1726705AbeGKHt0 (ORCPT + 99 others); Wed, 11 Jul 2018 03:49:26 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:41711 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeGKHtZ (ORCPT ); Wed, 11 Jul 2018 03:49:25 -0400 Received: by mail-pl0-f66.google.com with SMTP id w8-v6so8812189ply.8 for ; Wed, 11 Jul 2018 00:46:27 -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=IOhFeWQKL4l7VSWl48ZwW81Bvvd5Dpc7t8AlhIsqGMU=; b=Z7TFSBa7IXjcR6kZ9BJHPpvk89owgHTZ7JwGbCDUIrxfX77sGORypSLBnIYmoYIpE0 t07RnIVXO5mN1+F9pKBGybuhcj9fl/unOUfIzXyd8B21fAC1aRa1OrDUhdnGS1BitiYk DYw75b7Zp/f7QnOcepf9OuezSu47L6A47tols= 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=IOhFeWQKL4l7VSWl48ZwW81Bvvd5Dpc7t8AlhIsqGMU=; b=Nx5LPZYfRYjdbZeAi/XfbivHLVPIxci82LZmzir4ul1yuHqDQjmOJD3LkJNz+FtDCA eycMAVUog8SxQIqficj9v6m5qM4h2hd93FebsnvoZpzyfpmzLjOtuv5qEKebuEyGlupx q5JjaBcNviPqW7692bmEmKB3gzaIAf+D3xsH+NjYB0zRe7dO4WU1PeZgqJev1KJ2OU8G Ma1j9OmrzlIVYMHi6Ono9SXXpmdPzzJ1b5He36KnVA7tSJXFwOU/FTJlG/ZlWLf5ex1A OrDw1xIn4DSk0BEUfus2olw1lpOHRnyP7JhBWa5NBEIiqcfiYYJXjBf89CG731DfiZDK Hz8w== X-Gm-Message-State: APt69E3K2TfBew6J+jClQFZFs8dtEUGTOTHobL+xTGYrXkEEnNW3Po4L M1tlgouL9RTjSdZ2OwB06Gpv66lFTcQ= X-Received: by 2002:a17:902:7044:: with SMTP id h4-v6mr22421314plt.179.1531295187415; Wed, 11 Jul 2018 00:46:27 -0700 (PDT) Received: from localhost.localdomain (li1192-169.members.linode.com. [45.79.93.169]) by smtp.gmail.com with ESMTPSA id 16-v6sm9260374pfp.6.2018.07.11.00.46.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jul 2018 00:46:26 -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 v2 2/6] perf cs-etm: Bail out immediately for instruction sample failure Date: Wed, 11 Jul 2018 15:45:41 +0800 Message-Id: <1531295145-596-3-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531295145-596-1-git-send-email-leo.yan@linaro.org> References: <1531295145-596-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. Reviewed-by: Mathieu Poirier 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