mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
tracers: add metadata for the logged values
This commit is contained in:
parent
3baaa4ba6f
commit
4f6f8cb811
3 changed files with 104 additions and 10 deletions
|
@ -102,6 +102,26 @@ gst_latency_tracer_class_init (GstLatencyTracerClass * klass)
|
|||
latency_probe_id = g_quark_from_static_string ("latency_probe.id");
|
||||
latency_probe_pad = g_quark_from_static_string ("latency_probe.pad");
|
||||
latency_probe_ts = g_quark_from_static_string ("latency_probe.ts");
|
||||
|
||||
/* announce trace formats */
|
||||
/* *INDENT-OFF* */
|
||||
gst_tracer_log_trace (gst_structure_new ("latency.class",
|
||||
"src", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
|
||||
NULL),
|
||||
"sink", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
|
||||
NULL),
|
||||
"time", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
|
||||
"description", G_TYPE_STRING,
|
||||
"time it took for the buffer to go from src to sink ns",
|
||||
"flags", G_TYPE_STRING, "aggregated", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
|
||||
"max", G_TYPE_UINT64, G_MAXUINT64,
|
||||
NULL),
|
||||
NULL));
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -195,52 +195,52 @@ gst_rusage_tracer_init (GstRUsageTracer * self)
|
|||
/* *INDENT-OFF* */
|
||||
gst_tracer_log_trace (gst_structure_new ("thread-rusage.class",
|
||||
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "thread", // use genum
|
||||
"related-to", G_TYPE_STRING, "thread", /* TODO: use genum */
|
||||
NULL),
|
||||
"average-cpuload", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT,
|
||||
"description", G_TYPE_STRING, "average cpu usage per thread in ‰",
|
||||
"flags", G_TYPE_STRING, "aggregated", // use gflags
|
||||
"flags", G_TYPE_STRING, "aggregated", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT, 0,
|
||||
"max", G_TYPE_UINT, 1000,
|
||||
NULL),
|
||||
"current-cpuload", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT,
|
||||
"description", G_TYPE_STRING, "current cpu usage per thread in ‰",
|
||||
"flags", G_TYPE_STRING, "windowed", // use gflags
|
||||
"flags", G_TYPE_STRING, "windowed", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT, 0,
|
||||
"max", G_TYPE_UINT, 1000,
|
||||
NULL),
|
||||
"time", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
|
||||
"description", G_TYPE_STRING, "time spent in thread",
|
||||
"flags", G_TYPE_STRING, "aggregated", // use gflags
|
||||
"description", G_TYPE_STRING, "time spent in thread in ns",
|
||||
"flags", G_TYPE_STRING, "aggregated", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
|
||||
"max", G_TYPE_UINT64, G_MAXUINT64,
|
||||
NULL),
|
||||
NULL));
|
||||
gst_tracer_log_trace (gst_structure_new ("proc-rusage.class",
|
||||
"thread-id", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "process", // use genum
|
||||
"related-to", G_TYPE_STRING, "process", /* TODO: use genum */
|
||||
NULL),
|
||||
"average-cpuload", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT,
|
||||
"description", G_TYPE_STRING, "average cpu usage per process in ‰",
|
||||
"flags", G_TYPE_STRING, "aggregated", // use gflags
|
||||
"flags", G_TYPE_STRING, "aggregated", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT, 0,
|
||||
"max", G_TYPE_UINT, 1000,
|
||||
NULL),
|
||||
"current-cpuload", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT,
|
||||
"description", G_TYPE_STRING, "current cpu usage per process in ‰",
|
||||
"flags", G_TYPE_STRING, "windowed", // use gflags
|
||||
"flags", G_TYPE_STRING, "windowed", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT, 0,
|
||||
"max", G_TYPE_UINT, 1000,
|
||||
NULL),
|
||||
"time", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
|
||||
"description", G_TYPE_STRING, "time spent in process",
|
||||
"flags", G_TYPE_STRING, "aggregated", // use gflags
|
||||
"description", G_TYPE_STRING, "time spent in process in ns",
|
||||
"flags", G_TYPE_STRING, "aggregated", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
|
||||
"max", G_TYPE_UINT64, G_MAXUINT64,
|
||||
NULL),
|
||||
|
|
|
@ -251,6 +251,7 @@ do_buffer_stats (GstStatsTracer * self, GstPad * this_pad,
|
|||
"peer-pad-ix", G_TYPE_UINT, that_pad_stats->index,
|
||||
"peer-elem-ix", G_TYPE_UINT, that_elem_stats->index,
|
||||
"buffer-size", G_TYPE_UINT, gst_buffer_get_size (buf),
|
||||
/* TODO(ensonic): do PTS and DTS */
|
||||
"buffer-ts", G_TYPE_UINT64, GST_BUFFER_TIMESTAMP (buf),
|
||||
"buffer-duration", G_TYPE_UINT64, GST_BUFFER_DURATION (buf),
|
||||
"buffer-flags", GST_TYPE_BUFFER_FLAGS, GST_BUFFER_FLAGS (buf),
|
||||
|
@ -360,6 +361,79 @@ gst_stats_tracer_init (GstStatsTracer * self)
|
|||
GST_TRACER_HOOK_MESSAGES | GST_TRACER_HOOK_QUERIES, NULL);
|
||||
self->elements = g_ptr_array_new_with_free_func (free_element_stats);
|
||||
self->pads = g_ptr_array_new_with_free_func (free_pad_stats);
|
||||
|
||||
/* announce trace formats */
|
||||
/* *INDENT-OFF* */
|
||||
gst_tracer_log_trace (gst_structure_new ("buffer.class",
|
||||
"pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
|
||||
NULL),
|
||||
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
|
||||
NULL),
|
||||
"peer-pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
|
||||
NULL),
|
||||
"peer-element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
|
||||
NULL),
|
||||
"buffer-size", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT,
|
||||
"description", G_TYPE_STRING, "size of buffer in bytes",
|
||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT, 0,
|
||||
"max", G_TYPE_UINT, G_MAXUINT,
|
||||
NULL),
|
||||
"buffer-ts", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
|
||||
"description", G_TYPE_STRING, "timestamp of the buffer in ns",
|
||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
|
||||
"max", G_TYPE_UINT64, G_MAXUINT64,
|
||||
NULL),
|
||||
"buffer-duration", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_UINT64,
|
||||
"description", G_TYPE_STRING, "duration of the buffer in ns",
|
||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||
"min", G_TYPE_UINT64, G_GUINT64_CONSTANT (0),
|
||||
"max", G_TYPE_UINT64, G_MAXUINT64,
|
||||
NULL),
|
||||
/* TODO(ensonic): "buffer-flags" */
|
||||
NULL));
|
||||
gst_tracer_log_trace (gst_structure_new ("event.class",
|
||||
"pad-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "pad", /* TODO: use genum */
|
||||
NULL),
|
||||
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
|
||||
NULL),
|
||||
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_STRING,
|
||||
"description", G_TYPE_STRING, "name of the event",
|
||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||
NULL),
|
||||
NULL));
|
||||
gst_tracer_log_trace (gst_structure_new ("message.class",
|
||||
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
|
||||
NULL),
|
||||
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_STRING,
|
||||
"description", G_TYPE_STRING, "name of the message",
|
||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||
NULL),
|
||||
NULL));
|
||||
gst_tracer_log_trace (gst_structure_new ("query.class",
|
||||
"element-ix", GST_TYPE_STRUCTURE, gst_structure_new ("scope",
|
||||
"related-to", G_TYPE_STRING, "element", /* TODO: use genum */
|
||||
NULL),
|
||||
"name", GST_TYPE_STRUCTURE, gst_structure_new ("value",
|
||||
"type", G_TYPE_GTYPE, G_TYPE_STRING,
|
||||
"description", G_TYPE_STRING, "name of the query",
|
||||
"flags", G_TYPE_STRING, "", /* TODO: use gflags */
|
||||
NULL),
|
||||
NULL));
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
/* hooks */
|
||||
|
|
Loading…
Reference in a new issue