프로그램 사용/vi2010. 1. 28. 16:43
음.. 말이 애매한데,
Fedora에서는 vi에서 /검색어 로 검색을 하면, 화면상에 모든 검색어들이
하이라이트 처리되었다. 검색어가 블럭으로 선택되어 다르게 표시되어 눈에 띄었는데 우분투는 되지 않았다.

아무튼 페도라와 우분투의 설정을 비교해보니, hlsearch 라는 넘이 있는데
기본값은 off 라고 되어있다. 아마 페도라가 개발자가 많이 쓰다 보니 기본값을 on으로 했나보다.

'hlsearch'      off        no highlighting of search matches

[링크 : http://vimdoc.sourceforge.net/htmldoc/options.html]


:set hlsearch

:set nohlsearch

'프로그램 사용 > vi' 카테고리의 다른 글

vi 상태표시줄 설정 / 편집중인 파일이름 보기  (0) 2010.01.29
vi 환경설정 파일  (0) 2010.01.28
vi 파일 여러개 관리하기  (0) 2010.01.28
vi 에서 명령어 실행하기  (0) 2010.01.28
vi set commands  (0) 2010.01.27
Posted by 구차니
프로그램 사용/vi2010. 1. 28. 14:57
멀티윈도우 라고도 표기하는 녀석으로
텍스트에서 여러개 창으로 분할해서 사용하는 기능이다.

창 닫기
:q
ctrl - w, c(close)

새로운 창 열기 (가로 분할)
:new
ctrl - w, n

새로운 창 열기 (세로 분할)
ctrl - w, v(vertical)

새로운 창 열기 (파일명) - include 의 파일들을 따라간다.
ctrl - w, f(file)

새로운 창 열기 (ctags)
ctrl - w, ] (창을 열고 창에서 이동)
ctrl - ] (전체화면으로 이동)

창간 이동
ctrl - w, hjkl(좌/위/아래/우)
ctrl - w, tb(최상단=top / 최하단=bottom)
ctrl - w, w(순서대로 이동)

창을 전체 화면으로
:only

