From patchwork Wed Jul 11 07:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 141684 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4803573ljj; Wed, 11 Jul 2018 00:46:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeczQNDnOiHA1V29bIzQ7ChHoWYF1Z8sFCCA2Lps0RxXsLjHBdd+6XwiLXv34a3q4Uov4Y2 X-Received: by 2002:a17:902:292b:: with SMTP id g40-v6mr27980230plb.273.1531295191741; Wed, 11 Jul 2018 00:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531295191; cv=none; d=google.com; s=arc-20160816; b=AwxJfwYA82A3Altgx6vTnYGNczKPTipi/bjFu6EDboyBLKG3eQHY4AUyWGE9X+r69w PHy0tq8VlJn8jwXaIvuTtBDM9/RqII4Y2MeL6W0CpRHRklnH7ZWDaoXP2nDEuM5aczGe pmJ6aF31ZqpXHR9J6RjFfZQHNuw7nSiiCQJDmFDkwXNz6eCQ21CFghH+qPQUGT4v+8KY UuNkQw4Hz7BBWRtFBPm8ZvyO9AFWUW1PB8tb6slcYwAOQGiTBeB/ZDTvqPoTsTZigDJK W+SpvC2GfK7Pbu2akNfesVfO302zad6bPiuREnb1O/jk9QRQ3+4oaEXtLVLW+Crr7ewQ tduw== 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 f2-v6si7028937pgh.661.2018.07.11.00.46.31; Wed, 11 Jul 2018 00:46:31 -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 S1726737AbeGKHt0 (ORCPT + 22 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(+) -- 2.7.4 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; /*