add more and improve diagnostic
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);
TriceOverflowCounter is ok, see also #462. I cannot understand the value of the proposed TriceWordCounter. Please give an example.
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)
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.
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.
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.
In main branch now is a separate file ./examples/exampleData/triceLogDiagnosticData.c which contains also the overflow counters for TRICE_PROTECT.