summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2011-07-21 01:23:09 +0200
committerStefan Kost <ensonic@users.sf.net>2011-07-21 01:23:09 +0200
commit1a16be145df6bbc39ac9b9cbc99ae4078ee978ce (patch)
tree134ba717c8c719f8f7b099d75182e9554776ef4b
parent8d8c5dceb04f1680c1ebc63441c5acf75170e64f (diff)
tracelib: log timestamps on pad-push and plot more detail
In push we can also log timestamps. Plot points for offset and timestamps.
-rwxr-xr-xsrc/gsttl_plot.sh13
-rw-r--r--src/gsttracelib.c12
2 files changed, 16 insertions, 9 deletions
diff --git a/src/gsttl_plot.sh b/src/gsttl_plot.sh
index 9ab6535..7ef50f9 100755
--- a/src/gsttl_plot.sh
+++ b/src/gsttl_plot.sh
@@ -47,6 +47,8 @@ if [ $plot_height -lt $plot_height2 ]; then
plot_height=$((plot_height2+100));
fi
+plot_width=3200
+
height1=`echo "scale=4;290.0/$plot_height2" | bc`
height2=`echo "scale=4;$height1*2.0" | bc`
height3=`echo "scale=4;$height1*3.0" | bc`
@@ -75,11 +77,11 @@ esac
# http://www.gnuplot.info/docs/node341.html (terminal options)
case $format in
# this doen't like fonts
- png) echo "set term png truecolor font \"Sans,5\" size 3200,$plot_height";;
+ png) echo "set term png truecolor font \"Sans,5\" size $plot_width,$plot_height";;
# pdf makes a new page for each plot :/
pdf) echo "set term pdf color font \"Sans,5\" size $page_with,$page_height";;
ps) echo "set term postscript portrait color solid \"Sans\" 7 size $page_with,$page_height";;
- svg) echo "set term svg size 3200, $plot_height font \"Sans,7\"";;
+ svg) echo "set term svg size $plot_width,$plot_height font \"Sans,7\"";;
esac
cat <<EOF
set output '$base.$format'
@@ -96,7 +98,7 @@ unset xtics
set xrange [0:$last_ts]
set xtics format "%g"
set xtics nomirror autofreq
-set ylabel "Size (bytes)"
+set ylabel "Size (bytes) / Offset (samples)"
set ytics nomirror autofreq
set y2label "Time (sec.msec)"
set y2tics nomirror autofreq
@@ -120,7 +122,10 @@ set key title "$name"
plot \\
'$file' using 2:3 axes x1y1 with dots smooth frequency title 'bytes', \\
- '' using 2:5 axes x1y2 with dots smooth frequency title 'scheduling'
+ '' using 2:3 axes x1y1 with points title 'bytes', \\
+ '' using 2:4 axes x1y1 with points title 'offset', \\
+ '' using 2:5 axes x1y2 with points title 'ts', \\
+ '' using 2:6 axes x1y2 with dots smooth frequency title 'scheduling'
# some failed attempts to get averages into the dot plots
# sum = init(0), \\
diff --git a/src/gsttracelib.c b/src/gsttracelib.c
index 11e6510..46cd715 100644
--- a/src/gsttracelib.c
+++ b/src/gsttracelib.c
@@ -1115,15 +1115,17 @@ gst_pad_push (GstPad *pad, GstBuffer *buffer)
if (GST_CLOCK_TIME_IS_VALID (stats->last_ts)) {
sched_jitter = GST_CLOCK_DIFF (stats->last_ts, elapsed1);
_log_entry(
- "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT " %lf\n",
+ "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT " %lf %lf\n",
stats->name, GST_TIME_ARGS (elapsed1), GSTTL_TIME_AS_SECOND (elapsed1),
GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer),
+ GSTTL_TIME_AS_SECOND (GST_BUFFER_TIMESTAMP (buffer)),
GSTTL_TIME_AS_SECOND (sched_jitter));
} else {
_log_entry(
- "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT "\n",
+ "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT " %lf \n",
stats->name, GST_TIME_ARGS (elapsed1), GSTTL_TIME_AS_SECOND (elapsed1),
- GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer));
+ GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (buffer),
+ GSTTL_TIME_AS_SECOND (GST_BUFFER_TIMESTAMP (buffer)));
}
}
@@ -1173,13 +1175,13 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size, GstBuffer ** buffe
if (GST_CLOCK_TIME_IS_VALID (stats->last_ts)) {
sched_jitter = GST_CLOCK_DIFF (stats->last_ts, elapsed1);
_log_entry(
- "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT" %lf\n",
+ "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT" 0.0 %lf\n",
stats->name, GST_TIME_ARGS (elapsed1), GSTTL_TIME_AS_SECOND (elapsed1),
size, offset,
GSTTL_TIME_AS_SECOND (sched_jitter));
} else {
_log_entry(
- "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT "\n",
+ "pad_%s %" GST_TIME_FORMAT " %lf %u %" G_GUINT64_FORMAT " 0.0\n",
stats->name, GST_TIME_ARGS (elapsed1), GSTTL_TIME_AS_SECOND (elapsed1),
size, offset);
}