Merge branch 'bugfix/apptrace_down_buf_handling' into 'master'
esp32: Fixes apptrace down buffer management See merge request idf/esp-idf!1953
This commit is contained in:
commit
68dc422cb5
|
@ -156,6 +156,7 @@
|
||||||
// ALSO SEE example usage of application tracing module in 'components/app_trace/README.rst'
|
// ALSO SEE example usage of application tracing module in 'components/app_trace/README.rst'
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/param.h>
|
||||||
#include "soc/soc.h"
|
#include "soc/soc.h"
|
||||||
#include "soc/dport_reg.h"
|
#include "soc/dport_reg.h"
|
||||||
#include "eri.h"
|
#include "eri.h"
|
||||||
|
@ -583,11 +584,11 @@ static uint8_t *esp_apptrace_trax_down_buffer_get(uint32_t *size, esp_apptrace_t
|
||||||
while (1) {
|
while (1) {
|
||||||
uint32_t sz = esp_apptrace_rb_read_size_get(&s_trace_buf.rb_down);
|
uint32_t sz = esp_apptrace_rb_read_size_get(&s_trace_buf.rb_down);
|
||||||
if (sz != 0) {
|
if (sz != 0) {
|
||||||
ptr = esp_apptrace_rb_consume(&s_trace_buf.rb_down, sz > *size ? *size : sz);
|
*size = MIN(*size, sz);
|
||||||
|
ptr = esp_apptrace_rb_consume(&s_trace_buf.rb_down, *size);
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
assert(false && "Failed to consume bytes from down buffer!");
|
assert(false && "Failed to consume bytes from down buffer!");
|
||||||
}
|
}
|
||||||
*size = sz;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// may need to flush
|
// may need to flush
|
||||||
|
|
Loading…
Reference in a new issue