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

add more and improve diagnostic #467

Closed
KammutierSpule opened this issue May 27, 2024 · 6 comments
Closed

add more and improve diagnostic #467

KammutierSpule opened this issue May 27, 2024 · 6 comments
Assignees
Labels
quality improve code quality

Comments

@KammutierSpule
Copy link

Protect error count:

#if TRICE_DIAGNOSTICS == 1
        TriceErrorCount++;
#endif

Add overflow counter:

#if TRICE_DIAGNOSTICS == 1
    if( !isEnoughSpace ){
        TriceOverflowCounter++;
    }
#endif

//! Overflow counter
unsigned TriceOverflowCounter = 0;

Add word counter so we know / can verify the number of words inserted (it can be reset per diagnostic update)

//! Accumulate word counter
unsigned TriceWordCounter = 0;

#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 3, 2024

TriceOverflowCounter is ok, see also #462. I cannot understand the value of the proposed TriceWordCounter. Please give an example.

@rokath rokath added the quality improve code quality label Jun 3, 2024
@rokath rokath self-assigned this Jun 3, 2024
@KammutierSpule
Copy link
Author

I cannot understand the value of the proposed TriceWordCounter. Pleas give an example.

TriceWordCounter, reseting it to 0 on very diagnostic update, it would be useful to better understand the amount of data of log produced during that time window. (maybe this could be also get indirectly by other statistics)

@rokath
Copy link
Owner

rokath commented Jun 5, 2024

Maybe you mean the used max depth of a double half buffer or the max depth of the ring buffer with the expression "TriceWordCounter"? That is a very important metric and available when enabling TRICE_DIAGNOSTICS.

@KammutierSpule
Copy link
Author

Maybe you mean the used max depth of a double half buffer or the max depth of the ring buffer with the expression "TriceWordCounter"? That is a very important metric and available when enabling TRICE_DIAGNOSTICS.

I'm thinking / trying to remember .. :)

TriceWordCounter, reseting it to 0 on very diagnostic update, it would be useful to better understand the amount of data of log produced during that time window.

What I mean is, the "max depth" only mean that (as the depth can change between diagnostic reports), TriceWordCounter would mean the total "traffic" that happened during the diagnostic report.
Note that on my code I'm resetting to 0 this diagnostic data.

So "max depth" != TriceWordCounter

Eg:
a small "max depth" and a TriceWordCounter high means that lots of Trice entries were added but also dispatched.

@rokath
Copy link
Owner

rokath commented Jun 7, 2024

Not really convinced, so far. A traffic measurement could be done by the Trice tool and should not be a task of the embedded device. Also it is not clear what to measure: The Trice netto data? The framed data, with or without 0-delimiters? Simply the Trice count? We could extend the trice tool for that. The easiest way would be to add it to the statistics when shutting down the tool.

@rokath
Copy link
Owner

rokath commented Jul 16, 2024

In main branch now is a separate file ./examples/exampleData/triceLogDiagnosticData.c which contains also the overflow counters for TRICE_PROTECT.

@rokath rokath closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality improve code quality
Projects
None yet
Development

No branches or pull requests

2 participants