Skip to content

Instantly share code, notes, and snippets.

@ssvb
Created July 24, 2012 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssvb/3168368 to your computer and use it in GitHub Desktop.
Save ssvb/3168368 to your computer and use it in GitHub Desktop.
Some oprofile log snippets for https://plus.google.com/u/0/100242854243155306943/posts/KWcGxqFemfV
Run on ARM Cortex-A8 1GHz, videotestsrc used instead of v4l2src (no camera here)
----------------------------------------------------------------------------
# opcontrol --deinit
# opcontrol --separate=kernel --no-vmlinux
# opcontrol --init
# opcontrol --reset
# gst-launch-0.10 -v videotestsrc ! video/x-raw-yuv, width=320, height=240 ! jpegenc ! rtpjpegpay ! queue ! udpsink host=192.168.1.2 port=1234 &
# opcontrol --start && sleep 100 && opcontrol --stop
# opreport /usr/bin/gst-launch-0.10
253559 100.000 gst-launch-0.10
TIMER:0|
samples| %|
------------------
94266 37.1771 libjpeg.so.8.0.2
74980 29.5710 libgstvideotestsrc.so
41663 16.4313 libgstjpeg.so
13920 5.4898 no-vmlinux
9147 3.6074 libc-2.15.so
6109 2.4093 libgstreamer-0.10.so.0.29.0
3894 1.5357 libgstbase-0.10.so.0.29.0
1806 0.7123 libpthread-2.15.so
1765 0.6961 libglib-2.0.so.0.3000.3
1625 0.6409 libgobject-2.0.so.0.3000.3
1335 0.5265 libgstrtp-0.10.so.0.24.0
1226 0.4835 libgstcoreelements.so
597 0.2354 libgstrtp.so
515 0.2031 [vectors] (tgid:1302 range:0xffff0000-0xffff1000)
317 0.1250 libgstudp.so
232 0.0915 libgthread-2.0.so.0.3000.3
82 0.0323 librt-2.15.so
80 0.0316 gst-launch-0.10
# opreport -l /usr/bin/gst-launch-0.10
samples % image name symbol name
49472 19.6084 libjpeg.so.8.0.2 encode_mcu_huff
44000 17.4396 libgstvideotestsrc.so convert_hline_YUY2
41565 16.4744 libgstjpeg.so gst_jpegenc_chain
14200 5.6282 libgstvideotestsrc.so videotestsrc_blend_line
14013 5.5541 libjpeg.so.8.0.2 jsimd_fdct_ifast_neon
13920 5.5172 no-vmlinux /no-vmlinux
13368 5.2985 libjpeg.so.8.0.2 jsimd_quantize_neon
10634 4.2148 libgstvideotestsrc.so gst_orc_splat_u32
5729 2.2707 libc-2.15.so memset
4312 1.7091 libjpeg.so.8.0.2 compress_data
3794 1.5038 libgstvideotestsrc.so gst_video_test_src_smpte
3545 1.4051 libjpeg.so.8.0.2 jsimd_convsamp_neon
3141 1.2449 libjpeg.so.8.0.2 forward_DCT
1734 0.6873 libc-2.15.so memcpy
1625 0.6441 libjpeg.so.8.0.2 jpeg_make_c_derived_tbl
1446 0.5731 libgstvideotestsrc.so videotestsrc_convert_tmpline
1264 0.5010 libgstbase-0.10.so.0.29.0 gst_base_sink_render_object.clone.4
782 0.3099 libc-2.15.so _int_malloc
732 0.2901 libjpeg.so.8.0.2 jsimd_convsamp
716 0.2838 libjpeg.so.8.0.2 jsimd_quantize
688 0.2727 libjpeg.so.8.0.2 jsimd_fdct_ifast
601 0.2382 libgstvideotestsrc.so paint_tmpline_AYUV
571 0.2263 libgstreamer-0.10.so.0.29.0 gst_pad_push
564 0.2235 libpthread-2.15.so pthread_mutex_lock
522 0.2069 libgstbase-0.10.so.0.29.0 gst_base_sink_wait_clock
# opannotate -s /usr/lib/gstreamer-0.10/libgstjpeg.so
: } else {
31 0.0745 : for (i = 0; i < height; i += jpegenc->v_max_samp * DCTSIZE) {
18 0.0432 : for (k = 0; k < jpegenc->channels; k++) {
90 0.2162 : for (j = 0; j < jpegenc->v_samp[k] * DCTSIZE; j++) {
: guchar *src, *dst;
: gint l;
:
: /* ouch, copy line */
86 0.2066 : src = base[k];
43 0.1033 : dst = jpegenc->line[k][j];
85 0.2042 : for (l = jpegenc->cwidth[k]; l > 0; l--) {
26398 63.4186 : *dst = *src;
14255 34.2462 : src += jpegenc->inc[k];
: dst++;
: }
433 1.0402 : if (base[k] + jpegenc->stride[k] < end[k])
40 0.0961 : base[k] += jpegenc->stride[k];
: }
: }
1 0.0024 : jpeg_write_raw_data (&jpegenc->cinfo, jpegenc->line,
21 0.0505 : jpegenc->v_max_samp * DCTSIZE);
: }
: }
Almost all the CPU time in libgstjpeg.so is spent here:
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/ext/jpeg/gstjpegenc.c?id=RELEASE-0.11.92#n493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment