After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772921 - debug log categories registered later can not be filtered for
debug log categories registered later can not be filtered for
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.11.1
Assigned To: Stefan Sauer (gstreamer, gtkdoc dev)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-14 08:12 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2016-12-30 11:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
re-eval GST_DEBUG env var for late categories (2.27 KB, patch)
2016-12-28 20:55 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
re-eval GST_DEBUG env var for late categories (2.35 KB, patch)
2016-12-30 11:04 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2016-10-14 08:12:25 UTC
In the base libs we lazily create debug log categories:
https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/audio/audio.c#n35

The downside of this is that e.g.
GST_DEBUG="audio:5" won't work, but GST_DEBUG="audio*:5" works (although it will show too much).

Some options I can see is to try to re-eval the filter expr, when a new cat is registered. From gstinfo.c: _priv_gst_debug_init()
  env = g_getenv ("GST_DEBUG");
  if (env) {
    gst_debug_set_threshold_from_string (env, FALSE);
  }

Or we use library constructors. This would need some work to make it cross platform though.
Comment 1 Tim-Philipp Müller 2016-12-23 17:44:46 UTC
Re-eval filter expression when new cat is registered seems fine to me?

Constructors sound painful.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2016-12-28 20:55:08 UTC
Created attachment 342554 [details] [review]
re-eval GST_DEBUG env var for late categories

This become a little more complicated.

Repro:
GST_DEBUG="audio:5" gst-launch audiotestsrc num-buffers=2 ! audioresample ! autoaudiosink

after the patch you see the debug log messages. Since we use this pattern in 20 places, it is probably a good idea to fix it.

../gst-plugins-bad/gst-libs/gst/codecparsers/gstjpegparser.c
../gst-plugins-bad/gst-libs/gst/codecparsers/gstvc1parser.c
../gst-plugins-bad/gst-libs/gst/codecparsers/gstmpeg4parser.c
../gst-plugins-base/gst-libs/gst/video/video-info.c
../gst-plugins-base/gst-libs/gst/video/video-color.c
../gst-plugins-base/gst-libs/gst/video/video-resampler.c
../gst-plugins-base/gst-libs/gst/video/video-converter.c
../gst-plugins-base/gst-libs/gst/video/gstvideometa.c
../gst-plugins-base/gst-libs/gst/video/video-overlay-composition.c
../gst-plugins-base/gst-libs/gst/video/video-blend.c
../gst-plugins-base/gst-libs/gst/video/video-chroma.c
../gst-plugins-base/gst-libs/gst/video/video-scaler.c
../gst-plugins-base/gst-libs/gst/audio/audio-channels.c
../gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c
../gst-plugins-base/gst-libs/gst/audio/audio-converter.c
../gst-plugins-base/gst-libs/gst/audio/audio.c
../gst-plugins-base/gst-libs/gst/audio/audio-info.c
../gst-plugins-base/gst-libs/gst/tag/licenses.c
../gst-plugins-base/gst-libs/gst/tag/lang.c
../gst-plugins-base/gst-libs/gst/tag/id3v2.c
Comment 3 Tim-Philipp Müller 2016-12-30 10:01:52 UTC
> This become a little more complicated.

Can you describe the problem so we don't have to apply the patch to reproduce it? :)

I take it it's related to the lazy-registered debug categories?
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2016-12-30 11:04:34 UTC
Created attachment 342619 [details] [review]
re-eval GST_DEBUG env var for late categories