Zth (libzth)
Loading...
Searching...
No Matches
perf.cpp File Reference
#include <libzth/perf.h>
#include <libzth/allocator.h>
#include <libzth/fiber.h>
#include <libzth/worker.h>
#include <cstdlib>
#include <cstring>
#include <set>
#include <unistd.h>

Go to the source code of this file.

Classes

class  zth::PerfBuffer
 
class  zth::VCDGenerator
 
class  zth::VCDHeaderGenerator
 
class  zth::VCDDataGenerator
 

Namespaces

namespace  zth
 

Macros

#define ZTH_VCD_USE_FILE_IO
 

Typedefs

typedef char zth::leb128_buf_t[9]
 

Enumerations

enum  zth::PerfEvent {
  zth::PerfEventTerminate , zth::PerfEventTime , zth::PerfEventTimeDelta , zth::PerfEventMarker ,
  zth::PerfEventLog , zth::PerfEventFiber , zth::PerfEventFiberState
}
 

Functions

void zth::perf_start (zth_perf_done_callback_t *f) noexcept
 Starts recording perf events.
 
void zth::perf_stop () noexcept
 Stops recording perf events.
 
void zth::perf_mark (char const *m, Timestamp const &t) noexcept
 Put a string marker into the perf output.
 
void zth::perf_async_handle (zth_perf_async_handle_t *handle) noexcept
 Returns the handle of the current thread's perf buffer.
 
void zth::perf_mark_async (char const *marker, zth_perf_async_handle_t *handle) noexcept
 Async-/thread-safe zth::perf_mark().
 
void zth::perf_log (char const *fmt,...) noexcept
 Put a formatted log string into the perf output.
 
void zth::perf_log (Timestamp const &t, char const *fmt,...) noexcept
 Put a formatted log string into the perf output.
 
void zth::perf_logv (char const *fmt, va_list args, Timestamp const &t) noexcept
 Put a formatted log string into the perf output.
 
void zth::perf_fiber (Fiber &f) noexcept
 Write fiber ID/name to the perf buffer.
 
void zth::perf_fiber_state (Fiber &f, int state, Timestamp const &t) noexcept
 Record the current fiber state.
 
void zth::perf_dump (zth_perf_dump_callback_t *f) noexcept
 Passes collected perf data to f.
 
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_run_dump (char const *path) noexcept
 Like zth::perf_run(), but dump the contents to file immediately.
 
int zth::perf_init ()
 Initializes the per-thread perf event buffer.
 
void zth::perf_deinit ()
 
int zth::perf_vcd (char const *perf, char const *vcd) noexcept
 Convert a perf file into VCD.
 
int zth::perf_vcdf (FILE *perf, FILE *vcd) noexcept
 Convert a perf file into VCD.
 

Macro Definition Documentation

◆ ZTH_VCD_USE_FILE_IO

#define ZTH_VCD_USE_FILE_IO

Definition at line 19 of file perf.cpp.