Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help understanding triceRingBufferDepthMax diagnostic #468

Open
KammutierSpule opened this issue May 27, 2024 · 1 comment
Open

Help understanding triceRingBufferDepthMax diagnostic #468

KammutierSpule opened this issue May 27, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@KammutierSpule
Copy link

KammutierSpule commented May 27, 2024

The following logs shows Trice messages based on diagnostic.
TriceWordCounter and TriceOverflowCounter are my implementations.
All variables (except TriceOverflowCounter) are zeroed on each diagnostic report.
All variables are acquired (and cleared) previous the diagnostic.
All the following messages are consecutive:

TriceDiagnostic.c   123       25_006 TriceWordCounter = 17, TriceOverflowCounter = 0
TriceDiagnostic.c   127       25_006 triceSingleDepthMax =  32 of 120, SingleTricesRingCountMax = 4, triceRingBufferDepthMax = 124 of  600
TriceDiagnostic.c   123       30_007 TriceWordCounter = 15, TriceOverflowCounter = 0
TriceDiagnostic.c   127       30_007 triceSingleDepthMax =  32 of 120, SingleTricesRingCountMax = 4, triceRingBufferDepthMax = 124 of  600

Would be possible to clarify the triceRingBufferDepthMax ?
I can't understand how these values match with the other values (eg: TriceWordCounter and triceSingleDepthMax vs SingleTricesRingCountMax)
I can't make any calculation that will match.
TriceWordCounter x 4=15 x 4=60=240 bytes != 124 bytes triceRingBufferDepthMax
triceSingleDepthMax x SingleTricesRingCountMax = 32 x 4=128 != 124 bytes triceRingBufferDepthMax

TriceWordCounter is:

#define TRICE_DIAGNOSTICS_SINGLE_BUFFER do { \
    unsigned wordCount = TriceBufferWritePosition - triceSingleBufferStartWritePosition; \
    TriceWordCounter += wordCount; \
    TriceSingleMaxWordCount = (wordCount < TriceSingleMaxWordCount) ? TriceSingleMaxWordCount : wordCount; \
    } while(0);
@rokath
Copy link
Owner

rokath commented Jun 1, 2024

Please check triceRingBuffer.c function TriceEnoughSpace in experimental branch now. It contains additional comments and a bug fix now. Could still not test it.

@rokath rokath self-assigned this Jun 3, 2024
@rokath rokath added the question Further information is requested label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants