diff options
| author | hathach <[email protected]> | 2026-08-11 17:07:23 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-09-04 04:21:57 +0700 |
| commit | 3baa7c8fbafd2cbccc5810626ebbfaa50c0ea4da (patch) | |
| tree | 690704b3d82dff418ceeaf14e8d6f8ff41d16a2f /src/class/cdc/cdc_device.c | |
| parent | 4161a1cf63c5ca935766d27bd32f7dd3948e881a (diff) | |
sysview: instrument usbd/usbh, dcd/hcd and class-driver call sites
Level 2 marks the stack's task-side entry points (tud_task/tuh_task inner
loop, usbd_edpt_xfer, control transfers); level 3 adds the class drivers
(cdc, msc) and the rp2040 dcd/hcd as the reference portable layer. All
call sites compile away below their level.
Diffstat (limited to 'src/class/cdc/cdc_device.c')
| -rw-r--r-- | src/class/cdc/cdc_device.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c index ed050ad03..0684710dd 100644 --- a/src/class/cdc/cdc_device.c +++ b/src/class/cdc/cdc_device.c @@ -11,6 +11,7 @@ #include "device/usbd.h" #include "device/usbd_pvt.h" +#include "common/tusb_sysview.h" #include "cdc_device.h" @@ -174,8 +175,11 @@ uint32_t tud_cdc_n_available(uint8_t itf) { uint32_t tud_cdc_n_read(uint8_t itf, void* buffer, uint32_t bufsize) { TU_VERIFY(itf < CFG_TUD_CDC, 0); + TUD_SYSVIEW_CALL(CFG_TUSB_SYSVIEW_LEVEL_CLASS, TU_SV_ID_CDC_READ); cdcd_interface_t *p_cdc = &_cdcd_itf[itf]; - return tu_edpt_stream_read(&p_cdc->rx_stream, buffer, bufsize); + uint32_t const ret = tu_edpt_stream_read(&p_cdc->rx_stream, buffer, bufsize); + TUD_SYSVIEW_RET(CFG_TUSB_SYSVIEW_LEVEL_CLASS, TU_SV_ID_CDC_READ); + return ret; } bool tud_cdc_n_peek(uint8_t itf, uint8_t *chr) { @@ -201,8 +205,11 @@ uint32_t tud_cdc_n_write(uint8_t itf, const void* buffer, uint32_t bufsize) { uint32_t tud_cdc_n_write_flush(uint8_t itf) { TU_VERIFY(itf < CFG_TUD_CDC, 0); + TUD_SYSVIEW_CALL(CFG_TUSB_SYSVIEW_LEVEL_CLASS, TU_SV_ID_CDC_FLUSH); cdcd_interface_t *p_cdc = &_cdcd_itf[itf]; - return tu_edpt_stream_write_xfer(&p_cdc->tx_stream); + uint32_t const ret = tu_edpt_stream_write_xfer(&p_cdc->tx_stream); + TUD_SYSVIEW_RET(CFG_TUSB_SYSVIEW_LEVEL_CLASS, TU_SV_ID_CDC_FLUSH); + return ret; } uint32_t tud_cdc_n_write_available(uint8_t itf) { |
