From patchwork Tue Feb 15 06:11:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arve_Hj=C3=B8nnev=C3=A5g?= X-Patchwork-Id: 557771 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1F6CkuK005039 for ; Tue, 15 Feb 2011 06:12:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754201Ab1BOGME (ORCPT ); Tue, 15 Feb 2011 01:12:04 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:45219 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753993Ab1BOGMB (ORCPT ); Tue, 15 Feb 2011 01:12:01 -0500 Received: by mail-pw0-f46.google.com with SMTP id 3so25038pwj.19 for ; Mon, 14 Feb 2011 22:12:01 -0800 (PST) Received: by 10.142.191.2 with SMTP id o2mr3996595wff.14.1297750320548; Mon, 14 Feb 2011 22:12:00 -0800 (PST) Received: from localhost.localdomain (arve.mtv.corp.google.com [172.18.103.168]) by mx.google.com with ESMTPS id v19sm5222219wfh.0.2011.02.14.22.11.58 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Feb 2011 22:11:59 -0800 (PST) From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= To: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Russell King , Alexander Shishkin , Jason Wessel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH 7/8] ARM: etm: Return the entire trace buffer if it is empty after reset Date: Mon, 14 Feb 2011 22:11:15 -0800 Message-Id: <1297750276-12475-7-git-send-email-arve@android.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1296701663-12168-1-git-send-email-arve@android.com> References: <1296701663-12168-1-git-send-email-arve@android.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Feb 2011 06:12:46 +0000 (UTC) diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 8126beb..4ad1257 100644 --- a/arch/arm/kernel/etm.c +++ b/arch/arm/kernel/etm.c @@ -44,6 +44,7 @@ struct tracectx { unsigned long range_end; unsigned long data_range_start; unsigned long data_range_end; + bool dump_initial_etb; struct device *dev; struct clk *emu_clk; struct mutex mutex; @@ -105,6 +106,7 @@ static int trace_start(struct tracectx *t) etb_unlock(t); + t->dump_initial_etb = false; etb_writel(t, 0, ETBR_WRITEADDR); etb_writel(t, 0, ETBR_FORMATTERCTRL); etb_writel(t, 1, ETBR_CTRL); @@ -311,6 +313,8 @@ static ssize_t etb_read(struct file *file, char __user *data, etb_unlock(t); total = etb_getdatalen(t); + if (total == 0 && t->dump_initial_etb) + total = t->etb_bufsz; if (total == t->etb_bufsz) first = etb_readl(t, ETBR_WRITEADDR); @@ -385,6 +389,7 @@ static int __init etb_probe(struct amba_device *dev, struct amba_id *id) goto out_release; } + t->dump_initial_etb = true; amba_set_drvdata(dev, t); etb_unlock(t);