Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1816906imm; Thu, 2 Aug 2018 01:17:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfNdHnJpBkUzrSABsPS0wGeRfQ26CclvO6Lq0ZvdLCt55bRmCX8+/AflUtdwu5xpVrzvBAU X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr1499098plp.194.1533197831513; Thu, 02 Aug 2018 01:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533197831; cv=none; d=google.com; s=arc-20160816; b=FtoId7ymHoFnCqId98FVwWyqG/ws0yEiLai9ROdH8p2Ah9qjnpxQaTesFrs/9EI7qG XB79UDFP/O5RFyfGJ4oj5dGO4+mgXIIM3JI1gNpTP7q5q+MX0zSgThp00WyIxoWp6WgC CQLAzDRjQWXDFqQUgK0EVXKRDFOHvGPoGJZSoEWGSAuXA87ADQcvYfUgGPZ8ADdEmuqk TaUGi6wLynkBruoErYb9g5+vV4mgNUoBdU6oAeSf2YOdpTBC/0LMfLfBYVqKqhMwLksv C+SdZN2JfMQ4dzRzKDHFyYQQb5HwadiG7CbPdMEoST99VqdSXqF4FhCtv/58hozn6Suk 9XHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=451ugDfFeRTrG6qPU7wrmqwI8ZINYhTatQthqd2ZQA8=; b=E+Wtzk/Jd1M05Ngelut1TUChvAXVo37GIn4j6cTOdEMZdRTO4Is6zNPgSeB1WqOfx6 Czbbc5tLrwHzbr09hPIKCKSgXfb+50oexSqqZ5ZPED6aAVukcngDSA6njIacMgomWLLC 9oJPxTUrFF1tW+yzFxjXelVofVhlNOp2kSy0KG6DPLDUeWKb5OUsmAbYJi422RV/kMNN 6GnFdTIhfx0WqYXszzoc68r6OQP+ttw07V/pREsgJKMCecKIw+5SbzUWgKI7DtW3ya3d Cm/sOnd9sIhxoltev0Os1bacC0A0G/ejDpRHwh5X7Gn43xF9uapuHuznxQM8ETeb/Gt4 mgAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si1385783pgk.636.2018.08.02.01.16.57; Thu, 02 Aug 2018 01:17:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731564AbeHBKFd (ORCPT + 99 others); Thu, 2 Aug 2018 06:05:33 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37919 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbeHBKFd (ORCPT ); Thu, 2 Aug 2018 06:05:33 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w728E8Tx3431400 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 2 Aug 2018 01:14:08 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w728E82H3431397; Thu, 2 Aug 2018 01:14:08 -0700 Date: Thu, 2 Aug 2018 01:14:08 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Leo Yan Message-ID: Cc: namhyung@kernel.org, jolsa@redhat.com, mike.leach@linaro.org, hpa@zytor.com, leo.yan@linaro.org, peterz@infradead.org, acme@redhat.com, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, mathieu.poirier@linaro.org, kim.phillips@arm.com, mingo@kernel.org, robert.walker@arm.com, tglx@linutronix.de Reply-To: robert.walker@arm.com, tglx@linutronix.de, kim.phillips@arm.com, mingo@kernel.org, mathieu.poirier@linaro.org, leo.yan@linaro.org, peterz@infradead.org, alexander.shishkin@linux.intel.com, acme@redhat.com, linux-kernel@vger.kernel.org, jolsa@redhat.com, mike.leach@linaro.org, hpa@zytor.com, namhyung@kernel.org In-Reply-To: <1531295145-596-6-git-send-email-leo.yan@linaro.org> References: <1531295145-596-6-git-send-email-leo.yan@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet Git-Commit-ID: d603b4e9f9c3181f2dacb989bba60081b99befe4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d603b4e9f9c3181f2dacb989bba60081b99befe4 Gitweb: https://git.kernel.org/tip/d603b4e9f9c3181f2dacb989bba60081b99befe4 Author: Leo Yan AuthorDate: Wed, 11 Jul 2018 15:45:44 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 31 Jul 2018 11:22:11 -0300 perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet 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 Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Kim Phillips Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Walker Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1531295145-596-6-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- 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 976db8483478..d3b794286bca 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) { /*