diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-03-20 10:56:30 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-03-20 10:56:30 -0600 |
commit | f8c6f5c5181f02eeb969c501ef0b5fef363a2fb1 (patch) | |
tree | 67f5f710b13ac0d5524e366866763e2b1b106e8f /nuttx/arch/x86 | |
parent | 35392d553c92ad96c944800bbb50defb4ca66f13 (diff) | |
download | nuttx-f8c6f5c5181f02eeb969c501ef0b5fef363a2fb1.tar.gz nuttx-f8c6f5c5181f02eeb969c501ef0b5fef363a2fb1.tar.bz2 nuttx-f8c6f5c5181f02eeb969c501ef0b5fef363a2fb1.zip |
Add option to dump buffered USB trace data on an assertion
Diffstat (limited to 'nuttx/arch/x86')
-rw-r--r-- | nuttx/arch/x86/src/common/up_assert.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/nuttx/arch/x86/src/common/up_assert.c b/nuttx/arch/x86/src/common/up_assert.c index 1cb2d682f..b67db487b 100644 --- a/nuttx/arch/x86/src/common/up_assert.c +++ b/nuttx/arch/x86/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/common/up_assert.c * - * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,8 @@ #include <nuttx/irq.h> #include <nuttx/arch.h> #include <arch/arch.h> +#include <nuttx/usb/usbdev_trace.h> + #include <arch/board/board.h> #include "up_arch.h" @@ -56,6 +58,11 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* USB trace dumping */ + +#ifndef CONFIG_USBDEV_TRACE +# undef CONFIG_ARCH_USBDUMP +#endif /* Output debug info if stack dump is selected -- even if * debug is not selected. @@ -109,6 +116,18 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base) #endif /**************************************************************************** + * Name: assert_tracecallback + ****************************************************************************/ + +#ifdef CONFIG_ARCH_USBDUMP +static int assert_tracecallback(struct usbtrace_s *trace, void *arg) +{ + usbtrace_trprintf((trprintf_t)lowsyslog, trace->event, trace->value); + return 0; +} +#endif + +/**************************************************************************** * Name: up_dumpstate ****************************************************************************/ @@ -199,7 +218,13 @@ static void up_dumpstate(void) if (current_regs != NULL) { up_registerdump((uint32_t*)current_regs); - } + } + +#ifdef CONFIG_ARCH_USBDUMP + /* Dump USB trace data */ + + (void)usbtrace_enumerate(assert_tracecallback, NULL); +#endif } #else # define up_dumpstate() |