GstTrace

GstTrace — Tracing functionality

Synopsis


#include <gst/gst.h>


            GstTrace;
            GstTraceEntry;
GstTrace*   gst_trace_new                   (gchar *filename,
                                             gint size);
void        gst_trace_destroy               (GstTrace *trace);
void        gst_trace_flush                 (GstTrace *trace);
void        gst_trace_text_flush            (GstTrace *trace);
#define     gst_trace_get_size              (trace)
#define     gst_trace_get_offset            (trace)
#define     gst_trace_get_remaining         (trace)
void        gst_trace_set_default           (GstTrace *trace);
void        gst_trace_read_tsc              (gint64 *dst);
enum        GstAllocTraceFlags;
            GstAllocTrace;
gboolean    gst_alloc_trace_available       (void);
const GList* gst_alloc_trace_list           (void);
int         gst_alloc_trace_live_all        (void);
void        gst_alloc_trace_print_all       (void);
void        gst_alloc_trace_set_flags_all   (GstAllocTraceFlags flags);
GstAllocTrace* gst_alloc_trace_get          (const gchar *name);
void        gst_alloc_trace_print           (const GstAllocTrace *trace);
void        gst_alloc_trace_print_live      (void);
void        gst_alloc_trace_set_flags       (GstAllocTrace *trace,
                                             GstAllocTraceFlags flags);
#define     gst_alloc_trace_register        (name)
#define     gst_alloc_trace_new             (trace, mem)
#define     gst_alloc_trace_free            (trace, mem)
#define     gst_trace_add_entry             (trace,seq,data,msg)


Description

Tracing functionality

Details

GstTrace

typedef struct {
  /* where this trace is going */
  gchar *filename;
  int fd;

  /* current buffer, size, head offset */
  GstTraceEntry *buf;
  gint bufsize;
  gint bufoffset;
} GstTrace;


GstTraceEntry

typedef struct {
  gint64 timestamp;
  guint32 sequence;
  guint32 data;
  gchar message[112];
} GstTraceEntry;


gst_trace_new ()

GstTrace*   gst_trace_new                   (gchar *filename,
                                             gint size);

filename :
size :
Returns :

gst_trace_destroy ()

void        gst_trace_destroy               (GstTrace *trace);

trace :

gst_trace_flush ()

void        gst_trace_flush                 (GstTrace *trace);

trace :

gst_trace_text_flush ()

void        gst_trace_text_flush            (GstTrace *trace);

trace :

gst_trace_get_size()

#define 	gst_trace_get_size(trace) 	((trace)->bufsize)

trace :

gst_trace_get_offset()

#define 	gst_trace_get_offset(trace) 	((trace)->bufoffset)

trace :

gst_trace_get_remaining()

#define 	gst_trace_get_remaining(trace) 	((trace)->bufsize - (trace)->bufoffset)

trace :

gst_trace_set_default ()

void        gst_trace_set_default           (GstTrace *trace);

trace :

gst_trace_read_tsc ()

void        gst_trace_read_tsc              (gint64 *dst);

dst :

enum GstAllocTraceFlags

typedef enum
{
  GST_ALLOC_TRACE_LIVE		= (1 << 0),
  GST_ALLOC_TRACE_MEM_LIVE	= (1 << 1)
} GstAllocTraceFlags;

Flags indicating which tracing feature to enable.

GST_ALLOC_TRACE_LIVE Trace number of non-freed memory
GST_ALLOC_TRACE_MEM_LIVE trace pointers of unfreed memory

GstAllocTrace

typedef struct {
  gchar		*name;
  gint		 flags;

  gint		 live;
  GSList	*mem_live;
} GstAllocTrace;

The main tracing object

gchar *name; The name of the tracing object
gint flags; Flags for this object
gint live; counter for live memory
GSList *mem_live; list with pointers to unfreed memory

gst_alloc_trace_available ()

gboolean    gst_alloc_trace_available       (void);

Check if alloc tracing was commiled into the core

Returns : TRUE if the core was compiled with alloc tracing enabled.

gst_alloc_trace_list ()

const GList* gst_alloc_trace_list           (void);

Get a list of all registered alloc trace objects.

Returns : a GList of GstAllocTrace objects.

gst_alloc_trace_live_all ()

int         gst_alloc_trace_live_all        (void);

Returns : the total number of live registered alloc trace objects.

gst_alloc_trace_print_all ()

void        gst_alloc_trace_print_all       (void);

Print the status of all registered alloc trace objects.


gst_alloc_trace_set_flags_all ()

void        gst_alloc_trace_set_flags_all   (GstAllocTraceFlags flags);

Enable the specified options on all registered alloc trace objects.

flags : the options to enable

gst_alloc_trace_get ()

GstAllocTrace* gst_alloc_trace_get          (const gchar *name);

Get the named alloc trace object.

name : the name of the alloc trace object
Returns : a GstAllocTrace with the given name or NULL when no alloc tracer was registered with that name.

gst_alloc_trace_print ()

void        gst_alloc_trace_print           (const GstAllocTrace *trace);

Print the status of the given GstAllocTrace.

trace : the GstAllocTrace to print

gst_alloc_trace_print_live ()

void        gst_alloc_trace_print_live      (void);

Print the status of all registered alloc trace objects, ignoring those without live objects.


gst_alloc_trace_set_flags ()

void        gst_alloc_trace_set_flags       (GstAllocTrace *trace,
                                             GstAllocTraceFlags flags);

Enable the given features on the given GstAllocTrace object.

trace : the GstAllocTrace
flags : flags to set

gst_alloc_trace_register()

#define     gst_alloc_trace_register(name)

Register a new alloc tracer with the given name

name : The name of the tracer object

gst_alloc_trace_new()

#define     gst_alloc_trace_new(trace, mem)

Use the tracer to trace a new memory allocation

trace : The tracer to use
mem : The memory allocated

gst_alloc_trace_free()

#define     gst_alloc_trace_free(trace, mem)

Trace a memory free operation

trace : The tracer to use
mem : The memory that is freed

gst_trace_add_entry()

#define     gst_trace_add_entry(trace,seq,data,msg)

trace :
seq :
data :
msg :