Commit graph

84 commits

Author SHA1 Message Date
Stefan Sauer
1bfd04a5fe tracers/stats: log optional fields instead of GST_CLOCK_TIME_NONE
Simplify the traces and avoid trace analyzer to know that ((1<<64) - 1) means
we had no value.
2016-12-16 15:55:21 +01:00
Thibault Saunier
33616d47be info: Add a 'flags' parametter to gst_debug_get_stack_trace
This is an API break but that API has not been released yet.

We are passing a flag rather than a simple boolean as we can imagine
to implement more features in the future for example to retrieve a
stack trace for all the threads, etc..

Retrieving source file and line numbers is pretty
expensive while getting a stack trace, this new argument
allows the user to decide to retrieve a backtrace
without those infos instead which is much faster.

For example running $ GST_LEAKS_TRACER_STACK_TRACE=1 GST_DEBUG=GST_TRACER:7 \
GST_TRACERS=leaks time gst-launch-1.0 videotestsrc num-buffers=1 ! fakesink:

* With simple stack traces:

    0.04s user 0.02s system 99% cpu 0.060 total

* With full stack traces:

    0.66s user 0.23s system 96% cpu 0.926 total

https://bugzilla.gnome.org/show_bug.cgi?id=775423
2016-12-12 15:06:20 -03:00
Thibault Saunier
16bd0e7bac meson: Fix build 2016-12-09 19:31:51 -03:00
Thibault Saunier
bd5d43e8f9 meson: Support building with Gst debug disabled 2016-12-09 17:57:10 -03:00
Stefan Sauer
a25453c2c6 tracers/log: log more detail
Log the objects like we would in GST_TRACE_OBJECT. Add the hook function into
the fucntion field.
2016-12-08 22:03:19 +01:00
Stefan Sauer
8d819a51b8 tracer/log: fix hook prototype
s/GstElement/GstPad/
2016-12-08 22:02:17 +01:00
Stefan Sauer
cfb6c7d4f5 tracer/latency: clear qdata
When reading the qdata, clear it to avoid it being read and unreffed again.
Fixes #774332
2016-12-07 21:53:49 +01:00
Stefan Sauer
788c0d220a tracers/log: log messages in message category 2016-12-04 12:15:54 +01:00
Thibault Saunier
85179a674f tracers: leaks: Use the new gst_debug_get_stack_trace
And remove the local implementation of it.

https://bugzilla.gnome.org/show_bug.cgi?id=772555
2016-11-04 14:22:05 -03:00
Thibault Saunier
a8d4857555 gst: Use libunwind/libdw to generate backtraces if avalaible
Making the gst_debug_print_trace function more generally useful.

API:
  + gst_debug_get_trace

https://bugzilla.gnome.org/show_bug.cgi?id=772555
2016-11-04 14:22:05 -03:00
Thibault Saunier
2c6dd70217 stats: Fix warning 2016-10-14 17:30:01 +02:00
Vincent Penquerc'h
18d5d118ab tracers: fix structure leak
https://bugzilla.gnome.org/show_bug.cgi?id=772851
2016-10-13 13:06:40 +01:00
Stefan Sauer
ede686c39b tracer/rusage: fix format string args
The format string contains a process id, but we did not provice one. This
caused us to log garbage since all args got shifted.
2016-10-08 13:22:23 +02:00
Tim-Philipp Müller
9791669ac3 meson: tracers: signal availability of libunwind and backtrace() to code
Not setting cdata here on purpose because of .. complications.
2016-09-27 18:24:02 +01:00
Thibault Saunier
c4aed66eff meson: Build tracers 2016-09-26 18:27:00 -03:00
Guillaume Desmottes
714ea37282 tracers: leaks: update type filter later for unknown types
This allow us to filter using an object type which is implemented
by a plugin like, say, GstGtkGLSink.

https://bugzilla.gnome.org/show_bug.cgi?id=768989
2016-07-20 14:14:48 +01:00
Guillaume Desmottes
59885c2a92 leaks: check return values of libunwind calls 2016-07-11 12:44:19 +01:00
Guillaume Desmottes
9ba53ff1fc leaks: warn if object is destroyed while the tracer is disposing
This should not happen and generally means some thread is still running.

https://bugzilla.gnome.org/show_bug.cgi?id=768578
2016-07-08 17:35:30 +01:00
Guillaume Desmottes
1ed4140d00 leaks tracer: use G_OS_UNIX to check for signal support
Checking for signal.h is not good enough as it's present in Windows.
Those signals are UNIX specific anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=767857
2016-07-08 12:38:46 +03:00
Guillaume Desmottes
17c37efa83 leaks tracer: add creation stack trace support
This allow us to provide the trace of leaked objects making it easier
to debug.

https://bugzilla.gnome.org/show_bug.cgi?id=767862
2016-07-08 12:07:53 +03:00
Guillaume Desmottes
3bb5c1e73a leaks tracer: add checkpoint support using SIGUSR2
https://bugzilla.gnome.org/show_bug.cgi?id=767857
2016-07-08 11:23:43 +03:00
Guillaume Desmottes
53d2e8c977 leaks tracer: log alive objects when receiving SIGUSR1
We don't want to automatically catch signals so use an env variable to
enable this feature.

https://bugzilla.gnome.org/show_bug.cgi?id=767857
2016-07-08 11:23:38 +03:00
Tim-Philipp Müller
6446a1a45c tracers: leaks: some micro-optimisations
- we know number of filter items is not going to change,
  but compiler doesn't

- only do GST_IS_TRACER check for GObjects, not mini objects

