In the DMA channel configuration register for notification for CONS_EVENT.
For DMA channel configuration- PIB to SIB, the CONS event will be generated when buffer which was committed by PIB to SIB is consumed.
And in the DMA callback, parse for the CONS_EVENT
For eg: For channel UART to USB
In the Callback function increment a variable when you receive CONS event
Similarly, you need to add these changes to your firmware.