mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
Remove old alloc tracing code now that we have a GstTracer-based replacement
It's been internal API only in 1.x.
This commit is contained in:
parent
5154dcfbdc
commit
e2cd6ffafc
15 changed files with 5 additions and 488 deletions
|
@ -153,10 +153,8 @@ include $(top_srcdir)/common/coverage/lcov.mak
|
|||
# Do not run the check-exports test in case any option which causes the API to
|
||||
# change has been used
|
||||
if !GST_DISABLE_REGISTRY
|
||||
if !GST_DISABLE_TRACE
|
||||
CHECK_EXPORTS = check-exports
|
||||
endif
|
||||
endif
|
||||
|
||||
check: $(CHECK_EXPORTS) check-enum-gettypes
|
||||
|
||||
|
|
|
@ -101,10 +101,6 @@ if test "x$GST_DISABLE_OPTION_PARSING" = xyes; then
|
|||
AC_DEFINE(GST_DISABLE_OPTION_PARSING, 1,
|
||||
[Define if option parsing is disabled])
|
||||
fi
|
||||
AG_GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[historic tracing subsystem])
|
||||
AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
|
||||
AG_GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
|
||||
AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
|
||||
AG_GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
|
||||
AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
|
||||
dnl define a substitution to use in docs/gst/gstreamer.types
|
||||
|
@ -1109,8 +1105,6 @@ if test "x${GST_DISABLE_GST_DEBUG}" = "xno"; then enable_gst_debug="yes"; fi
|
|||
if test "x${GST_DISABLE_GST_TRACER_HOOKS}" = "xno"; then enable_gst_tracer_hooks="yes"; fi
|
||||
if test "x${GST_DISABLE_PARSE}" = "xno"; then enable_parse="yes"; fi
|
||||
if test "x${GST_DISABLE_OPTION_PARSING}" = "xno"; then enable_option_parsing="yes"; fi
|
||||
if test "x${GST_DISABLE_TRACE}" = "xno"; then enable_trace="yes"; fi
|
||||
if test "x${GST_DISABLE_ALLOC_TRACE}" = "xno"; then enable_alloc_trace="yes"; fi
|
||||
if test "x${GST_DISABLE_PLUGIN}" = "xno"; then enable_plugin="yes"; fi
|
||||
if test "x${GST_DISABLE_REGISTRY}" = "xno"; then enable_registry="yes"; fi
|
||||
|
||||
|
@ -1131,8 +1125,6 @@ Configuration
|
|||
Tracing subsystem hooks : ${enable_gst_tracer_hooks}
|
||||
Command-line parser : ${enable_parse}
|
||||
Option parsing in gst_init : ${enable_option_parsing}
|
||||
Historic tracing subsystem : ${enable_trace}
|
||||
Allocation tracing : ${enable_alloc_trace}
|
||||
Plugin registry : ${enable_registry}
|
||||
Plugin support : ${enable_plugin}
|
||||
Static plugins : ${enable_static_plugins}
|
||||
|
|
|
@ -36,8 +36,6 @@ GST_QUARK
|
|||
GstQuarkId
|
||||
GstPluginLoader
|
||||
GstPluginLoaderFuncs
|
||||
GstAllocTrace
|
||||
GstAllocTraceFlags
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -698,8 +696,6 @@ gst_adapter_prev_timestamp
|
|||
<TITLE>GstConfig</TITLE>
|
||||
GST_DISABLE_GST_DEBUG
|
||||
GST_DISABLE_PARSE
|
||||
GST_DISABLE_TRACE
|
||||
GST_DISABLE_ALLOC_TRACE
|
||||
GST_DISABLE_REGISTRY
|
||||
GST_DISABLE_PLUGIN
|
||||
<SUBSECTION Private>
|
||||
|
|
|
@ -14,12 +14,6 @@ SUBDIRS_PARSE = parse
|
|||
GST_PARSE_LA = parse/libgstparse.la
|
||||
endif
|
||||
|
||||
if GST_DISABLE_TRACE
|
||||
GST_TRACE_SRC =
|
||||
else
|
||||
GST_TRACE_SRC = gsttrace.c
|
||||
endif
|
||||
|
||||
if GST_DISABLE_PLUGIN
|
||||
GST_PLUGIN_SRC =
|
||||
else
|
||||
|
@ -47,7 +41,6 @@ built_header_make = gstenumtypes.h
|
|||
built_source_make = gstenumtypes.c
|
||||
|
||||
EXTRA_libgstreamer_@GST_API_VERSION@_la_SOURCES = \
|
||||
gsttrace.c \
|
||||
gstregistrybinary.c
|
||||
|
||||
|
||||
|
@ -116,7 +109,6 @@ libgstreamer_@GST_API_VERSION@_la_SOURCES = \
|
|||
gsttaskpool.c \
|
||||
gsttoc.c \
|
||||
gsttocsetter.c \
|
||||
$(GST_TRACE_SRC) \
|
||||
gsttracer.c \
|
||||
gsttracerfactory.c \
|
||||
gsttracerrecord.c \
|
||||
|
@ -255,7 +247,6 @@ noinst_HEADERS = \
|
|||
gstquark.h \
|
||||
gstregistrybinary.h \
|
||||
gstregistrychunks.h \
|
||||
gsttrace.h \
|
||||
gsttracerutils.h \
|
||||
gst_private.h
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@
|
|||
#include <locale.h> /* for LC_ALL */
|
||||
|
||||
#include "gst.h"
|
||||
#include "gsttrace.h"
|
||||
|
||||
#define GST_CAT_DEFAULT GST_CAT_GST_INIT
|
||||
|
||||
|
@ -572,10 +571,6 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
|||
llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
|
||||
g_log_set_handler (g_log_domain_gstreamer, llf, debug_log_handler, NULL);
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_priv_gst_alloc_trace_initialize ();
|
||||
#endif
|
||||
|
||||
_priv_gst_mini_object_initialize ();
|
||||
_priv_gst_quarks_initialize ();
|
||||
_priv_gst_allocator_initialize ();
|
||||
|
@ -1032,10 +1027,6 @@ gst_deinit (void)
|
|||
_priv_gst_caps_features_cleanup ();
|
||||
_priv_gst_caps_cleanup ();
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_priv_gst_alloc_trace_deinit ();
|
||||
#endif
|
||||
|
||||
g_type_class_unref (g_type_class_peek (gst_object_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_pad_get_type ()));
|
||||
g_type_class_unref (g_type_class_peek (gst_element_factory_get_type ()));
|
||||
|
|
|
@ -108,12 +108,6 @@
|
|||
#include "gstutils.h"
|
||||
#include "glib-compat-private.h"
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
/* #define GST_WITH_ALLOC_TRACE */
|
||||
#include "gsttrace.h"
|
||||
static GstAllocTrace *_gst_clock_entry_trace;
|
||||
#endif
|
||||
|
||||
/* #define DEBUGGING_ENABLED */
|
||||
|
||||
#define DEFAULT_WINDOW_SIZE 32
|
||||
|
@ -246,9 +240,9 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time,
|
|||
GstClockEntry *entry;
|
||||
|
||||
entry = g_slice_new (GstClockEntry);
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_alloc_trace_new (_gst_clock_entry_trace, entry);
|
||||
#endif
|
||||
|
||||
/* FIXME: add tracer hook for struct allocations such as clock entries */
|
||||
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock,
|
||||
"created entry %p, time %" GST_TIME_FORMAT, entry, GST_TIME_ARGS (time));
|
||||
|
||||
|
@ -358,9 +352,8 @@ _gst_clock_id_free (GstClockID id)
|
|||
if (entry->destroy_data)
|
||||
entry->destroy_data (entry->user_data);
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_alloc_trace_free (_gst_clock_entry_trace, id);
|
||||
#endif
|
||||
/* FIXME: add tracer hook for struct allocations such as clock entries */
|
||||
|
||||
g_slice_free (GstClockEntry, id);
|
||||
}
|
||||
|
||||
|
@ -680,10 +673,6 @@ gst_clock_class_init (GstClockClass * klass)
|
|||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_clock_entry_trace = _gst_alloc_trace_register ("GstClockEntry", -1);
|
||||
#endif
|
||||
|
||||
gobject_class->dispose = gst_clock_dispose;
|
||||
gobject_class->finalize = gst_clock_finalize;
|
||||
gobject_class->set_property = gst_clock_set_property;
|
||||
|
|
|
@ -55,11 +55,8 @@
|
|||
#if 0
|
||||
#define GST_DISABLE_GST_DEBUG 1
|
||||
#define GST_DISABLE_PARSE 1
|
||||
#define GST_DISABLE_TRACE 1
|
||||
#define GST_DISABLE_ALLOC_TRACE 1
|
||||
#define GST_DISABLE_REGISTRY 1
|
||||
#define GST_DISABLE_PLUGIN 1
|
||||
#define GST_HAVE_GLIB_2_8 1
|
||||
#endif
|
||||
|
||||
/***** default padding of structures *****/
|
||||
|
@ -85,22 +82,6 @@
|
|||
*/
|
||||
@GST_DISABLE_PARSE_DEFINE@
|
||||
|
||||
/**
|
||||
* GST_DISABLE_TRACE:
|
||||
*
|
||||
* Configures the inclusion of a resource tracing facility
|
||||
* (seems to be unused)
|
||||
*/
|
||||
@GST_DISABLE_TRACE_DEFINE@
|
||||
|
||||
/**
|
||||
* GST_DISABLE_ALLOC_TRACE:
|
||||
*
|
||||
* Configures the use of a memory tracer based on the resource tracer
|
||||
* if TRACE is disabled, ALLOC_TRACE is disabled as well
|
||||
*/
|
||||
@GST_DISABLE_ALLOC_TRACE_DEFINE@
|
||||
|
||||
/**
|
||||
* GST_DISABLE_REGISTRY:
|
||||
*
|
||||
|
|
|
@ -57,11 +57,6 @@
|
|||
#include "gst/gstinfo.h"
|
||||
#include <gobject/gvaluecollector.h>
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
#include "gsttrace.h"
|
||||
static GstAllocTrace *_gst_mini_object_trace;
|
||||
#endif
|
||||
|
||||
/* Mutex used for weak referencing */
|
||||
G_LOCK_DEFINE_STATIC (qdata_mutex);
|
||||
static GQuark weak_ref_quark;
|
||||
|
@ -93,10 +88,6 @@ void
|
|||
_priv_gst_mini_object_initialize (void)
|
||||
{
|
||||
weak_ref_quark = g_quark_from_static_string ("GstMiniObjectWeakRefQuark");
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_mini_object_trace = _gst_alloc_trace_register ("GstMiniObject", 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -130,9 +121,6 @@ gst_mini_object_init (GstMiniObject * mini_object, guint flags, GType type,
|
|||
mini_object->qdata = NULL;
|
||||
|
||||
GST_TRACER_MINI_OBJECT_CREATED (mini_object);
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_alloc_trace_new (_gst_mini_object_trace, mini_object);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -462,9 +450,6 @@ gst_mini_object_unref (GstMiniObject * mini_object)
|
|||
g_free (mini_object->qdata);
|
||||
}
|
||||
GST_TRACER_MINI_OBJECT_DESTROYED (mini_object);
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_alloc_trace_free (_gst_mini_object_trace, mini_object);
|
||||
#endif
|
||||
if (mini_object->free)
|
||||
mini_object->free (mini_object);
|
||||
}
|
||||
|
|
|
@ -101,11 +101,6 @@
|
|||
#include "gstparamspecs.h"
|
||||
#include "gstutils.h"
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
#include "gsttrace.h"
|
||||
static GstAllocTrace *_gst_object_trace;
|
||||
#endif
|
||||
|
||||
#define DEBUG_REFCOUNT
|
||||
|
||||
/* Object signals and args */
|
||||
|
@ -166,11 +161,6 @@ gst_object_class_init (GstObjectClass * klass)
|
|||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_object_trace =
|
||||
_gst_alloc_trace_register (g_type_name (GST_TYPE_OBJECT), -2);
|
||||
#endif
|
||||
|
||||
gobject_class->set_property = gst_object_set_property;
|
||||
gobject_class->get_property = gst_object_get_property;
|
||||
|
||||
|
@ -229,10 +219,6 @@ gst_object_init (GstObject * object)
|
|||
object->name = NULL;
|
||||
GST_CAT_TRACE_OBJECT (GST_CAT_REFCOUNTING, object, "%p new", object);
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_alloc_trace_new (_gst_object_trace, object);
|
||||
#endif
|
||||
|
||||
object->flags = 0;
|
||||
|
||||
object->control_rate = 100 * GST_MSECOND;
|
||||
|
@ -425,9 +411,6 @@ gst_object_finalize (GObject * object)
|
|||
g_mutex_clear (&gstobject->lock);
|
||||
|
||||
GST_TRACER_OBJECT_DESTROYED (gstobject);
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_alloc_trace_free (_gst_object_trace, object);
|
||||
#endif
|
||||
|
||||
((GObjectClass *) gst_object_parent_class)->finalize (object);
|
||||
}
|
||||
|
|
228
gst/gsttrace.c
228
gst/gsttrace.c
|
@ -1,228 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
||||
* 2000 Wim Taymans <wtay@chello.be>
|
||||
*
|
||||
* gsttrace.c: Tracing functions (deprecated)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined (_MSC_VER) && _MSC_VER >= 1400
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include "gst_private.h"
|
||||
#include "gstinfo.h"
|
||||
|
||||
#include "gsttrace.h"
|
||||
|
||||
GMutex _gst_trace_mutex;
|
||||
|
||||
/* global flags */
|
||||
static GstAllocTraceFlags _gst_trace_flags = GST_ALLOC_TRACE_NONE;
|
||||
|
||||
/* list of registered tracers */
|
||||
static GList *_gst_alloc_tracers = NULL;
|
||||
|
||||
static void
|
||||
_at_exit (void)
|
||||
{
|
||||
if (_gst_trace_flags)
|
||||
_priv_gst_alloc_trace_dump ();
|
||||
}
|
||||
|
||||
void
|
||||
_priv_gst_alloc_trace_initialize (void)
|
||||
{
|
||||
const gchar *trace;
|
||||
|
||||
trace = g_getenv ("GST_TRACE");
|
||||
if (trace != NULL) {
|
||||
const GDebugKey keys[] = {
|
||||
{"live", GST_ALLOC_TRACE_LIVE},
|
||||
{"mem-live", GST_ALLOC_TRACE_MEM_LIVE},
|
||||
};
|
||||
_gst_trace_flags = g_parse_debug_string (trace, keys, G_N_ELEMENTS (keys));
|
||||
atexit (_at_exit);
|
||||
}
|
||||
|
||||
g_mutex_init (&_gst_trace_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
_priv_gst_alloc_trace_deinit (void)
|
||||
{
|
||||
g_mutex_clear (&_gst_trace_mutex);
|
||||
}
|
||||
|
||||
/**
|
||||
* _priv_gst_alloc_trace_register:
|
||||
* @name: the name of the new alloc trace object.
|
||||
* @offset: the offset in the object where a GType an be found. -1 when the
|
||||
* object has no gtype.
|
||||
*
|
||||
* Register an get a handle to a GstAllocTrace object that
|
||||
* can be used to trace memory allocations.
|
||||
*
|
||||
* Returns: A handle to a GstAllocTrace.
|
||||
*/
|
||||
GstAllocTrace *
|
||||
_priv_gst_alloc_trace_register (const gchar * name, goffset offset)
|
||||
{
|
||||
GstAllocTrace *trace;
|
||||
|
||||
g_return_val_if_fail (name, NULL);
|
||||
|
||||
trace = g_slice_new (GstAllocTrace);
|
||||
trace->name = g_strdup (name);
|
||||
trace->live = 0;
|
||||
trace->mem_live = NULL;
|
||||
trace->flags = _gst_trace_flags;
|
||||
trace->offset = offset;
|
||||
|
||||
_gst_alloc_tracers = g_list_prepend (_gst_alloc_tracers, trace);
|
||||
|
||||
return trace;
|
||||
}
|
||||
|
||||
static gint
|
||||
compare_func (GstAllocTrace * a, GstAllocTrace * b)
|
||||
{
|
||||
return strcmp (a->name, b->name);
|
||||
}
|
||||
|
||||
static GList *
|
||||
gst_alloc_trace_list_sorted (void)
|
||||
{
|
||||
GList *ret;
|
||||
|
||||
ret = g_list_sort (g_list_copy (_gst_alloc_tracers),
|
||||
(GCompareFunc) compare_func);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_alloc_trace_print (const GstAllocTrace * trace)
|
||||
{
|
||||
GSList *mem_live;
|
||||
|
||||
g_return_if_fail (trace != NULL);
|
||||
|
||||
if (trace->flags & GST_ALLOC_TRACE_LIVE) {
|
||||
g_print ("%-22.22s : %d\n", trace->name, trace->live);
|
||||
} else {
|
||||
g_print ("%-22.22s : (no live count)\n", trace->name);
|
||||
}
|
||||
|
||||
if (trace->flags & GST_ALLOC_TRACE_MEM_LIVE) {
|
||||
mem_live = trace->mem_live;
|
||||
|
||||
while (mem_live) {
|
||||
gpointer data = mem_live->data;
|
||||
const gchar *type_name;
|
||||
gchar *extra = NULL;
|
||||
gint refcount = -1;
|
||||
|
||||
if (trace->offset == -2) {
|
||||
if (G_IS_OBJECT (data)) {
|
||||
type_name = G_OBJECT_TYPE_NAME (data);
|
||||
refcount = G_OBJECT (data)->ref_count;
|
||||
} else
|
||||
type_name = "<invalid>";
|
||||
} else if (trace->offset == -1) {
|
||||
type_name = "<unknown>";
|
||||
} else {
|
||||
GType type;
|
||||
|
||||
type = G_STRUCT_MEMBER (GType, data, trace->offset);
|
||||
type_name = g_type_name (type);
|
||||
|
||||
if (type == GST_TYPE_CAPS) {
|
||||
extra = gst_caps_to_string (data);
|
||||
} else if (type == GST_TYPE_EVENT) {
|
||||
const GstStructure *s = gst_event_get_structure (data);
|
||||
|
||||
if (s == NULL)
|
||||
extra = g_strdup_printf ("%s", GST_EVENT_TYPE_NAME (data));
|
||||
else
|
||||
extra = gst_structure_to_string (s);
|
||||
} else if (type == GST_TYPE_MESSAGE) {
|
||||
const GstStructure *s = gst_message_get_structure (data);
|
||||
|
||||
if (s == NULL)
|
||||
extra = g_strdup_printf ("%s", GST_MESSAGE_TYPE_NAME (data));
|
||||
else
|
||||
extra = gst_structure_to_string (s);
|
||||
} else if (type == GST_TYPE_BUFFER) {
|
||||
guint size = gst_buffer_get_size (data);
|
||||
|
||||
extra = g_strdup_printf ("%u bytes", size);
|
||||
} else if (type == GST_TYPE_MEMORY) {
|
||||
GstMemory *mem = (GstMemory *) data;
|
||||
|
||||
extra = g_strdup_printf ("%u bytes, %s allocator", (guint) mem->size,
|
||||
mem->allocator ? mem->allocator->mem_type : "unknown");
|
||||
}
|
||||
refcount = GST_MINI_OBJECT_REFCOUNT_VALUE (data);
|
||||
}
|
||||
|
||||
if (extra) {
|
||||
g_print (" %-20.20s : (%d) %p (\"%s\")\n", type_name, refcount, data,
|
||||
extra);
|
||||
g_free (extra);
|
||||
} else
|
||||
g_print (" %-20.20s : (%d) %p\n", type_name, refcount, data);
|
||||
|
||||
mem_live = mem_live->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _priv_gst_alloc_trace_dump:
|
||||
*
|
||||
* Print the status of all registered alloc trace objects.
|
||||
*/
|
||||
void
|
||||
_priv_gst_alloc_trace_dump (void)
|
||||
{
|
||||
GList *orig, *walk;
|
||||
|
||||
orig = walk = gst_alloc_trace_list_sorted ();
|
||||
|
||||
while (walk) {
|
||||
GstAllocTrace *trace = (GstAllocTrace *) walk->data;
|
||||
|
||||
gst_alloc_trace_print (trace);
|
||||
|
||||
walk = g_list_next (walk);
|
||||
}
|
||||
|
||||
g_list_free (orig);
|
||||
}
|
146
gst/gsttrace.h
146
gst/gsttrace.h
|
@ -1,146 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
||||
* 2000 Wim Taymans <wtay@chello.be>
|
||||
*
|
||||
* gsttrace.h: Header for tracing functions (deprecated)
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GST_TRACE_H__
|
||||
#define __GST_TRACE_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <gst/gstconfig.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GstAllocTraceFlags:
|
||||
* @GST_ALLOC_TRACE_NONE: No tracing specified or desired.
|
||||
* @GST_ALLOC_TRACE_LIVE: Trace number of non-freed memory.
|
||||
* @GST_ALLOC_TRACE_MEM_LIVE: Trace pointers of unfreed memory.
|
||||
*
|
||||
* Flags indicating which tracing feature to enable.
|
||||
*/
|
||||
typedef enum {
|
||||
GST_ALLOC_TRACE_NONE = 0,
|
||||
GST_ALLOC_TRACE_LIVE = (1 << 0),
|
||||
GST_ALLOC_TRACE_MEM_LIVE = (1 << 1)
|
||||
} GstAllocTraceFlags;
|
||||
|
||||
typedef struct _GstAllocTrace GstAllocTrace;
|
||||
|
||||
/**
|
||||
* GstAllocTrace:
|
||||
* @name: The name of the tracing object
|
||||
* @flags: Flags for this object
|
||||
* @offset: offset of the GType
|
||||
* @live: counter for live memory
|
||||
* @mem_live: list with pointers to unfreed memory
|
||||
*
|
||||
* The main tracing object
|
||||
*/
|
||||
struct _GstAllocTrace {
|
||||
gchar *name;
|
||||
gint flags;
|
||||
|
||||
goffset offset;
|
||||
gint live;
|
||||
GSList *mem_live;
|
||||
};
|
||||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
|
||||
GST_EXPORT GMutex _gst_trace_mutex;
|
||||
|
||||
void _priv_gst_alloc_trace_initialize (void);
|
||||
void _priv_gst_alloc_trace_deinit (void);
|
||||
GstAllocTrace* _priv_gst_alloc_trace_register (const gchar *name, goffset offset);
|
||||
|
||||
void _priv_gst_alloc_trace_dump (void);
|
||||
|
||||
#ifndef GST_DISABLE_ALLOC_TRACE
|
||||
/**
|
||||
* gst_alloc_trace_register:
|
||||
* @name: The name of the tracer object
|
||||
*
|
||||
* Register a new alloc tracer with the given name
|
||||
*/
|
||||
#define _gst_alloc_trace_register(name,offset) _priv_gst_alloc_trace_register (name,offset)
|
||||
|
||||
#define _gst_alloc_trace_dump _priv_gst_alloc_trace_dump
|
||||
|
||||
/**
|
||||
* gst_alloc_trace_new:
|
||||
* @trace: The tracer to use
|
||||
* @mem: The memory allocated
|
||||
*
|
||||
* Use the tracer to trace a new memory allocation
|
||||
*/
|
||||
#define _gst_alloc_trace_new(trace, mem) \
|
||||
G_STMT_START { \
|
||||
if (G_UNLIKELY ((trace)->flags)) { \
|
||||
g_mutex_lock (&_gst_trace_mutex); \
|
||||
if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \
|
||||
(trace)->live++; \
|
||||
if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \
|
||||
(trace)->mem_live = \
|
||||
g_slist_prepend ((trace)->mem_live, mem); \
|
||||
g_mutex_unlock (&_gst_trace_mutex); \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
/**
|
||||
* gst_alloc_trace_free:
|
||||
* @trace: The tracer to use
|
||||
* @mem: The memory that is freed
|
||||
*
|
||||
* Trace a memory free operation
|
||||
*/
|
||||
#define _gst_alloc_trace_free(trace, mem) \
|
||||
G_STMT_START { \
|
||||
if (G_UNLIKELY ((trace)->flags)) { \
|
||||
g_mutex_lock (&_gst_trace_mutex); \
|
||||
if ((trace)->flags & GST_ALLOC_TRACE_LIVE) \
|
||||
(trace)->live--; \
|
||||
if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) \
|
||||
(trace)->mem_live = \
|
||||
g_slist_remove ((trace)->mem_live, mem); \
|
||||
g_mutex_unlock (&_gst_trace_mutex); \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
#else
|
||||
#define _gst_alloc_trace_register(name) (NULL)
|
||||
#define _gst_alloc_trace_new(trace, mem)
|
||||
#define _gst_alloc_trace_free(trace, mem)
|
||||
#define _gst_alloc_trace_dump()
|
||||
#endif
|
||||
|
||||
#else /* GST_DISABLE_TRACE */
|
||||
|
||||
#define _gst_alloc_trace_register(name, offset) (NULL)
|
||||
#define _gst_alloc_trace_new(trace, mem)
|
||||
#define _gst_alloc_trace_free(trace, mem)
|
||||
#define _gst_alloc_trace_dump()
|
||||
|
||||
#endif /* GST_DISABLE_TRACE */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_TRACE_H__ */
|
|
@ -7,7 +7,6 @@ gst/gsterror.c
|
|||
gst/gstpipeline.c
|
||||
gst/gstregistry.c
|
||||
gst/gsttaglist.c
|
||||
gst/gsttrace.c
|
||||
gst/gsturi.c
|
||||
gst/gstutils.c
|
||||
gst/parse/grammar.y
|
||||
|
|
|
@ -39,10 +39,8 @@ endif
|
|||
# Do not run the abi test in case any option which causes the API to change has
|
||||
# been used
|
||||
if !GST_DISABLE_REGISTRY
|
||||
if !GST_DISABLE_TRACE
|
||||
ABI_CHECKS = gst/gstabi
|
||||
endif
|
||||
endif
|
||||
|
||||
if !GST_DISABLE_GST_DEBUG
|
||||
PRINTF_CHECKS = gst/gstprintf
|
||||
|
|
|
@ -56,8 +56,6 @@
|
|||
#define GST_DISABLE_GST_DEBUG 1
|
||||
#define GST_DISABLE_LOADSAVE 1
|
||||
#define GST_DISABLE_PARSE 1
|
||||
#define GST_DISABLE_TRACE 1
|
||||
#define GST_DISABLE_ALLOC_TRACE 1
|
||||
#define GST_DISABLE_REGISTRY 1
|
||||
#define GST_DISABLE_PLUGIN 1
|
||||
#define GST_HAVE_GLIB_2_8 1
|
||||
|
@ -76,18 +74,9 @@
|
|||
/* wether or not the debugging subsystem is enabled */
|
||||
/* #undef GST_DISABLE_GST_DEBUG */
|
||||
|
||||
/* DOES NOT WORK */
|
||||
/* #undef GST_DISABLE_LOADSAVE */
|
||||
|
||||
/* DOES NOT WORK */
|
||||
/* #undef GST_DISABLE_PARSE */
|
||||
|
||||
/* DOES NOT WORK */
|
||||
/* #undef GST_DISABLE_TRACE */
|
||||
|
||||
/* DOES NOT WORK */
|
||||
/* #undef GST_DISABLE_ALLOC_TRACE */
|
||||
|
||||
/* DOES NOT WORK */
|
||||
/* #undef GST_DISABLE_REGISTRY */
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ EXPORTS
|
|||
_gst_tag_list_type DATA
|
||||
_gst_toc_entry_type DATA
|
||||
_gst_toc_type DATA
|
||||
_gst_trace_mutex DATA
|
||||
_gst_value_array_type DATA
|
||||
_gst_value_list_type DATA
|
||||
gst_allocation_params_copy
|
||||
|
|
Loading…
Reference in a new issue