반응형

Plugin 개발 할 때에 Memory Leak에 대해서 확인해보기 위해서 valgrind를 붙여보았는데, valgrind를 붙이면 launcher가 정상 동작 하지 않는다. 원인을 찾을 수 없어서 GStreamer에서 Memory leak에 대한 수단을 제공하지 않을까 해서 찾아보니 아래와 같이 Debugging을 할 수 있는 방법이 있다.

GST_DEBUG="GST_TRACER:7" GST_TRACERS="leaks" 

위와 같이 환경변수를 설정하고 동작시에 아래와 같이 종료 이후로 남아있는 메모리에 대해서 추적해준다.

0:00:33.676884568  6771 0x556451e88840 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f835dc012c0, description=(string)buffer: 0x7f835dc012c0, pts 0:00:45.833522174, dts 99:99:99.999999999, dur 0:00:00.100000000, size 2764800, offset 458, offset_end 459, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:33.676887333  6771 0x556451e88840 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f834738a700, description=(string)buffer: 0x7f834738a700, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 2764800, offset none, offset_end none, flags 0x0, ref-count=(uint)1, trace=(string);
0:00:33.676890357  6771 0x556451e88840 TRACE             GST_TRACER :0:: object-alive, type-name=(string)GstBuffer, address=(gpointer)0x7f86d44efe20, description=(string)buffer: 0x7f86d44efe20, pts 0:00:53.533522174, dts 99:99:99.999999999, dur 0:00:00.100000000, size 2764800, offset 535, offset_end 536, flags 0x0, ref-count=(uint)1, trace=(string);

Typename과 Address, ref-count 등을 남겨준다.
다만 이 메모리가 어떤것인지 자세히 나오지 않아서 이 방법에 대해서도 검토가 필요할 것 같다.

반응형
반응형

GSTShark 설치가 필요함

1. 관련 Package 설치

sudo apt install graphviz libgraphviz-dev
sudo apt install octave epstool babeltrace

2. GSTShark 설치

$ git clone https://github.com/RidgeRun/gst-shark/
$ cd gst-shark/
$ ./autogen.sh --prefix /usr/ --libdir /usr/lib/x86_64-linux-gnu/
$ make
$ sudo make install

3. 테스트

GST_DEBUG="GST_TRACER:7" GST_TRACERS="proctime" \
	gst-launch-1.0 videotestsrc num-buffers=10000 ! \
	'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, framerate=(fraction)30/1' \
	! videorate max-rate=30 ! videoconvert ! queue ! avenc_h263p ! queue ! avimux ! fakesink

4. 로그 확인

0:00:01.994246894 1151846 0x562427ae88a0 TRACE             GST_TRACER :0:: proctime, element=(string)videoconvert0, time=(string)0:00:00.000032109;
0:00:01.994395874 1151846 0x562427ae88f0 TRACE             GST_TRACER :0:: proctime, element=(string)avenc_h263p0, time=(string)0:00:00.000372912;
0:00:01.994401155 1151846 0x562427ae88f0 TRACE             GST_TRACER :0:: proctime, element=(string)queue0, time=(string)0:00:00.000154431;
0:00:01.994401865 1151846 0x562427ae8850 TRACE             GST_TRACER :0:: proctime, element=(string)queue1, time=(string)0:00:00.000006357;
0:00:01.994594740 1151846 0x562427ae88a0 TRACE             GST_TRACER :0:: proctime, element=(string)capsfilter0, time=(string)0:00:00.000000482;
0:00:01.994598173 1151846 0x562427ae88a0 TRACE             GST_TRACER :0:: proctime, element=(string)videorate0, time=(string)0:00:00.000003703;
0:00:01.994630612 1151846 0x562427ae88a0 TRACE             GST_TRACER :0:: proctime, element=(string)videoconvert0, time=(string)0:00:00.000032159;
0:00:01.994774671 1151846 0x562427ae88f0 TRACE             GST_TRACER :0:: proctime, element=(string)avenc_h263p0, time=(string)0:00:00.000372839;
0:00:01.994779616 1151846 0x562427ae88f0 TRACE             GST_TRACER :0:: proctime, element=(string)queue0, time=(string)0:00:00.000149048;
0:00:01.994780333 1151846 0x562427ae8850 TRACE             GST_TRACER :0:: proctime, element=(string)queue1, time=(string)0:00:00.000006217;

5. Graphviz 이용

$ ./gstshark-plot gstshark_2022-05-30_19\:16\:42/ -s pdf
반응형
반응형

1. vundle download

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

 

2. vim resource 파일 수정

filetype off                   " required!
set shell=/bin/bash
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
" required! 
Plugin 'VundleVim/Vundle.vim'

" vim 하단에 파일 정보 띄우기
Plugin 'vim-airline/vim-airline' 
Plugin 'vim-airline/vim-airline-themes'
" ...

call vundle#end()

filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..

 

3. Plugin 설치

$ vim
: PluginInstall

 

반응형

+ Recent posts