[링크 : http://pitfall.egloos.com/1310038]

2010.03.09 추가
수평창 크기 변경
ctrl - w, +/- (키패드는 안되는 듯?)
ctrl - w, n, +/- (숫자 입력후 +/-)

[링크 : http://www.ilug.or.kr/?mid=lec_tip&page=3&document_srl=42573]

2011.11.20 추가
수직창 크기 변경
ctrl - w, </>
[링크 : http://stackoverflow.com/.../with-vim-how-would-one-increase-the-vertical-split-window-size ]

2014.09.04 추가
새로운 창 열기 (가로 분할)
:split

새로운 창 열기 (세로 분할)
:vsplit

[링크 : http://nan1004au.tistory.com/41]
Posted by 구차니
프로그램 사용/vi2010. 1. 28. 12:07
vi 내부에서 외부 프로그램을 실행하는 방법으로
:! 명령어
를 입력하는 방법이 있다.

[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Vim/Documents/Tip/ExternalCommand]


$ vi ./src/modules/modules.c

ABOUT-NLS  INSTALL.win32  NEWS        bootstrap    config.status   doc       m4          rvlc      test              vlc.compile.log
AUTHORS    INSTALL.wince  README      compat       configure       extras    make-alias  share     toolbox
COPYING    MAINTAINERS    THANKS      compile      configure.ac    http.pre  modules     src       vlc
ChangeLog  Makefile       aclocal.m4  config.h     configure.help  include   po          stamp-h1  vlc-config
HACKING    Makefile.am    autotools   config.h.in  configure.log   libs      projects    svlc      vlc-config.in
INSTALL    Makefile.in    bin         config.log   cvlc            libtool   qvlc        tags      vlc-config.in.in

Press ENTER or type command to continue

VI 에서 편집중에
:! ls
를 실행한 결과
Posted by 구차니
프로그램 사용/gcc2010. 1. 27. 17:18
#if 문이라던가 각종 전처리기용 문구들은
여러가지 확장을 통해서 컴파일을 하기 때문에 source insight 등의 힘을 빌려도 분석하기 어려운 면이 있다.

일반적으로 컴파일러는 전처리기 - 컴파일 - 어셈블 - 링크 과정을 거치는데(아마도?)
전처리기 까지만 거친 결과를 stdout 으로 출력해준다.

$ man gcc
       -E  Stop after the preprocessing stage; do not run the compiler proper.
            The output is in the form of preprocessed source code, which is sent to the standard output.

           Input files which don't require preprocessing are ignored.

[링크 : http://linux.die.net/man/1/gcc]

$ cat test.c
#if 1
int test;
#else
int tt;
#endif

int main()
{
        return 0;
}

$ gcc -E test.c
# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.c"

int test;




int main()
{
 return 0;
}


#include 하는 모든 파일을 확장하기 때문에, #include <stdio.h>만 해도 내용이 엄청 길어진다.
그리고 줄단위로 처리하기 때문에 사라진 #if 문 대신 엔터만 남아 위와 같이 휑~하게 나왔다.


[링크 : http://cafe.naver.com/devctrl/949]
Posted by 구차니
프로그램 사용/vi2010. 1. 27. 15:42
set 명령어 모음을 보려면(설정된 값들)

:set all 하면 나온다.
우르르르 나오긴 하는데 음.. 머가 먼지는 ㄱ-

:set all
--- 옵션 ---
  aleph=224           foldclose=          mousemodel=extend   swapfile
noarabic              foldcolumn=0        mousetime=500       swapsync=fsync
  arabicshape         foldenable        nonumber              switchbuf=
noallowrevins         foldexpr=0          numberwidth=4       synmaxcol=3000
noaltkeymap           foldignore=#        omnifunc=           syntax=cpp
  ambiwidth=single    foldlevel=0         operatorfunc=       tabline=
noautochdir           foldlevelstart=-1 nopaste               tabpagemax=10
noautoindent          foldmethod=manual   pastetoggle=        tabstop=8
noautoread            foldminlines=1      patchexpr=          tagbsearch
noautowrite           foldnestmax=20      patchmode=          taglength=0
noautowriteall        formatexpr=       nopreserveindent      tagrelative
  background=light    formatoptions=tcq   previewheight=12    tagstack
nobackup              formatprg=        nopreviewwindow       term=xterm
  backupcopy=auto     fsync               printdevice=      notermbidi
  backupext=~       nogdefault            printencoding=      termencoding=
  backupskip=/tmp/*   helpheight=20       printfont=courier noterse
nobinary              helplang=ko         printmbcharset=     textauto
nobomb              nohidden              printmbfont=      notextmode
  bufhidden=          history=50          prompt              textwidth=0
  buflisted         nohkmap               pumheight=0         thesaurus=
  buftype=          nohkmapp              quoteescape=\     notildeop
  cdpath=,,         nohlsearch          noreadonly            timeout
  cedit=^F          noicon                redrawtime=2000     timeoutlen=1000
  charconvert=        iconstring=         remap             notitle
nocindent           noignorecase          report=2            titlelen=85
  cinoptions=         iminsert=0        norevins              titlestring=
  cmdheight=1         imsearch=0        norightleft         nottimeout
  cmdwinheight=7      includeexpr=        ruler               ttimeoutlen=-1
  columns=87        noincsearch           rulerformat=        ttybuiltin
nocompatible          indentexpr=         scroll=28           ttyfast
  completefunc=     noinfercase         noscrollbind          ttymouse=xterm2
noconfirm           noinsertmode          scrolljump=1        ttyscroll=999
nocopyindent          isprint=@,161-255   scrolloff=0         ttytype=xterm
  cpoptions=aABceFs   joinspaces        nosecure              undolevels=1000
  cscopepathcomp=0    key=                selectmode=         updatecount=200
  cscopeprg=cscope    keymap=             shell=/bin/bash     updatetime=4000
  cscopequickfix=     keymodel=           shellcmdflag=-c     verbose=0
nocscopetag           keywordprg=man      shellquote=         verbosefile=
  cscopetagorder=0    langmap=            shelltemp           virtualedit=
nocscopeverbose       langmenu=           shellxquote=      novisualbell
nocursorcolumn        laststatus=1      noshiftround          warn
nocursorline        nolazyredraw          shiftwidth=8      noweirdinvert
  debug=            nolinebreak         noshortname           whichwrap=b,s
nodelcombine          lines=57            showbreak=          wildchar=<Tab>
  dictionary=       nolisp              noshowcmd             wildcharm=0
nodiff              nolist              noshowfulltag         wildignore=
  diffexpr=           listchars=eol:$   noshowmatch         nowildmenu
  diffopt=filler      loadplugins         showmode            wildmode=full
nodigraph             magic               showtabline=1       wildoptions=
  display=            makeef=             sidescroll=0        window=56
  eadirection=both    makeprg=make        sidescrolloff=0     winheight=1
noedcompatible        matchtime=5       nosmartcase         nowinfixheight
  encoding=utf-8      maxcombine=2      nosmartindent       nowinfixwidth
  endofline           maxfuncdepth=100  nosmarttab            winminheight=1
  equalprg=           maxmem=254460     nospell               winwidth=20
noerrorbells          maxmemtot=254460    spellfile=          wrap
  esckeys             menuitems=25        spelllang=en        wrapmargin=0
  eventignore=      nomodeline            spellsuggest=best   wrapscan
noexpandtab           modelines=5       nosplitbelow          write
noexrc                modifiable        nosplitright        nowriteany
  fileformat=unix   nomodified            startofline         writebackup
  filetype=cpp        more                statusline=         writedelay=0
nofkmap               mouse=              suffixesadd=
  backspace=indent,eol,start
  backupdir=.,~/tmp,~/
  breakat= ^I!@*-+;:,./?
  casemap=internal,keepascii
  cinkeys=0{,0},0),:,0#,!^F,o,O,e
  cinwords=if,else,while,do,for,switch
  comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
  commentstring=/*%s*/
  complete=.,w,b,u,t,i
  completeopt=menu,preview
  define=^\s*#\s*define
  directory=.,~/tmp,/var/tmp,/tmp
  errorfile=errors.err
  errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier
 is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%
m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f',%X%*\a[%
*\d]: Leaving directory `%f',%D%*\a: Entering directory `%f',%X%*\a: Leaving directory
`%f',%DMaking %*\a in %f,%f|%l| %m
  fileencoding=utf-8
  fileencodings=ucs-bom,utf-8,default,latin1
  fileformats=unix,dos
  fillchars=vert:|,fold:-
  foldmarker={{{,}}}
  foldopen=block,hor,mark,percent,quickfix,search,tag,undo
  foldtext=foldtext()
  formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
  grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
  grepprg=grep -n $* /dev/null
  guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block
  helpfile=/usr/share/vim/vim72/doc/help.txt
  highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMs
g,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visua
l,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:Di
ffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu
,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColum
n,.:CursorLine
  include=^\s*#\s*include
  indentkeys=0{,0},:,0#,!^F,o,O,e
  isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
  isident=@,48-57,_,192-255
  iskeyword=@,48-57,_,192-255
  lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,defin
e-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,
deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etype
case,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-p
rog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-fro
m-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,de
fine-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,
store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accesso
rs,with-accessors*,defclass,defmethod,print-unreadable-object
  matchpairs=(:),{:},[:]
  maxmempattern=1000
  mkspellmem=460000,2000,500
  nrformats=octal,hex
  paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp
  path=.,/usr/include,,
  printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:f
name_in) . delete(v:fname_in) + v:shell_error
  printheader=%<%f%h%m%=페이지 %N
  printoptions=paper:a4
  rightleftcmd=search
  runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/
usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
  scrollopt=ver,jump
  sections=SHNHH HUnhsh
  selection=inclusive
  sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize
  shellpipe=2>&1| tee
  shellredir=>%s 2>&1
  shortmess=filnxtToO
  spellcapcheck=[.?!]\_[\])'"^I ]\+
  suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.
out,.toc
  tags=./tags,./TAGS,tags,TAGS
  titleold=빔을 날게 해 주셔서 고맙습니다
  viewdir=~/.vim/view
  viewoptions=folds,options,cursor
  viminfo='100,<50,s10,h



[링크 : http://www.eng.hawaii.edu/Tutor/vi.html]
Posted by 구차니
프로그램 사용/VLC2010. 1. 26. 17:56
Youtube의 Asteroid Impact (HD) 를 play 하는데 필요한 모듈을 캡쳐했다.



리눅스쪽이 녹색, 윈도우쪽이 파란색이다.
일단 눈에 띄는 차이점은, audio output과 video ouput 부분이다.

'프로그램 사용 > VLC' 카테고리의 다른 글

VLC cross compile시 오류 (vlc-1.0.4)  (0) 2010.02.03
VLC 1.0.4 cross compile + busybox  (0) 2010.02.02
VLC로 youtube 동영상 감상하기  (0) 2010.01.26
youtube mobile on VLC  (0) 2010.01.18
VLC compile [링크]  (0) 2010.01.15
Posted by 구차니
프로그램 사용/VLC2010. 1. 26. 13:43
youtube는 주소가 아래와 같이 http로 나온다.
http://www.youtube.com/watch?v=Hz86TsGx3fc


혹시나 해서 VLC의 네트워크 스트리밍플레이 기능에 주소를 넣었더니!!


알아서 잘 재생한다 OTL


http://youtube.com/get_video?video_id=Hz86TsGx3fc&t=vjVQa1PpcFPX_-4fVcvo3Rpy39pZ_nwt5-HPSBmsva0%3D
http://youtube.com/get_video?video_id=Hz86TsGx3fc&t=vjVQa1PpcFPs3v8rnDY3-mp1ptSqFzKAem6jcmYB2tY%3D&fmt=35

위의것은 기본 주소로 플레이한 주소이고
아래것은 기본 주소에 &fmt=35 옵션을 주어 플레이한 주소이다.
중간의 파란색은 token 값 같은데 플레이마다 변화되는듯 하다.

유튜브 페이지를 열어서 소스를 보니
    <script type="text/javascript">
        ...
        yt.setConfig({
            'SWF_ARGS':
                   ...
                   {"t": "vjVQa1PpcFPGZu0xo_69WU8f__RZMX6s3tda2xfxQ44%3D"},
                   ...
            });

이런식으로 "t" 변수에 값을 넣어준다.
다른 문서들에 비하면 "&t="를 찾아라고 하는데, 시간이 지나면서 내용이 변경된듯 하다.

아무튼, fmt=35로 하면 아래와 같이 h264로 재생이 된다.


[링크 : http://darksoft.co.kr/410]
[링크 : http://hallang.tistory.com/217]

'프로그램 사용 > VLC' 카테고리의 다른 글

VLC 1.0.4 cross compile + busybox  (0) 2010.02.02
의미는 없는 Linux / Windows VLC 차이  (0) 2010.01.26
youtube mobile on VLC  (0) 2010.01.18
VLC compile [링크]  (0) 2010.01.15
ffmpeg + AMR + x264 + VLC?  (0) 2010.01.14
Posted by 구차니
gprof는 기본적으로 flat view로 출력된다.
index % time    self  children    called     name
                0.00    0.00     100/100         tt [3]
[1]      0.0    0.00    0.00     100         aa [1]
-----------------------------------------------
                0.00    0.00     100/100         tt [3]
[2]      0.0    0.00    0.00     100         bb [2]
-----------------------------------------------
                0.00    0.00     100/100         main [9]
[3]      0.0    0.00    0.00     100         tt [3]
                0.00    0.00     100/100         aa [1]
                0.00    0.00     100/100         bb [2]
-----------------------------------------------
아무튼 아래와 같은 형식의 출력이 보이는데, 참 봐도 무슨 소리인지 모르겠다.

간단하게 생각하자면
[%d] 값은 함수이고, 숫자 나온 것에 대한 구조를 보여준다.
[1] 은 aa() 를 실행한 녀석이 tt() 이라는 의미이고
[2] 는 bb() 를 실행한 녀석이 tt()
[3] 는 tt()를 실행한 녀석이 main() 이라는 이야기이다.

tt()
{
  aa();
  bb();
}

main()
{
   tt();
}

이런 구조를 지니게 된다.

만약, 하나의 함수를 여러개에서 호출한다면
위와 같이 [%d] 위에 하나씩 있는게 아니라 여러개가 나타나게 된다.

아래는 Kprof에서 실행한 결과이다.(main 함수는 어디로 가출한겨 ㄱ-)





'프로그램 사용 > gcov, gprof' 카테고리의 다른 글

gcov와 gcovr  (0) 2023.07.20
gcovr - gocv 를 html로  (0) 2023.07.10
gprof gui  (0) 2023.07.10
gcc -p -pg  (0) 2016.02.25
gcov, gprof  (0) 2010.01.23
Posted by 구차니
프로그램 사용/coLinux2010. 1. 23. 20:49
colinux가 예전에 user mode linux라고 듣기는 했지만,
그게 UML 이라고 생각을 전혀 하지 못하다니 ㄱ-

아무튼 UML을 이용해서 독립적으로 구동되게 한것이 바로 colinux 이고,
가상화의 한종류 중에 하나이기도 하다.

[링크 : http://www.hanb.co.kr/network/view.html?bi_id=1395]  UML vs KML
[링크 : http://www.hanb.co.kr/network/view.html?bi_id=267] 시스템 재해 복구 연습 해보기

[링크 : http://www.colinux.org/]
[링크 : http://user-mode-linux.sourceforge.net/]
Posted by 구차니
gcov - coverage testing tool
[링크 : http://korea.gnu.org/manual/release/gcov/gcov_1.ko.html]
[링크 : http://linux.die.net/man/1/gcov]

gcov 는 사용하지 않는 함수를 찾는데 유용한 유틸리티 이다.
이녀석을 사용하기 위해서는 컴파일시 -fprofile-arcs -ftest-coverage 두개의 옵션을 줘야 하는데
gcc 문서를 보니 아래와 같이 --coverage 하나만 주어도 무방할 것으로 보인다.(2010.01.24 추가 : --coverage만 해도 된다)
위의 옵션을 주고 컴파일을 하면, [파일명.gcno] 라는 파일이 생성되고,
파일을 실행하면 [파일명.gcda] 라는 파일이 생성된다. gcov [소스파일] 을 입력하면 분석을 한다.

-fprofile-arcs
    Add code so that program flow arcs are instrumented. During execution the program records how many times each branch and call is executed and how many times it is taken or returns. When the compiled program exits it saves this data to a file called auxname.gcda for each source file. The data may be used for profile-directed optimizations (-fbranch-probabilities), or for test coverage analysis (-ftest-coverage). Each object file's auxname is generated from the name of the output file, if explicitly specified and it is not the final executable, otherwise it is the basename of the source file. In both cases any suffix is removed (e.g. foo.gcda for input file dir/foo.c, or dir/foo.gcda for output file specified as -o dir/foo.o).

--coverage
    This option is used to compile and link code instrumented for coverage analysis. The option is a synonym for -fprofile-arcs -ftest-coverage (when compiling) and -lgcov (when linking). See the documentation for those options for more details.

-ftest-coverage
    Produce a notes file that the gcov code-coverage utility can use to show program coverage. Each source file's note file is called auxname.gcno. Refer to the -fprofile-arcs option above for a description of auxname and instructions on how to generate test coverage data. Coverage data will match the source files more closely, if you do not optimize.

[링크 : http://linux.die.net/man/1/gcc]



gprof - display call graph profile data
[링크 : http://linux.die.net/man/1/gprof]
[링크 : http://kprof.sourceforge.net/] + [링크 : http://www.graphviz.org/]

프로파일링은 어떤 함수가 몇번이나 불려지고(call), 누가 이 함수를 부르는지(call tree)
그리고 어떤 함수가 실행하는데 오래걸리는지를 분석하는 방법이다.
일반적으로 -pg 옵션을 주고 컴파일 한뒤, 한번 실행하면 프로파일링 파일이 생성된다.(정상종료 되어야 생성됨)

프로그램 실행이후에는 gmon.out 파일이 생성되고, 이 파일을 이용하여 분석한다.

-p
Generate extra code to write profile information suitable for the analysis program prof. You must use this option when compiling the source files you want data about, and you must also use it when linking.

-pg
Generate extra code to write profile information suitable for the analysis program gprof. You must use this option when compiling the source files you want data about, and you must also use it when linking.

[링크 : http://linux.die.net/man/1/gcc]



"리눅스 디버깅과 성능 튜닝 - 오픈소스 도구를 사용한 문제 원인 발견과 해결"
[링크 : http://www.yes24.com/24/goods/1948002?scode=032&srank=1]

'프로그램 사용 > gcov, gprof' 카테고리의 다른 글

gcov와 gcovr  (0) 2023.07.20
gcovr - gocv 를 html로  (0) 2023.07.10
gprof gui  (0) 2023.07.10
gcc -p -pg  (0) 2016.02.25
gprof flat view 이해하기  (0) 2010.01.24
Posted by 구차니