Next: , Previous: GstTask, Up: Top


38 GstTrace

Tracing functionality

38.1 Overview

Traces allows to track object allocation. They provide a instance counter per <g-type>. The counter is incremented for each object allocated and decremented it when it's freed.

     
         // trace un-freed object instances
         gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
         if (!gst_alloc_trace_available ()) {
           g_warning ("Trace not available (recompile with trace enabled).");
         }
         gst_alloc_trace_print_live ();
         // do something here
         gst_alloc_trace_print_live ();
     

Last reviewed on 2005-11-21 (0.9.5)

38.2 Usage

— Function: gst-trace-new (filename mchars) (size int)   (ret <gst-trace*>)

Create a ringbuffer of size in the file with filename to store trace results in.

filename
a filename
size
the max size of the file
ret
a new <gst-trace>.
— Function: gst-trace-destroy (self <gst-trace*>)

Flush an close the previously allocated trace.

trace
the <gst-trace> to destroy
— Function: gst-trace-flush (self <gst-trace*>)

Flush any pending trace entries in trace to the trace file. trace can be NULL in which case the default <gst-trace> will be flushed.

trace
the <gst-trace> to flush.
— Function: gst-trace-text-flush (self <gst-trace*>)

Flush any pending trace entries in trace to the trace file, formatted as a text line with timestamp and sequence numbers. trace can be NULL in which case the default <gst-trace> will be flushed.

trace
the <gst-trace> to flush.
— Function: gst-trace-set-default (self <gst-trace*>)

Set the default <gst-trace> to trace.

trace
the <gst-trace> to set as the default.
— Function: gst-trace-read-tsc   (dst int64)

Read a platform independent timer value that can be used in benchmarks.

dst
pointer to hold the result.
— Function: gst-alloc-trace-available   (ret bool)

Check if alloc tracing was compiled into the core

ret
TRUE if the core was compiled with alloc tracing enabled.
— Function: gst-alloc-trace-list   (ret glist-of)

Get a list of all registered alloc trace objects.

ret
a GList of GstAllocTrace objects.
— Function: gst-alloc-trace-live-all   (ret int)

Get the total number of live registered alloc trace objects.

ret
the total number of live registered alloc trace objects.
— Function: gst-alloc-trace-print-all

Print the status of all registered alloc trace objects.

— Function: gst-alloc-trace-set-flags-all (flags <gst-alloc-trace-flags>)

Enable the specified options on all registered alloc trace objects.

flags
the options to enable
— Function: gst-alloc-trace-get (name mchars)   (ret <gst-alloc-trace*>)

Get the named alloc trace object.

name
the name of the alloc trace object
ret
a GstAllocTrace with the given name or NULL when no alloc tracer was registered with that name.
— Function: gst-alloc-trace-print (self <gst-alloc-trace*>)

Print the status of the given GstAllocTrace.

trace
the GstAllocTrace to print
— Function: gst-alloc-trace-print-live

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

— Function: gst-alloc-trace-set-flags (self <gst-alloc-trace*>) (flags <gst-alloc-trace-flags>)

Enable the given features on the given GstAllocTrace object.

trace
the GstAllocTrace
flags
flags to set