JULEA
Data Structures | Macros | Typedefs | Enumerations | Functions
Trace

Data Structures

struct  JTraceStack
 
struct  JTraceTime
 
struct  JTraceThread
 
struct  JTrace
 

Macros

#define J_TRACE(name, ...)   g_autoptr(JTrace) G_PASTE(j_trace, __LINE__) G_GNUC_UNUSED = NULL
 
#define J_TRACE_FUNCTION(...)   g_autoptr(JTrace) G_PASTE(j_trace_function, __LINE__) G_GNUC_UNUSED = NULL
 

Typedefs

typedef enum JTraceFileOperation JTraceFileOperation
 
typedef struct JTrace JTrace
 
typedef enum JTraceFlags JTraceFlags
 
typedef struct JTraceStack JTraceStack
 
typedef struct JTraceTime JTraceTime
 
typedef struct JTraceThread JTraceThread
 

Enumerations

enum  JTraceFileOperation {
  J_TRACE_FILE_CLOSE , J_TRACE_FILE_CREATE , J_TRACE_FILE_DELETE , J_TRACE_FILE_OPEN ,
  J_TRACE_FILE_READ , J_TRACE_FILE_SEEK , J_TRACE_FILE_STATUS , J_TRACE_FILE_SYNC ,
  J_TRACE_FILE_WRITE
}
 
enum  JTraceFlags { J_TRACE_OFF = 0 , J_TRACE_ECHO = 1 << 0 , J_TRACE_OTF = 1 << 1 , J_TRACE_SUMMARY = 1 << 2 }
 

Functions

void j_trace_init (gchar const *name)
 
void j_trace_fini (void)
 
JTracej_trace_enter (gchar const *name, gchar const *format,...) G_GNUC_PRINTF(2
 
JTrace void j_trace_leave (JTrace *trace)
 
void j_trace_file_begin (gchar const *path, JTraceFileOperation op)
 
void j_trace_file_end (gchar const *path, JTraceFileOperation op, guint64 length, guint64 offset)
 
void j_trace_counter (gchar const *name, guint64 counter_value)
 
 G_LOCK_DEFINE_STATIC (j_trace_echo)
 
 G_LOCK_DEFINE_STATIC (j_trace_summary)
 

Detailed Description

The JTrace framework offers abstracted trace capabilities. It can use normal terminal output and OTF.

Macro Definition Documentation

◆ J_TRACE

#define J_TRACE (   name,
  ... 
)    g_autoptr(JTrace) G_PASTE(j_trace, __LINE__) G_GNUC_UNUSED = NULL

◆ J_TRACE_FUNCTION

#define J_TRACE_FUNCTION (   ...)    g_autoptr(JTrace) G_PASTE(j_trace_function, __LINE__) G_GNUC_UNUSED = NULL

Typedef Documentation

◆ JTrace

typedef struct JTrace JTrace

◆ JTraceFileOperation

◆ JTraceFlags

typedef enum JTraceFlags JTraceFlags

◆ JTraceStack

typedef struct JTraceStack JTraceStack

◆ JTraceThread

typedef struct JTraceThread JTraceThread

◆ JTraceTime

typedef struct JTraceTime JTraceTime

Enumeration Type Documentation

◆ JTraceFileOperation

Enumerator
J_TRACE_FILE_CLOSE 
J_TRACE_FILE_CREATE 
J_TRACE_FILE_DELETE 
J_TRACE_FILE_OPEN 
J_TRACE_FILE_READ 
J_TRACE_FILE_SEEK 
J_TRACE_FILE_STATUS 
J_TRACE_FILE_SYNC 
J_TRACE_FILE_WRITE 

◆ JTraceFlags

Flags used to enable specific trace back-ends.

Enumerator
J_TRACE_OFF 
J_TRACE_ECHO 
J_TRACE_OTF 
J_TRACE_SUMMARY 

Function Documentation

◆ G_LOCK_DEFINE_STATIC() [1/2]

G_LOCK_DEFINE_STATIC ( j_trace_echo  )

◆ G_LOCK_DEFINE_STATIC() [2/2]

G_LOCK_DEFINE_STATIC ( j_trace_summary  )

◆ j_trace_counter()

void j_trace_counter ( gchar const *  name,
guint64  counter_value 
)

Traces a counter.

Parameters
nameA counter name.
counter_valueA counter value.

◆ j_trace_enter()

JTrace * j_trace_enter ( gchar const *  name,
gchar const *  format,
  ... 
)

Traces the entering of a function.

Parameters
nameA function name.
formatA format string.
Todo:
also blacklist nested functions

◆ j_trace_file_begin()

void j_trace_file_begin ( gchar const *  path,
JTraceFileOperation  op 
)

Traces the beginning of a file operation.

Parameters
pathA file path.
opA file operation.

◆ j_trace_file_end()

void j_trace_file_end ( gchar const *  path,
JTraceFileOperation  op,
guint64  length,
guint64  offset 
)

Traces the ending of a file operation.

Parameters
pathA file path.
opA file operation.
lengthA length.
offsetAn offset.

◆ j_trace_fini()

void j_trace_fini ( void  )

Shuts down the trace framework.

void j_trace_fini(void)
Definition: jtrace.c:441

◆ j_trace_init()

void j_trace_init ( gchar const *  name)

Initializes the trace framework. Tracing is disabled by default. Set the J_TRACE environment variable to enable it. Valid values are echo and otf. Multiple values can be combined with commas.

j_trace_init("JULEA");
void j_trace_init(gchar const *name)
Definition: jtrace.c:356
Parameters
nameA trace name.

◆ j_trace_leave()

void j_trace_leave ( JTrace trace)

Traces the leaving of a function.

Parameters
traceA JTrace.
Todo: