|
Zth (libzth)
|
Macros | |
| #define | zth_perf_mark(marker) |
| Put a string marker into the perf output. | |
| #define | zth_perf_logv(fmt, args) |
| Put a formatted log string into the perf output. | |
| #define | zth_perf_log(fmt, ...) |
| Put a formatted log string into the perf output. | |
| #define | zth_perf_mark_async(marker, handle) |
| Async-/thread-safe zth::perf_mark(). | |
Functions | |
| void | zth_perf_start (zth_perf_done_callback_t *f=nullptr) noexcept |
| Starts recording perf events. | |
| void | zth_perf_stop () noexcept |
| Stops recording perf events. | |
| void | zth_perf_run (zth_perf_dump_callback_t *f) noexcept |
| Setup the system to automatically perform perf event recording, dumping, and resuming. | |
| void | zth_perf_abort () noexcept |
| Abort a zth::perf_run(). | |
| void | zth_perf_dump (zth_perf_dump_callback_t *f) noexcept |
Passes collected perf data to f. | |
| void | zth_perf_async_handle (zth_perf_async_handle_t *handle) noexcept |
| Returns the handle of the current thread's perf buffer. | |
| int | zth_perf_vcd (char const *perf=nullptr, char const *vcd=nullptr) noexcept |
| Convert a perf file into VCD. | |
| int | zth_perf_vcdf (FILE *perf, FILE *vcd) noexcept |
| Convert a perf file into VCD. | |
This module allows generating a VCD file which tracks scheduling behavior of the application.
| #define zth_perf_log | ( | fmt, | |
| ... | |||
| ) |
Put a formatted log string into the perf output.
This is a C-wrapper for zth::perf_log().
| #define zth_perf_logv | ( | fmt, | |
| args | |||
| ) |
Put a formatted log string into the perf output.
This is a C-wrapper for zth::perf_logv().
| #define zth_perf_mark | ( | marker | ) |
Put a string marker into the perf output.
This is a C-wrapper for zth::perf_mark().
| #define zth_perf_mark_async | ( | marker, | |
| handle | |||
| ) |
Async-/thread-safe zth::perf_mark().
This function performs zth::perf_mark() on another thread's perf event buffer, of which its handle is retrieved by the owner thread using zth::perf_async_handle().
This is a C-wrapper for zth::perf_mark_async().
|
noexcept |
Abort a zth::perf_run().
This is a C-wrapper for zth::perf_abort().
|
noexcept |
Returns the handle of the current thread's perf buffer.
This is a C-wrapper for zth::perf_async_handle().
|
noexcept |
Passes collected perf data to f.
The data (pointer to a buffer and its length) passed to f can be converted to VCD later on. Write the data to file or stdout, for example, for later processing.
The internal buffer is erased afterwards.
Typical workflow:
On the PC (offline), process the buffer into VCD.
This is a C-wrapper for zth::perf_dump().
|
noexcept |
Setup the system to automatically perform perf event recording, dumping, and resuming.
Typical workflow:
This gives a continuous flow of zth::perf_dump() callbacks, with data later/offline to be converted to VCD.
This is a C-wrapper for zth::perf_run().
|
noexcept |
Starts recording perf events.
Recording can only be started when perf is enabled.
This is a C-wrapper for zth::perf_start().
|
noexcept |
Stops recording perf events.
Recording is automatically stopped when the buffer is full.
This is a C-wrapper for zth::perf_stop().
|
noexcept |
Convert a perf file into VCD.
| perf | the filename to the perf file. |
| vcd | the filename to the VCD file. Can be omitted. It will generate it from the perf file or from the ZTH_PERF_VCD environment variable. |
errno This is a C-wrapper for zth::perf_vcd().
|
noexcept |
Convert a perf file into VCD.
| perf | the in read-mode opened perf file. |
| vcd | the in write-mode opened VCD file. |
errno This is a C-wrapper for zth::perf_vcdf().