Skip to content

Commit afc7bcd

Browse files
committed
target/espressif: fix upstream apptrace review comments
1 parent d43e1cd commit afc7bcd

File tree

9 files changed

+137
-145
lines changed

9 files changed

+137
-145
lines changed

doc/openocd.texi

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11147,10 +11147,16 @@ Dump trace memory to a file.
1114711147

1114811148
@section Espressif Specific Commands
1114911149

11150-
@deffn {Command} {esp apptrace} (start file://<outfile> [<poll_period> [<trace_size> [<stop_tmo> [<wait4halt> [<skip_size>]]]]])
11150+
@deffn {Command} {esp apptrace} (start <destination> [<poll_period> [<trace_size> [<stop_tmo> [<wait4halt> [<skip_size>]]]]])
1115111151
Starts
1115211152
@uref{https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#application-level-tracing-library, application level tracing}.
11153-
Data will be stored to specified destination.
11153+
Data will be stored to specified destination. Available destinations are:
11154+
@itemize @bullet
11155+
@item @code{file://<outfile>} - Save trace logs into file.
11156+
@item @code{tcp://<host>:<port>} - Send trace logs to tcp port on specified host. OpenOCD will act as a tcp client.
11157+
@item @code{con:} - Print trace logs to the stdout.
11158+
@end itemize
11159+
Other parameters will be same for each destination.
1115411160
@itemize @bullet
1115511161
@item @code{poll_period} - trace data polling period in ms.
1115611162
@item @code{trace_size} - maximum trace data size.

src/flash/nor/esp_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ static int esp_algo_flash_read_xfer(struct target *target, uint32_t block_id, ui
831831
uint8_t *ptr = state->rd_buf;
832832
while (ptr < state->rd_buf + len) {
833833
uint32_t data_sz = 0;
834-
ptr = state->rw.apptrace->usr_block_get(ptr, &data_sz);
834+
ptr = state->rw.apptrace->usr_block_get(target, ptr, &data_sz);
835835
if (data_sz > 0)
836836
memcpy(state->rw.buffer + state->rw.total_count, ptr, data_sz);
837837
ptr += data_sz;

src/flash/nor/esp_flash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct esp_flash_apptrace_hw {
3939
uint32_t block_id,
4040
const uint8_t *data,
4141
uint32_t size);
42-
uint8_t *(*usr_block_get)(uint8_t * buffer, uint32_t * size);
42+
uint8_t *(*usr_block_get)(struct target *target, uint8_t *buffer, uint32_t *size);
4343
uint32_t (*block_max_size_get)(struct target *target);
4444
uint32_t (*usr_block_max_size_get)(struct target *target);
4545
};

0 commit comments

Comments
 (0)