From patchwork Sun Apr 28 02:17:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 240216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C9FE32C00B1 for ; Sun, 28 Apr 2013 12:19:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 377D54A184; Sun, 28 Apr 2013 04:19:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L-SiX81gohQ3; Sun, 28 Apr 2013 04:19:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 311A64A1A1; Sun, 28 Apr 2013 04:18:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0267B4A187 for ; Sun, 28 Apr 2013 04:18:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NmEI2Lu0pH4z for ; Sun, 28 Apr 2013 04:18:28 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qa0-f73.google.com (mail-qa0-f73.google.com [209.85.216.73]) by theia.denx.de (Postfix) with ESMTPS id 581D04A191 for ; Sun, 28 Apr 2013 04:18:24 +0200 (CEST) Received: by mail-qa0-f73.google.com with SMTP id p6so114268qad.4 for ; Sat, 27 Apr 2013 19:18:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=vLzEsfrGjsmTvqH9HrJ+O0B0pXa7uLncHKkDx3YnsAw=; b=VdlB7pWyLYogTTeyTal5zYLPFosCEJxsyb+/TW+V6icj8h6S9zslUSWhOzKXVYdqIj AnbUvU/54XC1Y4jdDqC4LahigHvvjYJ8+3VBw5gZezpBLTUzOcP/0o/dph1wicdFpMNS fpDJpwu9bv6x/42rrang5Ag6zx0nU0N1j4cRl7qHyI4VCgGqxAvhikcKlTFq/byLqYXZ 8i+6wEvKQmVFsZsJdoJgVh0ZL9GS3U0SywsTqXQI+DxZMnvR6FrJAowQKjR+j7CWTXF0 jXspsd2d95VP20TShgiAizld2WUfcs9ZnsK9QPNwem/MAwz1Vr90kukVWZ1+rOxsuhRV BSpQ== X-Received: by 10.236.126.165 with SMTP id b25mr26330274yhi.2.1367115502095; Sat, 27 Apr 2013 19:18:22 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id n23si390709yhi.7.2013.04.27.19.18.22 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Sat, 27 Apr 2013 19:18:22 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id EC86A5A402F; Sat, 27 Apr 2013 19:18:21 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id CC08316088E; Sat, 27 Apr 2013 19:18:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 27 Apr 2013 19:17:45 -0700 Message-Id: <1367115472-29531-9-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367115472-29531-1-git-send-email-sjg@chromium.org> References: <1367115472-29531-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQm/ssAlTduAHuvjuZayL0aQpndZDI1tsWjN+Yzv7kL3cO98K5fuG8tYwxFlUusLvGoY3Ng5uiP2TnomDenQQGsd1fSE8FixIySgRKy8QBQCrw3W5eIpcudFtgkRB2Sh+AcUYaOH9PXS2iSZn0fwbnlgJvT3lT8Ia6jVxG5p7bc8kefmgoQDWuZbApFfr0s38q5+Rnna Cc: Tom Rini , u-boot-review@google.com Subject: [U-Boot] [RFC PATCH 08/15] sandbox: Support trace feature X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Support tracing on sandbox by adding suitable CONFIG options. To enable it, compile U-Boot with FTRACE=1. The timer functions are marked to skip tracing, since these are called from the tracing code itself, and we want to avoid an infinite loop. Signed-off-by: Simon Glass --- arch/sandbox/cpu/cpu.c | 2 +- arch/sandbox/cpu/os.c | 2 +- include/configs/sandbox.h | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index dd8d495..e9385de 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -37,7 +37,7 @@ void __udelay(unsigned long usec) os_usleep(usec); } -unsigned long timer_get_us(void) +unsigned long __attribute__((no_instrument_function)) timer_get_us(void) { return os_get_nsec() / 1000; } diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index d075407..541e450 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -152,7 +152,7 @@ void os_usleep(unsigned long usec) usleep(usec); } -u64 os_get_nsec(void) +u64 __attribute__((no_instrument_function)) os_get_nsec(void) { #if defined(CLOCK_MONOTONIC) && defined(_POSIX_MONOTONIC_CLOCK) struct timespec tp; diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 788207d..d704329 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -22,6 +22,19 @@ #ifndef __CONFIG_H #define __CONFIG_H +#ifdef FTRACE +#define CONFIG_TRACE +#define CONFIG_CMD_TRACE +#define CONFIG_TRACE_BUFFER_SIZE (16 << 20) +#define CONFIG_TRACE_EARLY_SIZE (8 << 20) +#define CONFIG_TRACE_EARLY +#define CONFIG_TRACE_EARLY_ADDR 0x00100000 + +#endif + +#define CONFIG_BOOTSTAGE +#define CONFIG_BOOTSTAGE_REPORT + /* Number of bits in a C 'long' on this architecture */ #define CONFIG_SANDBOX_BITS_PER_LONG 64