Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3507021imm; Sun, 17 Jun 2018 22:11:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJsx0Q2Sh2oFMdOcxKGkY6zh2B6BpEVMAQniDNKo4t1Ry/QGg1Dj1OLoL/Vj0TkcJmwnFIi X-Received: by 2002:a17:902:d697:: with SMTP id v23-v6mr12306972ply.193.1529298718125; Sun, 17 Jun 2018 22:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529298718; cv=none; d=google.com; s=arc-20160816; b=p3r0YHLZhHA21NRI7yLFMRP/zyw4gmkvqSeiFI8tOZVl3ro9Gxtcz3AflPyXjJj1SG 6Aw9Hmpfw7f0ZAlRLeii0dLvJO3UpDB9sKx281ywmq05RgMkQMhQdRE8wlB+wHw+KF1U CoKi6D3xoDKL9eRPFjNXk93kLoHwMZ0ZHg94KsznbHwFh3edMUeoa1aij5QY6Zt6DrTt vSATnLAZhieBEIXhH+v6Xmo0Pf5ykxNLfAgEXwm5bdljd3KKDVMckKFymnD6/f+Hv5LE 9y5kK418w4EoL293GsbNOgTBLauUIPn9Bg6a5ndkk1HL5yoCTuPRR0EdPJfQDHwRKxd2 mIYw== 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=x4bCg0+QmGBErc/o9N6g33Yfeba+eCNRT/trwWTp3QM=; b=k5aDeTnUNYd1Nnm7F8jcfd+LOspyN2orhdOEA0M1mcWqt7/IqtpFf8ONOpwqsi0sdT Yh/kEec5huNXN3O2OmkyAZ4lUc2MQhOcCbBxTc2Hqb3LBjMX2/X4wyAiGl6KXvx6BRqD pCVKGtIkSPUiEWf6E420E1mdDKuhRvU7EVSGYsxKEvCxjPWyHUSclzpnzf3zq1wVy7dP 6xcNV484jGEuuscV9rZMS2gE8ea1xjV3PCyVrdElnFQTaXtn3unOTjqRY4vopIKmJpDn pDHdqm+Kw2o+KZdJ6GoH6FIWnrD6ijg0ZUlaDhn2+ismJD4fXoaegsPbYxf18xcvAKxW eUBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OyyjVDI+; 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 b83-v6si14248216pfk.342.2018.06.17.22.11.44; Sun, 17 Jun 2018 22:11:58 -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=OyyjVDI+; 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 S1754807AbeFRFK6 (ORCPT + 99 others); Mon, 18 Jun 2018 01:10:58 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:41932 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754759AbeFRFKx (ORCPT ); Mon, 18 Jun 2018 01:10:53 -0400 Received: by mail-pg0-f68.google.com with SMTP id l65-v6so6961507pgl.8 for ; Sun, 17 Jun 2018 22:10:53 -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=x4bCg0+QmGBErc/o9N6g33Yfeba+eCNRT/trwWTp3QM=; b=OyyjVDI+JmXNJCagSbatad/T/dqDZJk1jZWxeKF4K7sl7emYbGYdrFsfcKHSmf/Qcf cfxExGlwfxdBWfvgvRLcR9abTdyhQJGQ4igbfZR9nCgBGJrGGRDxQ9a7CvRx/Xh8XXCS dKty8p8y2v4Zc8wq/tNb6kwGBmctX/2tSV7IE= 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=x4bCg0+QmGBErc/o9N6g33Yfeba+eCNRT/trwWTp3QM=; b=onczX00gwdWpii0FD1jPnRczk+nolsREDsaDXvY15kxZWTsjS/9xG+XrY0koUl+G6B jU6FaVotVinTPuNT8Qx6ZzP9I9Z2FhmtvUVrv3R2iqZpqP359NFr21OMgzUHWEgUSF0S 2JiCHZgebo3V/7pzGUnt4QhUIvwmX9DGNOAxCloeAr6vyMmSmrNj4fFBsLGejb897wON bSnsjD0u5WkZkiYHw+ornbi09/k2aLUZzoN+3s7XZf6xdBDiYGTzMqZ3KQrV7v1AIpww khpn/ZdHbaQkbMBYRfARNQbiAS9cP/b59cMfZXTihc8mu9jUKSPGh5Jqs7uVHsiGtoPy Jjfg== X-Gm-Message-State: APt69E2Rjd3Sh1IQFLke195CY/cNfjmLuqUh+A4g7JBRvjFC/8yqtZzD ZVdQtd7tCasqRWfppWQ8+1E4Vw== X-Received: by 2002:a65:6343:: with SMTP id p3-v6mr9803912pgv.63.1529298652894; Sun, 17 Jun 2018 22:10:52 -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.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Jun 2018 22:10:52 -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 5/6] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet Date: Mon, 18 Jun 2018 13:09:58 +0800 Message-Id: <1529298599-3876-6-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 one CS_ETM_TRACE_ON packet is inserted, we miss to generate branch sample for the previous CS_ETM_RANGE packet. This patch is to generate branch sample when receiving a CS_ETM_TRACE_ON packet, so this can save complete info for the previous CS_ETM_RANGE packet just before CS_ETM_TRACE_ON packet. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 976db84..d3b7942 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -935,6 +935,7 @@ static int cs_etm__sample(struct cs_etm_queue *etmq) static int cs_etm__flush(struct cs_etm_queue *etmq) { int err = 0; + struct cs_etm_auxtrace *etm = etmq->etm; struct cs_etm_packet *tmp; if (!etmq->prev_packet) @@ -965,6 +966,13 @@ static int cs_etm__flush(struct cs_etm_queue *etmq) } + if (etm->sample_branches && + etmq->prev_packet->sample_type == CS_ETM_RANGE) { + err = cs_etm__synth_branch_sample(etmq); + if (err) + return err; + } + swap_packet: if (etmq->etm->synth_opts.last_branch) { /* -- 2.7.4