From patchwork Sun Nov 11 04:59:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 150754 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1705974ljp; Sat, 10 Nov 2018 21:00:20 -0800 (PST) X-Google-Smtp-Source: AJdET5dWmeyeO/Myy38d5lMuCBLVp/ULYETEMck1NYg7MifJmFeW8c+H9O+vjHC6uL3YdO2roRbH X-Received: by 2002:a17:902:bd0b:: with SMTP id p11-v6mr15037206pls.35.1541912420296; Sat, 10 Nov 2018 21:00:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541912420; cv=none; d=google.com; s=arc-20160816; b=hL3b1NdGCfmDHIW6QUpTa0EpOHhxOKg89wEwcwnQzqWvnqLssZ9BcCSgsUoJI555bM R6mAeyHHfzlcbN2pBfFjVVBXIK+LFpzg/RAnqAoeFIoOCShjmNdHqaRgskzBwdW6TlSx bvBoPOu1UB15yn6QE7j+Tq2xW4dJ6qv3CDGssXQR6Ry+VBG3OJuFSaHv8lcVff1TXQxK 6uw/Sg04jGTe31fUN+KXRfEDcQspoNbhIGQiM9A2AcIf4vCL/mSMGvJ90c67D7rpfMVx iQR2EMdHspKH8bG1hUAZngvzZ4lW7ABnob3rSb1xwBavZsNdt9pKtbDctqqiqwGjDgKU w6HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=3ZR0GX6zV5AaJMlllNZlFYuW1k9FVmH5E45X0UbSiao=; b=DWYrZLkJGUjU8LFGA6/mFjoW5ai+DqcO/saDRD3o1/k0U5aXwyTkSnu231mhPfmBE3 ybS9IuDpGdjyMzetPrX4BP3VNxg0DKmZbaecHTQp6dPL+H294Hl1nu0A7IiJmWVnumwe Ns30kGf5+wLOdlU7vacMJJY+jLhEUA5GuPqhsbH82rW3Dot5CyxDtMV+TLRIraMv76N4 W2hZgOYijeYY+tr+328D88xuGUloBHFYMPvKpT73qWyawvPoMxoCABzlTvFT+vc1Cvmf wyVjmZmB5VZ58o3Isb4vTh7B/jzELlv56UqHgkALf9q935dM740hA/BN2oQRTFMXCWH4 1vFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AkrX3P7S; 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 d9si10798807pgb.105.2018.11.10.21.00.19; Sat, 10 Nov 2018 21:00:20 -0800 (PST) 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=AkrX3P7S; 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 S1727430AbeKKOrj (ORCPT + 32 others); Sun, 11 Nov 2018 09:47:39 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:41540 "EHLO mail-wr1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbeKKOrj (ORCPT ); Sun, 11 Nov 2018 09:47:39 -0500 Received: by mail-wr1-f54.google.com with SMTP id v18-v6so5841653wrt.8 for ; Sat, 10 Nov 2018 21:00:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3ZR0GX6zV5AaJMlllNZlFYuW1k9FVmH5E45X0UbSiao=; b=AkrX3P7SQXmtssqNKNhvpUjnF8+6pRvDZji8k/ICQLBrDdAP/2ZY2DDsqAKYg1gDMu qQjC6XTNt6LvVqN2CDqlgyDqmcymqe7GyTc9oi0sGHBUOBA9uqaMJJKtTo7AH8nRH0RQ yO4uuHL2UN5/427kAJGgV+EmijOHT9OEwmSvY= 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; bh=3ZR0GX6zV5AaJMlllNZlFYuW1k9FVmH5E45X0UbSiao=; b=PZnO0A5OJ7ya2KvVKKz74fVSi0U55pgBDj74u4COvfwhrH76vSnhfOFLDuUNvD4ftH yvP07j6/u2shrlNmpANNBvILoH8wkCmSY9vRo3Fcr9p+EJQzDVCZFGppiZnMK3ic2vQH 8xnXDg7W4nVfzJDFNkL182hARfK/tMNxVcVCKu/kAajNub2fOyKGW3UUt3Q+GyYQiRqk vF/J9heCRnLt/67v44h17TIDB9Tds28bDED5SqEDVu+cWQuVspgWbN8prjueSlEl3GNE feMwkWRF2gwdFslYjocJGHdddjyGuckgGXdzjQr746GdHe2pSz/3DUicqCQ7ieerI57I n2Ig== X-Gm-Message-State: AGRZ1gKVsiJoclgp6c4+fqjk2Ex2y5UW6gdqBX6DRkkKexmsIancJXzy f2m8u1/bPqTx3vZm6vUvRUA2HQ== X-Received: by 2002:adf:80c8:: with SMTP id 66-v6mr12951009wrl.57.1541912409657; Sat, 10 Nov 2018 21:00:09 -0800 (PST) Received: from localhost.localdomain ([209.250.228.18]) by smtp.gmail.com with ESMTPSA id t187-v6sm4463802wmt.45.2018.11.10.21.00.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Nov 2018 21:00:08 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mike Leach , Robert Walker , Al Grant , Coresight ML Cc: Leo Yan Subject: [PATCH v1 0/5] perf cs-etm: Correct packets handling Date: Sun, 11 Nov 2018 12:59:38 +0800 Message-Id: <1541912383-19915-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org perf cs-etm module converts decoder elements to packets and then we have more context crossing packets to generate synthenize samples, finally perf tool can faciliate samples for statistics and report the results. This patch series is to address several issues found related with packets handling and samples generation when worked firstly on branch sample flags support for Arm CoreSight trace data, so this patch series also is dependency for another patch series for sample flags. The first two patches are mainly to fix issues in cs_etm__flush(): Patch 0001 corrects packets swapping in cs_etm__flush() and this can fix the wrong branch sample caused by the missed packets swapping; patch 0002 is to fix the wrong samples generation with stale packets at the end of every trace buffer. Patch 0003 is used to support NO_SYNC packet, otherwise the trace decoding cannot reflect the tracing discontinuity caused by NO_SYNC packet. Patch 0004/0005 has been published in the patch series 'perf cs-etm: Add support for sample flags' before but at this time I move them into this patch series due these two patches are more relative with packets handling. Patch 0004 is used to generate branch sample for exception packets; and patch 0005 is to track the exception number. This patch series is applied on the acme's perf core branch [1] with the latest commit f1d23afaf677 ("perf bpf: Reduce the hardcoded .max_entries for pid_maps") and has one prerequisite from Rob's patch 'perf: Support for Arm A32/T32 instruction sets in CoreSight trace' [2]. With applying the dependency patch, this patch series has been tested for branch samples dumping with below command on Juno board: # perf script -F,-time,+ip,+sym,+dso,+addr,+symoff -k vmlinux [1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=perf/core [2] http://archive.armlinux.org.uk/lurker/message/20181109.091126.9d69489d.en.html Leo Yan (5): perf cs-etm: Correct packets swapping in cs_etm__flush() perf cs-etm: Avoid stale branch samples when flush packet perf cs-etm: Support for NO_SYNC packet perf cs-etm: Generate branch sample for exception packet perf cs-etm: Track exception number tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 91 ++++++++++++++++++++++--- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 11 +-- tools/perf/util/cs-etm.c | 65 +++++++++++++++--- 3 files changed, 146 insertions(+), 21 deletions(-) -- 2.7.4