From patchwork Thu Dec 21 08:20:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 122513 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp580174qgn; Thu, 21 Dec 2017 00:20:41 -0800 (PST) X-Google-Smtp-Source: ACJfBos8qkf8ysa2rQqJgfhByXEc4fzRLDxUsFua2n4azkUpCB/9nkKthmFobDZVT8p3JNTc6m9v X-Received: by 10.84.129.132 with SMTP id b4mr10120052plb.326.1513844441766; Thu, 21 Dec 2017 00:20:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513844441; cv=none; d=google.com; s=arc-20160816; b=RD8T0VFTOJyAi7T4GTk0YSegXjFDqCNn8BotqsOflMJnBAXJ41x7yjEBxTTuhTrTQI NPvH4cekXJc8rpiEXPBgtntGH/GN0gsp7ioMvDoLzAH9TOBIN/Md9+HJlQZZKXixErSs spCQp89RgehpGKSfLxNoL/RuqVy/pdJhIFxAANxoXHIJjWudVPr+jJJORk4IswI5eyt1 WRW7ex93vr5ZaOzbviSxKPN95rHpOoPpi6jK14H4rAYkuowzgbwhzB8B5wHf0TXk+sXT oMX8YGmkhWI9/LepOKLaYMUYHuGVixfgxQclL3IoqQD40rfG7HXY3cr/guyoLJWJlYHd snxg== 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:arc-authentication-results; bh=XjylOiWs4h1qVFh92GWK/iMlvrY+sIJMjeCE/nWD9Q8=; b=aecKy3shV9FwGkSU19GmJA/v/9ufbna6zcGhp1SvWZ6tzVF/BryC4lss76X5gPQkNT 3a+O3vyXcv5hR2WvY77LddQhIWZhaFmV9Qp60ZbdYAM87AC9vpaYatHNCi6clp/cAa3w YB6Y7nmu7BXpcdK64bxG+dphSn2zA5iZ4x5ar1A6IEgg363uhE9EiFeyaVl/JQovLjtF VAJQFN2tdkn06yn8g9NqP4ihFgpEFN0Z7B9TXg0RONYJRW9+4BHFQe9UEnxf+VQUYwTY nH6B5cLO/Jv7m+5ubQu1/+mAiQq9AbfJbySoUGti34WPZtRY4lXWzQFRgRMDAD8yymhE 9c4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dtNtzBbd; 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 74si14477614pfk.175.2017.12.21.00.20.41; Thu, 21 Dec 2017 00:20:41 -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=dtNtzBbd; 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 S1751502AbdLUIUi (ORCPT + 28 others); Thu, 21 Dec 2017 03:20:38 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:34701 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbdLUIUf (ORCPT ); Thu, 21 Dec 2017 03:20:35 -0500 Received: by mail-pl0-f67.google.com with SMTP id d21so10587781pll.1 for ; Thu, 21 Dec 2017 00:20:34 -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=XjylOiWs4h1qVFh92GWK/iMlvrY+sIJMjeCE/nWD9Q8=; b=dtNtzBbddlq6JVoPEo2sdOgV/eQE0gbctQllOwsurf8nFhyImF6pMyr7gK5afCRVpV UwN/7Og8IRuQnHwcE25IvxWVpA2nhrjfiR8uKNsJh909dsU4ReF59Ow9l+Df+nmM+Ikn AEWFCzUkULazZ7h428j0uin50oi4pSETy0fUE= 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=XjylOiWs4h1qVFh92GWK/iMlvrY+sIJMjeCE/nWD9Q8=; b=cLdOOv5pES7e02BKsSy2aota9i7jPd3o+wvQWeyPZeeE7Gv7vUHQp49VHqS8kcKzkF F+jlFDXrQGOqdAG5lQKQzH5z3ziaVIl1tail6dTlvR2Y3WDp4F3bky2YSTcbvx4W16Jw K2ZhDUFQqfokoEGTkIM3bCuYfJr+K/sSeHHRpWF5znr3DtpBIxLeFZafeCJ9B9OLc7S/ e4wtGGp65e3Jzz1/9yxJRsjHre1os1jcvGYx+rhqorOd6JLT0YZ7UINl2Ck7sRG2ckvv JXOoVKZjUDnOzpoVHsgEoucvSX2ZMpz0U/ZhBBPSnf7o7fpXbMEOIviI/DbBCSnne/xL torA== X-Gm-Message-State: AKGB3mIOERkcLacdHFWNl//t9Ed4UwGEkRIw2kt7fR4UdWv+3cyC0zTo dVRpRyWmoV22caQyLvzu7BUNPQ== X-Received: by 10.84.232.194 with SMTP id x2mr10085551plm.111.1513844434530; Thu, 21 Dec 2017 00:20:34 -0800 (PST) Received: from localhost.localdomain (li159-223.members.linode.com. [173.230.149.223]) by smtp.gmail.com with ESMTPSA id r86sm43699720pfk.114.2017.12.21.00.20.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Dec 2017 00:20:33 -0800 (PST) From: Leo Yan To: Jonathan Corbet , Mathieu Poirier , Greg Kroah-Hartman , Will Deacon , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: Leo Yan Subject: [PATCH v3 0/6] Coresight: support panic kdump Date: Thu, 21 Dec 2017 16:20:09 +0800 Message-Id: <1513844415-11427-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 This patch set is to explore Coresight trace data for postmortem debugging. When kernel panic happens, the Coresight panic kdump can help save on-chip trace data and tracer metadata into DRAM, later relies on kdump and crash/perf for "offline" analysis. The documentation is important to understand the purpose of Coresight panic kdump, the implementation and usage. Patches 0001/0002 are used to relocate and add related documenation. Patch 0003 introduces the simple panic kdump framework which can be easily used by Coresight devices. Patches 0004/0005 support panic kdump for ETB; Patch 0006 supports the dump for ETMv4. As Mathieu suggested, patch 0006 distinguish two different tracer enabling mode: sysFS interface and perf mode. This patch set have been verified on 96boards Hikey with tracer enabling by sysFS interface. Changes from v2: * Add the two patches for documentation. * Following Mathieu suggestion, reworked the panic kdump framework, removed the useless flag "PRE_PANIC". * According to comment, changed to add and delete kdump node operations in sink enable/disable functions; * According to Mathieu suggestion, handle kdump node addition/deletion/updating separately for sysFS interface and perf method. Changes from v1: * Add support to dump ETMv4 meta data. * Wrote 'crash' extension csdump.so so rely on it to generate 'perf' format compatible file. * Refactored panic dump driver to support pre & post panic dump. Changes from RFC: * Follow Mathieu's suggestion, use general framework to support dump functionality. * Changed to use perf to analyse trace data. Leo Yan (6): doc: Add Coresight documentation directory doc: Add documentation for Coresight panic kdump coresight: Support panic kdump functionality coresight: tmc: Hook callback for panic kdump coresight: Add and delete sink callback for panic kdump list coresight: etm4x: Support panic kdump Documentation/trace/coresight-cpu-debug.txt | 187 ------------ Documentation/trace/coresight.txt | 332 --------------------- .../trace/coresight/coresight-cpu-debug.txt | 187 ++++++++++++ .../trace/coresight/coresight-panic-kdump.txt | 91 ++++++ Documentation/trace/coresight/coresight.txt | 332 +++++++++++++++++++++ MAINTAINERS | 5 +- drivers/hwtracing/coresight/Kconfig | 9 + drivers/hwtracing/coresight/Makefile | 1 + drivers/hwtracing/coresight/coresight-etm-perf.c | 12 +- drivers/hwtracing/coresight/coresight-etm4x.c | 23 ++ drivers/hwtracing/coresight/coresight-etm4x.h | 15 + .../hwtracing/coresight/coresight-panic-kdump.c | 154 ++++++++++ drivers/hwtracing/coresight/coresight-priv.h | 13 + drivers/hwtracing/coresight/coresight-tmc-etf.c | 29 ++ drivers/hwtracing/coresight/coresight.c | 12 + include/linux/coresight.h | 7 + 16 files changed, 887 insertions(+), 522 deletions(-) delete mode 100644 Documentation/trace/coresight-cpu-debug.txt delete mode 100644 Documentation/trace/coresight.txt create mode 100644 Documentation/trace/coresight/coresight-cpu-debug.txt create mode 100644 Documentation/trace/coresight/coresight-panic-kdump.txt create mode 100644 Documentation/trace/coresight/coresight.txt create mode 100644 drivers/hwtracing/coresight/coresight-panic-kdump.c -- 2.7.4