Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp216026imm; Wed, 11 Jul 2018 00:49:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcuaPbi76OE8XlKvgHiAJRobyYO8p652bG7F/+Voz4E0AMzgPYklfsTH0Y2mHeG8R4vQKLE X-Received: by 2002:a17:902:b20d:: with SMTP id t13-v6mr28082709plr.121.1531295387893; Wed, 11 Jul 2018 00:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531295387; cv=none; d=google.com; s=arc-20160816; b=LgQeigTubCkSmgNSYeWpR2tVKLMjzMGYPkmtBkVlrOV948GfecU7sh/WjVIdefCQBK jopLtyLV5loUIPgPjpo2vPMFB0bdp/24yAlughDCpUxVoH2LG12Qrv1wtwe/gimW/q4U NVKMo9iYZoYNK0Bt1cF/vTYsGzqO33od9eQfpFH4DuwyuqVLUvCMGQfbnqWLuHEUDPRG xhvXEAl997TyB9ZqE7AXOkzQ8e41FOZTWzyPD2riL2auXOgyoAv5SyTMXIdX1QgiNT5y vNneWBz+BURtIlm8lV95y/ddrLbsIbLQSdK7iQf4Un23Xd/1nHigMScqux5abwgG4z/H Flfg== 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=XMQ9y3sIKTBhWg+aMmgR4c+8RQ5KqVUSz/E0xmozD0A=; b=GJ+irP8uoS7RrdBGlk7nZreF08xh7pYfGaJ7Sx5TMRUCXzi1wY7fCrvAzMfAlK4NKX 2/lKv5WGjPDyeXr8qsXUbz9/rHDTM8hiXWdU0LA0dEVotBDru06DKZNVGWq7vHRNiJkO Apsf1xpzNSz1Yg+vvDX7LA5m06zsX2kPB2IEjnzDnpCqLwcMdPkRVRn7aou4XjRAB/08 M5KSblDG/1T8Gf6QZErJ4ZY+8txPdzJz9WhLh2hh4H7ZeIuYWW94LCfybAmfI9ur7TEq yqKgNtx7AkVQb2/o9VlQC4Ris4/cpa37+iAYkNo6cauneQQfcTWZKFoS9qRhv1Eri1Uk jnog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fi9O/5uZ"; 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 u11-v6si5253213pgg.683.2018.07.11.00.49.32; Wed, 11 Jul 2018 00:49:47 -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="fi9O/5uZ"; 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 S1732284AbeGKHtt (ORCPT + 99 others); Wed, 11 Jul 2018 03:49:49 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:39547 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbeGKHtt (ORCPT ); Wed, 11 Jul 2018 03:49:49 -0400 Received: by mail-pl0-f67.google.com with SMTP id s24-v6so8809570plq.6 for ; Wed, 11 Jul 2018 00:46:51 -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=XMQ9y3sIKTBhWg+aMmgR4c+8RQ5KqVUSz/E0xmozD0A=; b=fi9O/5uZlfCqJZApmRCZlROkMwiUzTJ1HpFl6g0HkcGHrOWzAgQwd+uu9Y2C7X8Fdl ZwQAS6BFAPmsRYEJYr5sXFmZkZQy9akfL1WEwvpIiqUULeRtv+tspKwjtXmLMN49pB3L uqH+BYc7dsPSFAwENwLBOxIc2z5fxaQUymIrk= 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=XMQ9y3sIKTBhWg+aMmgR4c+8RQ5KqVUSz/E0xmozD0A=; b=PfcWwvri3cUx9Pr6OBkTfzsV5vWmem7N91pAHLRrRK7sY+YrnnQ/xyJoAqhuyesnqg DTtT3N7/iqpaGllcD6YNcDHUg4aAtHsOaaFlxJ+9Bv2tVGSHyhlO0u/Z1L3Vga/YSc1c FokRrZXNGd+fFuxG4Y0By4lUAa9vsWKF/uGcLlEAZjbiG5asjscWbPMKRGa42tx8VRz2 5LzEKedQcLsaVKBUhXDT6CCkR8yk+Nlld4gGRiuUL5SAmFKFkEWdigB++vjRf5Uia3T0 y2ppbOv4lTinV2/yvvMrACT0M95fejHysTCzrQDIls6VAXS6uhv7A7hIQiOJyBWHaS6c rGWQ== X-Gm-Message-State: APt69E1ANCJA09ejiCl74A6+G3t/+VWWjvoNlTlAsFeoVwU9X0VeT560 hbICFg0Ez407Eb3ibbFbj4LU6WholDU= X-Received: by 2002:a17:902:600d:: with SMTP id r13-v6mr27952646plj.70.1531295211467; Wed, 11 Jul 2018 00:46:51 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jul 2018 00:46:50 -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 5/6] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet Date: Wed, 11 Jul 2018 15:45:44 +0800 Message-Id: <1531295145-596-6-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 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. Reviewed-by: Mathieu Poirier 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