tools:logger_trace:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:logger_trace:start [2018/05/25 09:30] – [Concurrent Writing of] graf | tools:logger_trace:start [2018/08/22 11:56] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 37: | Line 37: | ||
===== Enabling and Disabling ===== | ===== Enabling and Disabling ===== | ||
- | A trace block, though it will run by the control system, has to be enabled. If so, it will contineously | + | A trace block, though it will run by the control system, has to be enabled. If so, it will continously |
If you read out such a trace buffer it will simply return a buffer starting with the most recently logged at the end of the buffer. If the trace buffer was not filled completely, the returned buffer is simply as long as the trace buffer was actually filled. \\ | If you read out such a trace buffer it will simply return a buffer starting with the most recently logged at the end of the buffer. If the trace buffer was not filled completely, the returned buffer is simply as long as the trace buffer was actually filled. \\ | ||
A trace block has a given number of entries and is organized as a ring buffer. While running it fills new entries at the head and looses old entries at the tail. | A trace block has a given number of entries and is organized as a ring buffer. While running it fills new entries at the head and looses old entries at the tail. | ||
===== Concurrent Writing of Trace Data ===== | ===== Concurrent Writing of Trace Data ===== | ||
- | A trace block, though it will run by the control system, | + | The example above shows how a trace buffer can be written to a file. This has to be done only after the executor stopped, because the writing usually takes a long time. If you wish to write a trace buffer to a file for further analysis while the application still runs, you can use a '' |
+ | <code cpp> | ||
+ | TraceWriter< | ||
+ | |||
+ | if (slRunning.getNofActivations() % (int)(30 / period) == 0) { // write to log file every 30s | ||
+ | tw.write(); | ||
+ | } | ||
+ | </ | ||
+ | The name of the trace file will be appended with the current date and time. |
tools/logger_trace/start.1527233434.txt.gz · Last modified: 2018/05/25 09:30 by graf