- use non-type check cast macros in performance critical paths
2016-06-03 14:03:25 +01:00
Guillaume Desmottes
0bb7fa9855 tracers: add leaks tracer
https://bugzilla.gnome.org/show_bug.cgi?id=765052
2016-06-03 00:36:46 +01:00
Guillaume Desmottes
e0757e1d80 rusage: properly free the queue memory
The queue is allocated as part of the tracer struct so we should not
use g_queue_free() to free it.

https://bugzilla.gnome.org/show_bug.cgi?id=764985
2016-04-13 12:40:41 +03:00
Stefan Sauer
ec75b68984 tracerrecord: don't leak the spec structures
Change the gst_tracer_record_new() api to take the parameters the make the
spec structure directly. This allows us to own the top-level structure and
also collect the args so that we can take ownership of the sub-structures.

https://bugzilla.gnome.org/show_bug.cgi?id=760821
2016-01-22 10:07:26 +01:00
Stefan Sauer
f69382c5f9 tracer/gststats: fix mismatch between '.class' and tracer args
Clean up from the recent changes. The logging descriptiors did not match what we logged.
2016-01-20 09:14:12 +01:00
Tim-Philipp Müller
8641d7c911 tracers: fix thread-id casts to 64-bit ints on 32-bit systems
https://bugzilla.gnome.org/show_bug.cgi?id=760762
2016-01-18 11:28:28 +00:00
Stefan Sauer
84554af301 tracer/stats: use the right log template
When porting we used the wrong record (copy and paste).
2016-01-16 21:23:10 +01:00
Stefan Sauer
af91d23204 tracer: use the new flags to create the optional field in the format string
This spares us explicitly listing the field in the spec. and thus hide this
implementation detail.
2016-01-16 19:21:00 +01:00
Stefan Sauer
8cd76a918a tracer: add a GstTracerValueFlags and replace strings
This allows us to document the flags and makes the logs a bit smaller.
2016-01-16 18:52:32 +01:00
Tim-Philipp Müller
8b88fc487f gst.h: Don't spew warnings if GST_USE_UNSTABLE_API is not defined
Only hide GstTracer and GstTracerRecord API behind GST_USE_UNSTABLE_API,
but don't spew any warnings, otherwise everyone has to define this
to avoid compiler warnings.

This reverts parts of commit 89ee5d948d.
2016-01-16 16:00:16 +00:00
Stefan Sauer
89ee5d948d tracer: add a GFlag for the tracer scope
Port all tracers. Add the GST_USE_UNSTABLE_API flag to the internal CFLAGS so
that we don't have to specify this for gir, docs, mkenum, ...
2016-01-16 13:31:51 +01:00
Stefan Sauer
10b78d872b tracerrecord: add a log record class
We use this class to register tracer log entry metadata and build a log
template. With the log template we can serialize log data very efficiently.
This also simplifies the logging code, since that is now a simple varargs
function that is not exposing the implementation details.

Add docs for the new class and basic tests.

Remove the previous log handler.

Fixes #760267
2016-01-15 21:54:01 +01:00
Stefan Sauer
30741e0206 tracers: code clean ups
Drop some trailing whilespace. Make field order consistent.
2016-01-10 14:30:05 +01:00
Stefan Sauer
2f41e7bc6a tracer: harmonize the query hooks
In post hooks always pass the return value as the last param. Pass the query
also to post hooks since it is still alive.
2016-01-07 23:03:48 +01:00
Stefan Sauer
fb249dadcb tracers/stats: add missing parameters to callback functions 2016-01-07 22:47:37 +01:00
Stefan Sauer
5e40639be7 tracer: make gst_tracing_register_hook_id static
We don't need to expose this as public API. Change the only plugin that was
using it.
2016-01-06 20:46:58 +01:00
Thiago Santos
9f26e5cc63 tracers: log: add missing hooks
Log all possible hooks
2015-11-12 15:39:32 -03:00
Thiago Santos
cf5e7c03c2 stats: log the element-new hook properly
To be able to get the time the elements were created instead of
just logging them without a time
2015-10-29 07:27:35 -03:00
Sebastian Dröge
2b8413e1cd tracers: Only link against libgstprintf.la if the debugging system is enabled
It does not exist otherwise and linking will fail.
2015-10-07 12:01:16 +01:00
Stefan Sauer
d626c5b996 Revert "tracers: Only build getrusage() tracer if RUSAGE_THREAD is available"
This reverts commit 8ddbf76626.
2015-10-07 12:22:34 +02:00
Stefan Sauer
03045d428b tracers/rusage: ifdef the RUSAGE_THREAD usage
Some versions of andoid don't seem to have it.
2015-10-07 12:21:56 +02:00
Sebastian Dröge
8ddbf76626 tracers: Only build getrusage() tracer if RUSAGE_THREAD is available 2015-10-07 11:13:28 +01:00
Stefan Sauer
03821d18a0 tracers: disable the log tracer if debug logging is disabled 2015-10-06 18:46:24 +02:00
Stefan Sauer
34cf8f3252 makefile.am: Remove obsolete Android build cruft
This is not needed any longer.
2015-10-06 18:45:41 +02:00
Thiago Santos
7c5f7173c8 tracers: stats: add message structure to output
The name of the message is not enough. For example, state-change
is not enough to know the transition.

https://bugzilla.gnome.org/show_bug.cgi?id=754496
2015-10-05 19:06:41 -03:00
Thiago Santos
0913f699e2 tracer: gststats: add thread-id to log line 2015-10-05 20:59:39 +02:00
Thiago Santos
567865c81c tracer: add pad query hooks 2015-10-05 20:59:39 +02:00
Mathieu Duponchelle
a9aab3c6c7 tracer: Use GST_TIME_ARGS when printing with GST_TIME_FORMAT. 2015-10-05 20:59:39 +02:00