12 #ifdef HAVE_ARPA_INET_H
13 #include <arpa/inet.h>
21 #include <netinet/tcp.h>
22 #include <sys/ioctl.h>
38 #define ESP32_APPTRACE_USER_BLOCK_CORE(_v_) ((_v_) >> 15)
39 #define ESP32_APPTRACE_USER_BLOCK_LEN(_v_) ((_v_) & ~BIT(15))
41 #define ESP32_APPTRACE_USER_BLOCK_HDR_SZ 4
43 #define ESP_APPTRACE_CMD_MODE_GEN 0
44 #define ESP_APPTRACE_CMD_MODE_SYSVIEW 1
45 #define ESP_APPTRACE_CMD_MODE_SYSVIEW_MCORE 2
46 #define ESP_APPTRACE_CMD_MODE_SYNC 3
48 #define ESP32_APPTRACE_TGT_STATE_TMO 5000
49 #define ESP_APPTRACE_BLOCKS_POOL_SZ 10
69 #define APPTRACE_BLOCK_SIZE_OFFSET 0
70 #define APPTRACE_WR_SIZE_OFFSET 2
81 uint32_t *fired_target_num);
100 int wr_sz = write(dest_data->
fout, data,
size);
102 LOG_ERROR(
"Failed to write %d bytes to out file (%d)! Written %d.",
size, errno, wr_sz);
112 if (dest_data->
fout > 0)
113 close(dest_data->
fout);
122 LOG_ERROR(
"Failed to alloc mem for file dest!");
126 LOG_INFO(
"Open file %s", dest_name);
127 dest_data->
fout = open(dest_name, O_WRONLY | O_CREAT | O_TRUNC |
O_BINARY, 0666);
128 if (dest_data->
fout <= 0) {
129 LOG_ERROR(
"Failed to open file %s", dest_name);
134 dest->
priv = dest_data;
168 LOG_ERROR(
"Failed to write %u bytes to out socket (%d)! Written %d.",
size, errno, wr_sz);
178 if (dest_data->
sockfd > 0)
186 const char *port_sep = strchr(dest_name,
':');
188 if (!port_sep || port_sep == dest_name || port_sep == dest_name + strlen(dest_name) - 1) {
189 LOG_ERROR(
"apptrace: Invalid connection URI, format should be tcp://host:port");
192 size_t hostname_len = port_sep - dest_name;
194 char hostname[64] = { 0 };
195 if (hostname_len >=
sizeof(hostname)) {
196 LOG_ERROR(
"apptrace: Hostname too long");
199 memcpy(hostname, dest_name, hostname_len);
201 const char *port_str = port_sep + 1;
204 #ifdef AI_NUMERICSERV
205 flags |= AI_NUMERICSERV;
207 struct addrinfo hint = {
208 .ai_family = AF_UNSPEC,
209 .ai_socktype = SOCK_STREAM,
213 int res = getaddrinfo(hostname, port_str, &hint, &ai);
215 LOG_ERROR(
"apptrace: Failed to resolve host name: %s", hostname);
219 for (
struct addrinfo *ai_it = ai; ai_it; ai_it = ai_it->ai_next) {
220 sockfd = socket(ai_it->ai_family, ai_it->ai_socktype, ai_it->ai_protocol);
222 LOG_DEBUG(
"apptrace: Failed to create socket (%d, %d, %d) (%s)",
230 char cur_hostname[NI_MAXHOST];
231 char cur_portname[NI_MAXSERV];
233 getnameinfo(ai_it->ai_addr, ai_it->ai_addrlen, cur_hostname,
234 sizeof(cur_hostname),
235 cur_portname,
sizeof(cur_portname),
236 NI_NUMERICHOST | NI_NUMERICSERV);
240 LOG_INFO(
"apptrace: Trying to connect to %s:%s", cur_hostname, cur_portname);
241 if (connect(
sockfd, ai_it->ai_addr, ai_it->ai_addrlen) < 0) {
244 LOG_WARNING(
"apptrace: Connection failed (%s)", strerror(errno));
251 LOG_ERROR(
"apptrace: Could not connect to %s:%s", hostname, port_str);
258 LOG_ERROR(
"apptrace: Failed to alloc mem for tcp dest!");
264 dest->
priv = dest_data;
277 for (i = 0; i < max_dests; i++) {
278 if (strncmp(dest_paths[i],
"file://", 7) == 0)
280 else if (strncmp(dest_paths[i],
"con:", 4) == 0)
282 else if (strncmp(dest_paths[i],
"tcp://", 6) == 0)
288 LOG_ERROR(
"apptrace: Failed to init trace data destination '%s'!", dest_paths[i]);
298 for (
unsigned int i = 0; i < max_dests; i++) {
299 if (dest[i].clean && dest[i].
priv) {
353 LOG_DEBUG(
"esp32_apptrace_ready_block_put");
390 LOG_ERROR(
"Failed to wait for pended trace blocks!");
422 command_print(
cmd,
"Too many cores configured! Max %d cores are supported.",
429 cmd_ctx->
cpus[i++] = curr;
506 #define ESP32_APPTRACE_CMD_NUM_ARG_CHECK(_cmd_, _arg_, _start_, _end_) \
508 if ((_arg_) == 0 && (_start_) == (_end_)) { \
509 command_print(_cmd_, "Invalid '" # _arg_ "' arg!"); \
521 cmd_data->
poll_period = strtoul(argv[0], &end, 10);
524 cmd_data->
max_len = strtoul(argv[1], &end, 10);
527 int32_t tmo = strtol(argv[2], &end, 10);
531 cmd_data->
wait4halt = strtoul(argv[3], &end, 10);
534 cmd_data->
skip_len = strtoul(argv[4], &end, 10);
570 cmd_data = calloc(1,
sizeof(*cmd_data));
571 assert(cmd_data &&
"No memory for command data!");
582 cmd_data->
max_len = UINT32_MAX;
588 LOG_USER(
"App trace params: from %d cores, size %" PRId32
" bytes, stop_tmo %g s, poll period %" PRId32
589 " ms, wait_rst %d, skip %" PRId32
" bytes", cmd_ctx->
cores_num,
621 uint32_t trace_sz = 0;
625 LOG_USER(
"Tracing is %s. Size is %" PRId32
" of %" PRId32
" @ %f (%f) KiB/s",
626 !ctx->
running ?
"STOPPED" :
"RUNNING",
628 cmd_data ? cmd_data->
max_len : 0,
631 LOG_USER(
"Data: blocks incomplete %" PRId32
", lost bytes: %" PRId32,
635 LOG_USER(
"Block read time [%f..%f] ms",
638 LOG_USER(
"Block proc time [%f..%f] ms",
668 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
675 LOG_ERROR(
"Failed to halt target (%d)!", res);
680 LOG_ERROR(
"Failed to wait halt target %s / %d (%d)!",
688 LOG_DEBUG(
"Read current block statuses");
689 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
693 LOG_ERROR(
"Failed to read trace status (%d)!", res);
703 uint32_t bp_addr = stat;
706 LOG_ERROR(
"Failed to set breakpoint (%d)!", res);
713 LOG_ERROR(
"Failed to resume target (%d)!", res);
723 LOG_ERROR(
"Failed to wait halt on bp (%d)!", res);
731 LOG_ERROR(
"Failed to read trace status (%d)!", res);
745 LOG_ERROR(
"Failed to read trace status (%d)!", res);
772 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
773 if (target_to_connect[k].
block_id > max_id)
774 max_id = target_to_connect[k].
block_id;
776 for (
unsigned int k = 0; k < ctx->
cores_num; k++)
777 target_to_connect[k].
block_id = max_id;
779 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
793 bool smp_resumed =
false;
794 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
795 if (smp_resumed && ctx->
cpus[k]->
smp) {
821 uint32_t buf_sz[2] = {
sizeof(hdr),
size };
822 const uint8_t *bufs[2] = { (
const uint8_t *)&hdr, data };
842 if (usr_len != wr_len) {
843 LOG_ERROR(
"Incomplete block sz %" PRId32
", wr %" PRId32, usr_len, wr_len);
852 uint32_t *fired_target_num)
854 if (fired_target_num)
855 *fired_target_num = UINT32_MAX;
857 for (
unsigned int i = 0; i < ctx->
cores_num; i++) {
866 if (fired_target_num)
867 *fired_target_num = i;
875 unsigned int core_id,
881 LOG_DEBUG(
"Got block %" PRId32
" bytes [%x %x...%x %x]", data_len, data[12], data[13],
882 data[data_len - 2], data[data_len - 1]);
884 uint32_t wr_idx = 0, wr_chunk_len = data_len;
891 if (wr_chunk_len > 0) {
894 LOG_ERROR(
"Failed to write %" PRId32
" bytes to dest 0!", data_len);
909 LOG_ERROR(
"Failed to stop trace read time measure!");
919 uint32_t processed = 0;
924 while (processed < block->data_len) {
930 int res = ctx->
process_data(ctx, core_id, block->
data + processed + hdr_sz, usr_len);
932 LOG_ERROR(
"Failed to process %" PRId32
" bytes!", usr_len);
935 processed += usr_len + hdr_sz;
960 LOG_ERROR(
"Failed to free ready block!");
972 unsigned int busy_target_num = 0;
974 for (
unsigned int i = 0; i < ctx->
cores_num; i++) {
978 LOG_ERROR(
"Failed to read apptrace control reg for cpu(%d) res(%d)!", i, res);
986 LOG_ERROR(
"Failed to read trace status (%d)!", res);
991 if (++busy_target_num == ctx->
cores_num) {
1003 LOG_ERROR(
"Failed to write apptrace control reg for cpu(%d) res(%d)!", i, res);
1009 LOG_ERROR(
"Failed to re-start idle time measure!");
1023 uint32_t fired_target_num = 0;
1051 if (fired_target_num == UINT32_MAX) {
1058 for (
unsigned int i = 0; i < ctx->
cores_num; i++) {
1067 for (
unsigned int i = 0; i < ctx->
cores_num; i++) {
1087 LOG_ERROR(
"Failed to measure idle time!");
1107 LOG_ERROR(
"Failed to start trace read time measurement!");
1121 LOG_ERROR(
"Failed to start block read time measurement!");
1141 LOG_ERROR(
"Failed to measure block read time!");
1148 if (brt < ctx->stats.min_blk_read_time)
1153 LOG_ERROR(
"Failed to start block proc time measurement!");
1160 for (
unsigned int i = 0; i < ctx->
cores_num; i++) {
1161 if (i == fired_target_num)
1191 LOG_ERROR(
"Failed to free ready block!");
1199 LOG_ERROR(
"Failed to start idle time measure!");
1206 LOG_ERROR(
"Failed to stop block proc time measure!");
1213 if (bt < ctx->stats.min_blk_proc_time)
1227 LOG_ERROR(
"Failed to stop trace read time measurement!");
1230 LOG_ERROR(
"Failed to unregister target timer handler (%d)!", res);
1235 LOG_ERROR(
"sysview: Failed to stop tracing!");
1240 LOG_ERROR(
"Failed to wait for pended blocks (%d)!", res);
1243 LOG_ERROR(
"Failed to disconnect targets (%d)!", res);
1247 LOG_ERROR(
"Failed to cleanup cmd ctx (%d)!", res);
1254 uint32_t fired_target_num = 0;
1261 LOG_ERROR(
"sysview: Failed to read target data info!");
1264 if (fired_target_num == UINT32_MAX) {
1267 fired_target_num = 0;
1271 cmds,
sizeof(cmds));
1273 LOG_ERROR(
"sysview: Failed to start tracing!");
1282 uint32_t old_block_id, fired_target_num = 0, empty_target_num = 0;
1298 LOG_ERROR(
"sysview: Failed to halt targets (%d)!", res);
1303 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
1305 fired_target_num = k;
1331 LOG_ERROR(
"sysview: Failed to stop tracing!");
1335 empty_target_num = fired_target_num ? 0 : 1;
1342 LOG_ERROR(
"sysview: Failed to ack data on target '%s' (%d)!",
1349 bool smp_resumed =
false;
1350 for (
unsigned int k = 0; k < ctx->
cores_num; k++) {
1351 if (smp_resumed && ctx->
cpus[k]->
smp) {
1364 old_block_id =
target_state[fired_target_num].block_id;
1366 LOG_ERROR(
"Failed to start trace stop timeout measurement!");
1375 LOG_ERROR(
"sysview: Failed to read targets data info!");
1378 if (fired_target_num == UINT32_MAX) {
1382 fired_target_num = 0;
1384 if (
target_state[fired_target_num].block_id != old_block_id) {
1397 empty_target_num = fired_target_num ? 0 : 1;
1404 LOG_ERROR(
"sysview: Failed to ack data on target '%s' (%d)!",
1413 LOG_ERROR(
"Failed to process trace block %" PRId32
" bytes!",
1418 old_block_id =
target_state[fired_target_num].block_id;
1422 LOG_ERROR(
"Failed to start trace stop timeout measurement!");
1427 LOG_INFO(
"Stop waiting for the last data due to timeout.");
1461 if (strcmp(argv[0],
"start") == 0) {
1500 goto _on_start_error;
1506 goto _on_start_error;
1525 goto _on_start_error;
1527 }
else if (strcmp(argv[0],
"stop") == 0) {
1534 }
else if (strcmp(argv[0],
"status") == 0) {
1536 LOG_ERROR(
"Failed to measure trace read time!");
1539 }
else if (strcmp(argv[0],
"dump") == 0) {
1560 LOG_ERROR(
"Failed to poll target for trace data (%d)!", res);
1570 LOG_ERROR(
"Failed to wait for pended blocks (%d)!", res);
1609 .handler = esp32_cmd_apptrace,
1612 "App Tracing: application level trace control. Starts, stops or queries tracing process status.",
1614 "(start <destination> [poll_period [trace_size [stop_tmo [wait4halt [skip_size]]]]) | (stop) | (status) | (dump <destination>)",
1618 .handler = esp32_cmd_sysview,
1621 "App Tracing: SEGGER SystemView compatible trace control. Starts, stops or queries tracing process status.",
1623 "(start file://<outfile1> [file://<outfile2>] [poll_period [trace_size [stop_tmo [wait4halt [skip_size]]]]) | (stop) | (status)",
1626 .name =
"sysview_mcore",
1627 .handler = esp32_cmd_sysview_mcore,
1630 "App Tracing: Espressif multi-core SystemView trace control. Starts, stops or queries tracing process status.",
1632 "(start file://<outfile> [poll_period [trace_size [stop_tmo [wait4halt [skip_size]]]]) | (stop) | (status)",
int breakpoint_remove(struct target *target, target_addr_t address)
int breakpoint_add(struct target *target, target_addr_t address, unsigned int length, enum breakpoint_type type)
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
#define ERROR_COMMAND_ARGUMENT_INVALID
static int esp32_apptrace_cmd_cleanup(struct esp32_apptrace_cmd_ctx *cmd_ctx)
static int esp32_apptrace_check_connection(struct esp32_apptrace_cmd_ctx *ctx)
static struct esp32_apptrace_block * esp32_apptrace_ready_block_get(struct esp32_apptrace_cmd_ctx *ctx)
int esp_apptrace_usr_block_write(const struct esp32_apptrace_hw *hw, struct target *target, uint32_t block_id, const uint8_t *data, uint32_t size)
#define ESP_APPTRACE_CMD_MODE_SYNC
static int esp32_apptrace_console_dest_write(void *priv, uint8_t *data, int size)
static int esp32_apptrace_safe_halt_targets(struct esp32_apptrace_cmd_ctx *ctx, struct esp32_apptrace_target_state *targets)
static uint32_t esp32_apptrace_usr_block_check(struct esp32_apptrace_cmd_ctx *ctx, uint8_t *hdr_buf)
COMMAND_HANDLER(esp32_cmd_apptrace)
static bool is_sysview_mode(int mode)
#define ESP32_APPTRACE_USER_BLOCK_LEN(_v_)
static int esp32_apptrace_wait4halt(struct esp32_apptrace_cmd_ctx *ctx, struct target *target)
static int esp32_sysview_stop(struct esp32_apptrace_cmd_ctx *ctx)
static uint32_t esp32_apptrace_usr_block_len_get(struct target *target, uint8_t *hdr_buf, uint32_t *wr_len)
static int esp32_apptrace_tcp_dest_init(struct esp32_apptrace_dest *dest, const char *dest_name)
static int esp32_apptrace_ready_block_put(struct esp32_apptrace_cmd_ctx *ctx, struct esp32_apptrace_block *block)
void esp32_apptrace_cmd_args_parse(struct esp32_apptrace_cmd_ctx *cmd_ctx, struct esp32_apptrace_cmd_data *cmd_data, const char **argv, int argc)
static int esp32_apptrace_file_dest_cleanup(void *priv)
static int esp32_apptrace_wait_tracing_finished(struct esp32_apptrace_cmd_ctx *ctx)
int esp32_apptrace_dest_cleanup(struct esp32_apptrace_dest dest[], unsigned int max_dests)
#define ESP_APPTRACE_CMD_MODE_SYSVIEW
#define APPTRACE_WR_SIZE_OFFSET
#define ESP_APPTRACE_CMD_MODE_GEN
static int esp32_apptrace_file_dest_init(struct esp32_apptrace_dest *dest, const char *dest_name)
static int esp32_apptrace_file_dest_write(void *priv, uint8_t *data, int size)
static int esp32_apptrace_console_dest_cleanup(void *priv)
#define APPTRACE_BLOCK_SIZE_OFFSET
static void esp32_apptrace_cmd_stop(struct esp32_apptrace_cmd_ctx *ctx)
#define ESP32_APPTRACE_CMD_NUM_ARG_CHECK(_cmd_, _arg_, _start_, _end_)
#define ESP32_APPTRACE_USER_BLOCK_CORE(_v_)
#define ESP32_APPTRACE_TGT_STATE_TMO
static int esp32_apptrace_tcp_dest_write(void *priv, uint8_t *data, int size)
static int esp32_apptrace_handle_trace_block(struct esp32_apptrace_cmd_ctx *ctx, struct esp32_apptrace_block *block)
static const bool s_time_stats_enable
static int esp32_apptrace_data_processor(void *priv)
static int esp32_apptrace_block_free(struct esp32_apptrace_cmd_ctx *ctx, struct esp32_apptrace_block *block)
static int esp32_cmd_apptrace_generic(struct command_invocation *cmd, int mode, const char **argv, int argc)
static int esp32_apptrace_process_data(struct esp32_apptrace_cmd_ctx *ctx, unsigned int core_id, uint8_t *data, uint32_t data_len)
static struct esp32_apptrace_block * esp32_apptrace_free_block_get(struct esp32_apptrace_cmd_ctx *ctx)
#define ESP_APPTRACE_BLOCKS_POOL_SZ
static void esp32_apptrace_print_stats(struct esp32_apptrace_cmd_ctx *ctx)
static int esp32_apptrace_poll(void *priv)
static int esp32_apptrace_get_data_info(struct esp32_apptrace_cmd_ctx *ctx, struct esp32_apptrace_target_state *target_state, uint32_t *fired_target_num)
#define ESP32_APPTRACE_USER_BLOCK_HDR_SZ
static int esp32_sysview_start(struct esp32_apptrace_cmd_ctx *ctx)
static int esp32_apptrace_cmd_init(struct esp32_apptrace_cmd_ctx *cmd_ctx, struct command_invocation *cmd, int mode, const char **argv, int argc)
static int esp32_apptrace_connect_targets(struct esp32_apptrace_cmd_ctx *ctx, bool conn, bool resume_target)
int esp32_apptrace_dest_init(struct esp32_apptrace_dest dest[], const char *dest_paths[], unsigned int max_dests)
int esp32_apptrace_cmd_ctx_init(struct esp32_apptrace_cmd_ctx *cmd_ctx, struct command_invocation *cmd, int mode)
const struct command_registration esp32_apptrace_command_handlers[]
static int esp32_apptrace_tcp_dest_cleanup(void *priv)
int esp32_apptrace_cmd_ctx_cleanup(struct esp32_apptrace_cmd_ctx *cmd_ctx)
static int esp32_apptrace_core_id_get(struct target *target, uint8_t *hdr_buf)
static int esp32_apptrace_console_dest_init(struct esp32_apptrace_dest *dest, const char *dest_name)
static void esp32_apptrace_blocks_pool_cleanup(struct esp32_apptrace_cmd_ctx *ctx)
#define ESP_APPTRACE_CMD_MODE_SYSVIEW_MCORE
#define ESP32_APPTRACE_MAX_CORES_NUM
int esp32_sysview_cmd_init(struct esp32_apptrace_cmd_ctx *cmd_ctx, struct command_invocation *cmd, int mode, bool mcore_format, const char **argv, int argc)
int esp32_sysview_process_data(struct esp32_apptrace_cmd_ctx *ctx, unsigned int core_id, uint8_t *data, uint32_t data_len)
int esp32_sysview_cmd_cleanup(struct esp32_apptrace_cmd_ctx *cmd_ctx)
static struct esp_usb_jtag * priv
static struct esp_xtensa_common * target_to_esp_xtensa(struct target *target)
static struct jaylink_connection conn
static void list_add(struct list_head *new, struct list_head *head)
#define list_first_entry(ptr, type, member)
static int list_empty(const struct list_head *head)
#define list_last_entry(ptr, type, member)
static void list_del(struct list_head *entry)
#define list_entry(ptr, type, field)
#define list_for_each_safe(p, n, head)
static void INIT_LIST_HEAD(struct list_head *list)
void alive_sleep(uint64_t ms)
#define LOG_USER(expr ...)
#define LOG_TARGET_WARNING(target, fmt_str,...)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_TARGET_DEBUG(target, fmt_str,...)
#define LOG_USER_N(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_LEVEL_IS(FOO)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
static int close_socket(int sock)
static int write_socket(int handle, const void *buffer, unsigned int count)
size_t size
Size of the control block search area.
@ SEGGER_SYSVIEW_COMMAND_ID_STOP
@ SEGGER_SYSVIEW_COMMAND_ID_START
bool openocd_is_shutdown_pending(void)
#define foreach_smp_target(pos, head)
When run_command is called, a new instance will be created on the stack, filled with the proper value...
uint32_t max_trace_block_sz
struct target * cpus[ESP32_APPTRACE_MAX_CORES_NUM]
enum target_state target_state
struct duration idle_time
struct duration read_time
struct list_head ready_trace_blocks
struct esp32_apptrace_cmd_stats stats
int(* process_data)(struct esp32_apptrace_cmd_ctx *ctx, unsigned int core_id, uint8_t *data, uint32_t data_len)
struct command_invocation * cmd
const struct esp32_apptrace_hw * hw
void(* auto_clean)(struct esp32_apptrace_cmd_ctx *ctx)
struct list_head free_trace_blocks
struct esp32_apptrace_format trace_format
struct esp32_apptrace_dest data_dest
int(* write)(void *priv, uint8_t *data, int size)
uint32_t(* usr_block_max_size_get)(struct target *target)
int(* leave_trace_crit_section_stop)(struct target *target)
int(* ctrl_reg_read)(struct target *target, uint32_t *block_id, uint32_t *len, bool *conn)
int(* data_read)(struct target *target, uint32_t size, uint8_t *buffer, uint32_t block_id, bool ack)
int(* data_len_read)(struct target *target, uint32_t *block_id, uint32_t *len)
int(* leave_trace_crit_section_start)(struct target *target)
uint32_t(* max_block_size_get)(struct target *target)
int(* ctrl_reg_write)(struct target *target, uint32_t block_id, uint32_t len, bool conn, bool data)
int(* status_reg_read)(struct target *target, uint32_t *stat)
int(* buffs_write)(struct target *target, uint32_t bufs_num, uint32_t buf_sz[], const uint8_t *bufs[], uint32_t block_id, bool ack, bool data)
const struct esp32_apptrace_hw * hw
struct esp_xtensa_apptrace_info apptrace
enum target_debug_reason debug_reason
struct list_head * smp_targets
Represents a generic Xtensa core.
unsigned int common_magic
int target_halt(struct target *target)
int target_unregister_timer_callback(int(*callback)(void *priv), void *priv)
int target_call_timer_callbacks(void)
int target_poll(struct target *target)
int target_register_timer_callback(int(*callback)(void *priv), unsigned int time_ms, enum target_timer_type type, void *priv)
The period is very approximate, the callback can happen much more often or much more rarely than spec...
uint16_t target_buffer_get_u16(struct target *target, const uint8_t *buffer)
int target_wait_state(struct target *target, enum target_state state, unsigned int ms)
struct target * get_current_target(struct command_context *cmd_ctx)
int target_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Make the target (re)start executing using its saved execution context (possibly with some modificatio...
static bool target_was_examined(const struct target *target)
@ TARGET_TIMER_TYPE_PERIODIC
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified target.
float duration_elapsed(const struct duration *duration)
int duration_measure(struct duration *duration)
Update the duration->elapsed field to finish the duration measurement.
int duration_start(struct duration *duration)
Update the duration->start field to start the duration measurement.
float duration_kbps(const struct duration *duration, size_t count)
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
#define XTENSA_COMMON_MAGIC