From f040102d45a1960b58129c3ce690190c0e2d399d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 30 May 2019 23:23:35 -0400 Subject: [PATCH] docs: Add tracers support --- docs/gst-hotdoc-plugins-scanner.c | 21 +++++++++++++++-- docs/meson.build | 35 ++++++++++++++++++++--------- docs/plugins/blank.md | 0 docs/plugins/gst_plugins_cache.json | 8 +++++++ plugins/tracers/gstlatency.c | 2 +- plugins/tracers/gstleaks.c | 8 +++++-- plugins/tracers/gstlog.c | 2 +- plugins/tracers/gstrusage.c | 4 ++-- plugins/tracers/gststats.c | 2 +- 9 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 docs/plugins/blank.md diff --git a/docs/gst-hotdoc-plugins-scanner.c b/docs/gst-hotdoc-plugins-scanner.c index 69dfd0cc74..d70d09f229 100644 --- a/docs/gst-hotdoc-plugins-scanner.c +++ b/docs/gst-hotdoc-plugins-scanner.c @@ -784,14 +784,31 @@ main (int argc, char *argv[]) for (tmp = features; tmp; tmp = tmp->next) { GstPluginFeature *feature = tmp->data; if (GST_IS_ELEMENT_FACTORY (feature)) { - if (!f) g_string_append_printf (json, ","); - f = FALSE; _add_element_details (json, feature); + f = FALSE; + } + } + g_string_append (json, "}, \"tracers\": {"); + gst_plugin_feature_list_free (features); + + f = TRUE; + features = + gst_registry_get_feature_list_by_plugin (gst_registry_get (), + gst_plugin_get_name (plugin)); + for (tmp = features; tmp; tmp = tmp->next) { + GstPluginFeature *feature = tmp->data; + + if (GST_IS_TRACER_FACTORY (feature)) { + if (!f) + g_string_append_printf (json, ","); + g_string_append_printf (json, "\"%s\": {}", GST_OBJECT_NAME (feature)); + f = FALSE; } } g_string_append (json, "}}"); + gst_plugin_feature_list_free (features); } g_string_append_c (json, '}'); diff --git a/docs/meson.build b/docs/meson.build index 8684a41759..cc7c4146fc 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -132,13 +132,28 @@ foreach lib: libs )] endforeach -plugins_doc = [hotdoc.generate_doc('GStreamer-core-plugins', - project_version: apiversion, - sitemap: 'plugins/sitemap.txt', - index: 'plugins/index.md', - gst_index: 'plugins/index.md', - gst_smart_index: true, - gst_c_sources: ['../plugins/elements/*.c', '../plugins/elements/*.h'], - dependencies: [plugins_doc_dep], - gst_cache_file: plugins_cache, -)] +plugins_doc = [ + hotdoc.generate_doc('coreelements', + project_version: apiversion, + sitemap: 'plugins/sitemap.txt', + index: 'plugins/index.md', + gst_index: 'plugins/index.md', + gst_smart_index: true, + gst_c_sources: ['../plugins/elements/*.c', '../plugins/elements/*.h'], + dependencies: [plugins_doc_dep], + gst_cache_file: plugins_cache, + gst_plugin_name: 'coreelements', + ), + hotdoc.generate_doc('coretracers', + project_version: apiversion, + sitemap: 'plugins/sitemap.txt', + index: 'plugins/blank.md', + gst_index: 'plugins/blank.md', + gst_smart_index: true, + gst_c_sources: ['../plugins/tracers/*.c', '../plugins/tracers/*.h'], + dependencies: [plugins_doc_dep], + gst_cache_file: plugins_cache, + gst_plugin_name: 'coretracers', + ) + +] diff --git a/docs/plugins/blank.md b/docs/plugins/blank.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/plugins/gst_plugins_cache.json b/docs/plugins/gst_plugins_cache.json index 4266cee2e7..78162a7050 100644 --- a/docs/plugins/gst_plugins_cache.json +++ b/docs/plugins/gst_plugins_cache.json @@ -3028,6 +3028,7 @@ "license": "LGPL", "package": "GStreamer git", "source": "gstreamer", + "tracers": {}, "url": "Unknown package origin" }, "coretracers": { @@ -3037,6 +3038,13 @@ "license": "LGPL", "package": "GStreamer git", "source": "gstreamer", + "tracers": { + "latency": {}, + "leaks": {}, + "log": {}, + "rusage": {}, + "stats": {} + }, "url": "Unknown package origin" } } \ No newline at end of file diff --git a/plugins/tracers/gstlatency.c b/plugins/tracers/gstlatency.c index 634fbed135..937891c233 100644 --- a/plugins/tracers/gstlatency.c +++ b/plugins/tracers/gstlatency.c @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ /** - * SECTION:element-latencytracer + * SECTION:tracer-latency * @short_description: log processing latency stats * * A tracing module that determines src-to-sink latencies by injecting custom diff --git a/plugins/tracers/gstleaks.c b/plugins/tracers/gstleaks.c index f95b7c75bb..22a005a2f3 100644 --- a/plugins/tracers/gstleaks.c +++ b/plugins/tracers/gstleaks.c @@ -19,13 +19,17 @@ * Boston, MA 02110-1301, USA. */ /** - * SECTION:element-leakstracer + * SECTION:tracer-leaks * @short_description: detect GstObject and GstMiniObject leaks * * A tracing module tracking the lifetime of objects by logging those still * alive when program is exiting and raising a warning. * The type of objects tracked can be filtered using the parameters of the - * tracer, for example: GST_TRACERS=leaks(filters="GstEvent,GstMessage",stack-traces-flags=full) + * tracer, for example: + * + * ``` + * GST_TRACERS=leaks(filters="GstEvent,GstMessage",stack-traces-flags=full) + * ``` */ #ifdef HAVE_CONFIG_H diff --git a/plugins/tracers/gstlog.c b/plugins/tracers/gstlog.c index 06f3cdbb38..e23133c0e5 100644 --- a/plugins/tracers/gstlog.c +++ b/plugins/tracers/gstlog.c @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ /** - * SECTION:element-logtracer + * SECTION:tracer-log * @short_description: log hook event * * A tracing module that logs all data from all hooks. diff --git a/plugins/tracers/gstrusage.c b/plugins/tracers/gstrusage.c index 9086f1edc6..cb3fc6a7a1 100644 --- a/plugins/tracers/gstrusage.c +++ b/plugins/tracers/gstrusage.c @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ /** - * SECTION:element-rusagetracer + * SECTION:tracer-rusage * @short_description: log resource usage stats * - * A tracing module that take rusage() snapshots and logs them. + * A tracing module that take `rusage()` snapshots and logs them. */ #ifdef HAVE_CONFIG_H diff --git a/plugins/tracers/gststats.c b/plugins/tracers/gststats.c index 7ca1eca3c3..5fd1350267 100644 --- a/plugins/tracers/gststats.c +++ b/plugins/tracers/gststats.c @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ /** - * SECTION:element-statstracer + * SECTION:tracer-stats * @short_description: log event stats * * A tracing module that builds usage statistic for elements and pads.