From patchwork Wed Aug 1 21:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 10553103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD7E81708 for ; Wed, 1 Aug 2018 21:54:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC22628825 for ; Wed, 1 Aug 2018 21:54:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FF6F29492; Wed, 1 Aug 2018 21:54:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CEF328825 for ; Wed, 1 Aug 2018 21:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Wjj/ChTpiaQ7J1d+14hXrWeXnbuzDtpvr4rdAo1iFgU=; b=jEqBCavFb8gbkSJl6EcPK7z9TC ErSLJuIzx5EIMMzbHl/rR4xn+OgDSEt+Q3VB18wDRCi8S6plrLhX4hgE/INTU3UoGF6BPO0ZH1mqh VxicN9baKNlW30MMJjo7HAUuS5LmEIevGcDK9tq00IJ+5WNrC88Sszp2h2JqlFpgYu/ay8JTQuQD7 G2fghExylz1hEIrwZqIKykwGD/3vUGxvlWsN7kneNU1jdbRkcIOxaTZr02YUv68TCmFZhgxoPZCf5 5leBEdMetpgCzYTk6PcCvNVIzL5aoXz5lgk38SPdk3lCwXdnWL811Kx24OjYxEVMtYP5ptjblP8qh 6AGBuk5Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkz4q-0006Wh-PY; Wed, 01 Aug 2018 21:54:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkz4o-0006PL-S5 for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Aug 2018 21:54:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+ho/dAztRl0NBinJdfduzic0XwDrf5rMeHeWU22OpIA=; b=GgZ/3RS6viQYAuC2r3G8Acrek kndvVgV8x6sSfODWBOS+lgVDePWIfhTdIQhjjrwTbQSYTjBCAbgF+uC35q9+qkaS90bh2i6owXPji /LOLnFTD27PfzykYm4HhKoeWYW6AyK2+TtoViTEu9EsPHmKKzHfqm+PFyd8nFgAq+BZRnEr/qwWoU vus1rirVTVrXzGJX6cqGYLv6J1tCWnGA82nlshqLzmzfpWr1lpd293BjCd+cNnTFC/UKq+vVrfzNf VWcQF6O/oppl6aygBNUXAieJMtRNLiZRAOzak/1OV6Wq9DehGPRbq3UqPSOq4nCvU2wWI3XUSwqfs M4WSWwq9A==; Received: from mail.kernel.org ([198.145.29.99]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkyog-0002Me-Up for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 21:38:00 +0000 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4971A208A5; Wed, 1 Aug 2018 21:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533159467; bh=7PKxdmB4FcUBYEjNnAhtmm43wZS9a9WB6nlc3RVbQfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a+rOsewFPObmsjQuhqrD48RJQj+qPrbMyJFjiHZeyAUifvKRX4n1SY4pQYdNqMpIQ /HGkFMHU2WDrZLcsRz9Ko/oQe6+UvMy040vzHGCVx3TC4+OV+jk5lEeqqLzMYJ2bTF pqt7RNZKQXjOeOw0Sl7S8EMRr08mVuVCUe2EAL0g= From: Arnaldo Carvalho de Melo To: Ingo Molnar Subject: [PATCH 14/21] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet Date: Wed, 1 Aug 2018 18:36:41 -0300 Message-Id: <20180801213648.4814-15-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180801213648.4814-1-acme@kernel.org> References: <20180801213648.4814-1-acme@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_223759_136263_2DBB146D X-CRM114-Status: GOOD ( 13.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnaldo Carvalho de Melo , Kim Phillips , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Shishkin , Peter Zijlstra , Leo Yan , Namhyung Kim , Robert Walker , Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Leo Yan 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) { /*