티스토리 뷰

OS/HP-UX

tusc command - 시스템 콜 추적

solarwind 2008. 7. 4. 16:37
반응형

* tusc
  tusc is the tool to trace system calls on HP-UX.
  Because the system calls are defined within the kernel sources, they are identical for the
  whole operating system.
  That's why you don't need source code or debug information in a
  program to trace its system calls.
 
 - 솔라리스의 truss와 같은 기능을 하는 툴이라고 생각하면 됨.

* tusc 프로그램 있는 위치
  ftp://ftp.cup.hp.com/dist/networking/tools/

* 실행방법
tusc.7.6.shar파일을 시스템으로 전송하여 다음과 같이 실행하면 tusc를 사용할 수 있음
(shar 파일은 소스코드들을 한 파일에 모아준 파일로 특별한 프로그램을 요구하지 않고
'sh sharfile'과 같은 명령을 하면 파일들이 풀립니다.)

# sh tusc.7.6.shar
위와 같이 하면 파일이 풀리면서 tusc 실행파일이 생성됨.
PATH에 tusc를 푼 디렉토리를 걸어주고 다음과 같이 실행하면 tusc를 사용가능.

* 사용법 : tusc [ options ] PID or 프로그램이름
(root)/opt/test (488) # tusc
Usage: tusc [-<options>] <command [args ...]> -OR- <pid [pid ...]>
        -a: show exec arguments
        -A: append to output file
        -b bsize: dump 'bsize' max bytes (-r/-w)
        -c: count syscalls instead of printing trace
        -C: like -c but also print high/low/average stats
        -d [+][!][fd | all]: select only syscalls using fd
        -e: show environment variables
        -E: show syscall entries
        -f: follow forks
        -F: show kernel's ttrace feature level
        -g: don't attach to members of my session
        -h: show state of all processes when idle
        -i: don't display interruptible syscalls
        -I start[/stop]: single-step and show instructions
        -k: keep alive (wait for *all* processes)
        -l: print lwpids
        -L [!]lwps: [un]select these lwps
        -n: print process names
        -o [file|fd]: send trace output to file or fd
        -p: print pids
        -Q: be quiet about some warnings
        -r [!][fd | all]: dump read buffers
        -R: show syscall restarts
        -s [!]syscalls: [un]select these syscalls
        -S [!]signals: [un]select these signals
        -t: detach process if it becomes traced
        -T timestamp: print time stamps
        -u: print user thread IDs (pthreads)
        -v: verbose (some system calls only)
        -V: print version
        -w [!][fd | all]: dump write buffers
        -x: print raw (hex) arguments
        -X: print data in an exportable format
        -y: register verbosity (with -I)
        -z: only show failing syscalls

* 파일로 저장하기 위해서는 다음과 같이 하면 됩니다.
  # tusc PID | tee result.txt

반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함