aboutsummaryrefslogtreecommitdiff
path: root/src/target/armv7m_trace.h
diff options
context:
space:
mode:
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>2020-06-08 23:47:46 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2020-11-07 20:49:57 +0000
commit9cce6b3c763e883faea545b9ffbda19ec8164804 (patch)
tree2dd4f7eec1c2de9080c7ea0816c8444d4e32b068 /src/target/armv7m_trace.h
parent7e6556b3cad8c82d4670a68cd49756dabb8c4729 (diff)
downloadriscv-openocd-9cce6b3c763e883faea545b9ffbda19ec8164804.zip
riscv-openocd-9cce6b3c763e883faea545b9ffbda19ec8164804.tar.gz
riscv-openocd-9cce6b3c763e883faea545b9ffbda19ec8164804.tar.bz2
armv7m: add a TCP channel to stream captured trace
When trace capturing the trace is enabled using 'tpiu_config internal' (via the internal mode), OpenOCD can collect the trace buffers then append it to a specified file or named pipe and propagate the trace to 'tcl_trace' command. This change is allowing OpenOCD to stream the captured trace over TCP. When using this configuration OpenOCD acts like a server and multiple clients can connect and receive the captured trace. Example on STM32F7 running at 216MHz: itm port 0 on tpiu config internal :3344 uart off 216000000 Change-Id: Idea43e7e26e87b98a33da7fb9acf7ea50fe3b345 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/5345 Tested-by: jenkins Reviewed-by: Karl Palsson <karlp@tweak.net.au> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/armv7m_trace.h')
-rw-r--r--src/target/armv7m_trace.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/target/armv7m_trace.h b/src/target/armv7m_trace.h
index e5879fb..076f9d5 100644
--- a/src/target/armv7m_trace.h
+++ b/src/target/armv7m_trace.h
@@ -18,6 +18,7 @@
#ifndef OPENOCD_TARGET_ARMV7M_TRACE_H
#define OPENOCD_TARGET_ARMV7M_TRACE_H
+#include <server/server.h>
#include <target/target.h>
#include <command.h>
@@ -32,8 +33,14 @@ enum trace_config_type {
TRACE_CONFIG_TYPE_INTERNAL /**< trace output is handled by OpenOCD adapter driver */
};
+enum trace_internal_channel {
+ TRACE_INTERNAL_CHANNEL_TCL_ONLY, /** trace data is sent only to 'tcl_trace' */
+ TRACE_INTERNAL_CHANNEL_FILE, /** trace data is appended to a file */
+ TRACE_INTERNAL_CHANNEL_TCP /** trace data is appended to a TCP/IP port*/
+};
+
enum tpiu_pin_protocol {
- TPIU_PIN_PROTOCOL_SYNC, /**< synchronous trace output */
+ TPIU_PIN_PROTOCOL_SYNC, /**< synchronous trace output */
TPIU_PIN_PROTOCOL_ASYNC_MANCHESTER, /**< asynchronous output with Manchester coding */
TPIU_PIN_PROTOCOL_ASYNC_UART /**< asynchronous output with NRZ coding */
};
@@ -49,6 +56,9 @@ struct armv7m_trace_config {
/** Currently active trace capture mode */
enum trace_config_type config_type;
+ /** The used channel when internal mode is selected */
+ enum trace_internal_channel internal_channel;
+
/** Currently active trace output mode */
enum tpiu_pin_protocol pin_protocol;
/** TPIU formatter enable/disable (in async mode) */
@@ -73,8 +83,10 @@ struct armv7m_trace_config {
unsigned int traceclkin_freq;
/** Current frequency of trace port */
unsigned int trace_freq;
- /** Handle to output trace data in INTERNAL capture mode */
+ /** Handle to output trace data in INTERNAL capture mode via file */
FILE *trace_file;
+ /** Handle to output trace data in INTERNAL capture mode via tcp */
+ struct service *trace_service;
};
extern const struct command_registration armv7m_trace_command_handlers[];