HP-UX

tusc 에 관한 설명 및 자료 부탁드립니다...

 
seok gyu Min
비정기 조언자

tusc 에 관한 설명 및 자료 부탁드립니다...

tusc 에 관한 설명 및 자료 부탁드립니다...(자세한 설명 부탁...)
3 응답 3
김병수
본과생

tusc 에 관한 설명 및 자료 부탁드립니다...

tusc는 traces the system calls a process invokes입니다.





관련 자료는 http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.7

에 가시면 자세히 나와 있습니다.



우선 download를 받으시고 설치하시면 되고요...



보통의 경우 사용법은



# tusc -p 해당_PID



그럼~~~

고광태
중학생

tusc 에 관한 설명 및 자료 부탁드립니다...

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/tusc-7.7/



위 사이트에서 다운로드 받을수있습니다.



직접 설치하시고 명령어를 쳐보시는것이 제일로 좋은 방법같구요..



기본적으로 tusc 는 유닉스 시스템 콜을 추적하는 명령어입니다.



예를 들면



tusc ls



execve("/usr/bin/ls", 0x7f7f0560, 0x7f7f0568) ............ = 0

utssys(0x7f7f2650, 0, 0) ................................. = 0

open("/usr/lib/dld.sl", O_RDONLY, 02534) ................. = 3

read(3, "02\v010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ....... = 128

lseek(3, 128, SEEK_SET) .................................. = 128

read(3, "10\0\004\0\0\0( \001a194\0\0\0\0".., 48) ........ = 48

mmap(NULL, 106900, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 28672) = 0xc001

0000

mmap(NULL, 13000, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_SHLIB, 3, 1392

64) = 0x7b050000

close(3) ................................................. = 0

getuid() ................................................. = 0 (0)

getuid() ................................................. = 0 (0)

getgid() ................................................. = 3 (3)

getgid() ................................................. = 3 (3)

mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1,

0) = 0x7b04e000

sysconf(_SC_CPU_VERSION) ................................. = 532

open("/opt/graphics/OpenGL/lib/libogltls.sl", O_RDONLY, 0) = 3

fstat(3, 0x7f7f2dd0) ..................................... = 0

read(3, "0210010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ....... = 128

lseek(3, 128, SEEK_SET) .................................. = 128

read(3, "10\0\004\0\0\0( \0\013\ \0\010\0".., 48) ........ = 48

read(3, "80\0\001\0\0\0 9 2 4 5 ", 12) .................. = 12

lseek(3, 8192, SEEK_SET) ................................. = 8192

read(3, "058cy 10\0\0\0D \0\002$ \0\0\001".., 112) ....... = 112

mmap(NULL, 8192, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 8192) = 0xc000500

0

mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_SHLIB, 3, 16384

) = 0x7b04d000

close(3) ................................................. = 0

open("/usr/lib/libc.2", O_RDONLY, 0) ..................... = 3

fstat(3, 0x7f7f2ed0) ..................................... = 0

read(3, "0214010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ....... = 128

lseek(3, 128, SEEK_SET) .................................. = 128

read(3, "10\0\004\0\0\0( \013y c4\0\010\0".., 48) ........ = 48

read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) .................. = 12

lseek(3, 430080, SEEK_SET) ............................... = 430080

read(3, "058cy 10\0\0\ad \0\0K L \0\0\002".., 112) ....... = 112

mmap(NULL, 1277952, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 430080) = 0xc0

100000

mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_

SHLIB, -1, 0) = 0x7b042000

mmap(0x7b03a000, 32768, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MA

P_SHLIB, 3, 1708032) = 0x7b03a000

mmap(NULL, 16384, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1,

0) = 0x7b036000

close(3) ................................................. = 0

open("/usr/lib/libdld.2", O_RDONLY, 0) ................... = 3

fstat(3, 0x7f7f2fd0) ..................................... = 0

read(3, "02\v010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ....... = 128

lseek(3, 128, SEEK_SET) .................................. = 128

read(3, "10\0\004\0\0\0( \0\0# 4 \0\010\0".., 48) ........ = 48

read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) .................. = 12

lseek(3, 8192, SEEK_SET) ................................. = 8192

read(3, "058cy 10\0\0\0\f\0\00198\0\0\001".., 112) ....... = 112

mmap(NULL, 12288, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 8192) = 0xc00070

00

mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_SHLIB, 3, 20480

) = 0x7b035000

close(3) ................................................. = 0

open("/usr/lib/libc.2", O_RDONLY, 0) ..................... = 3

fstat(3, 0x7f7f30d0) ..................................... = 0

read(3, "0214010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ....... = 128

lseek(3, 128, SEEK_SET) .................................. = 128

read(3, "10\0\004\0\0\0( \013y c4\0\010\0".., 48) ........ = 48

read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) .................. = 12

lseek(3, 430080, SEEK_SET) ............................... = 430080

read(3, "058cy 10\0\0\ad \0\0K L \0\0\002".., 112) ....... = 112

mmap(NULL, 1277952, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 430080) ERR#12

ENOMEM

close(3) ................................................. = 0

open("/usr/lib/libcurses.1", O_RDONLY, 0) ................ = 3

fstat(3, 0x7f7f2ed0) ..................................... = 0

read(3, "0210010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ....... = 128

lseek(3, 128, SEEK_SET) .................................. = 128

read(3, "10\0\004\0\0\0( \002021c\0\010\0".., 48) ........ = 48

read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) .................. = 12

lseek(3, 81920, SEEK_SET) ................................ = 81920

read(3, "058cy 10\0\0\0e4\0\0\f` \0\0\001".., 112) ....... = 112

mmap(NULL, 135168, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 81920) = 0xc00d

0000

mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_S

HLIB, -1, 0) = 0x7b034000

mmap(0x7b030000, 16384, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MA

P_SHLIB, 3, 217088) = 0x7b030000

close(3) ................................................. = 0

mmap(NULL, 3320, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1,

0) = 0x7b02f000

sigsetreturn(0x7b037f36, 0x6211988, 1392) ................ = 0

sysconf(_SC_CPU_VERSION) ................................. = 532

brk(0x40002258) .......................................... = 0

brk(0x4000424c) .......................................... = 0

brk(0x40005000) .......................................... = 0

brk(0x40007000) .......................................... = 0

open("/usr/lib/nls/loc/locales.2/C", O_RDONLY, 0) ........ ERR#2 ENOENT

open("/usr/lib/nls/msg/C/ls.cat", O_RDONLY, 0177777) ..... = 3

fstat(3, 0x7f7f1660) ..................................... = 0

fcntl(3, F_SETFD, 1) ..................................... = 0

time(NULL) ............................................... = 1110760947

getuid() ................................................. = 0 (0)

ioctl(1, TCGETA, 0x7f7f0838) ............................. = 0

brk(0x40008000) .......................................... = 0

brk(0x4001e000) .......................................... = 0

lstat64(".", 0x7f7f0850) ................................. = 0

stat(".", 0x7f7f0918) .................................... = 0

open(".", O_RDONLY, 04430) ............................... = 4

fcntl(4, F_SETFD, 1) ..................................... = 0

brk(0x40020000) .......................................... = 0

getdents(4, 0x4001d910, 8192) ............................ = 1632

getdents(4, 0x4001d910, 8192) ............................ = 0

close(4) ................................................. = 0

ioctl(1, TCGETA, 0x7f7f0ab8) ............................. = 0

.ICEauthority dfl;kgsa

write(1, ". I C E a u t h o r i t y ".., 37) ....... = 37

.TTauthority dp55

write(1, ". T T a u t h o r i t y ".., 33) ....... = 33

.Xauthority e

write(1, ". X a u t h o r i t y ".., 30) ....... = 30

.dt etc

write(1, ". d t ".., 32) ....... = 32

.dtprofile f

write(1, ". d t p r o f i l e ".., 30) ....... = 30

.elm home

write(1, ". e l m ".., 33) ....... = 33

.glancerc_hp kernel.out

write(1, ". g l a n c e r c _ h p ".., 39) ....... = 39

.lsof_krcship kk

write(1, ". l s o f _ k r c s h i p ".., 31) ....... = 31

.mysql_history lib

write(1, ". m y s q l _ h i s t o r y ".., 32) ....... = 32

.netscape lost+found

write(1, ". n e t s c a p e ".., 39) ....... = 39

.profile make.trace

write(1, ". p r o f i l e ".., 39) ....... = 39

.rhosts mapfile

write(1, ". r h o s t s ".., 36) ....... = 36

.sh_history mbox

write(1, ". s h _ h i s t o r y ".., 33) ....... = 33

.sw mpower

write(1, ". s w ".., 35) ....... = 35

1 net

write(1, "1 ".., 32) ....... = 32

2 netconf.bak

write(1, "2 ".., 40) ....... = 40

H3g nsmail

write(1, "H 3 g ".., 35) ....... = 35

Mail opt

write(1, "M a i l ".., 32) ....... = 32

PTRACK.info sbin

write(1, "P T R A C K . i n f o ".., 33) ....... = 33

aaa share

write(1, "a a a ".., 34) ....... = 34

bin stand

write(1, "b i n ".., 34) ....... = 34

cdrom swlist.txt

write(1, "c d r o m ".., 39) ....... = 39

cfg2html_hpux_B.1.89.sd.gz temp

write(1, "c f g 2 h t m l _ h p u x _ B . ".., 33) ....... = 33

class temp2,tkkim

write(1, "c l a s s ".., 40) ....... = 40

collect.sh tmp

write(1, "c o l l e c t . s h ".., 32) ....... = 32

config.stm tmp_mnt

write(1, "c o n f i g . s t m ".., 36) ....... = 36

core usr

write(1, "c o r e ".., 32) ....... = 32

dead.letter var

write(1, "d e a d . l e t t e r ".., 32) ....... = 32

dev wsHW

write(1, "d e v ".., 33) ....... = 33

exit(0) .................................................. WIFEXITED(0)





위에 보는것과 같이 ls 명령어가 수행된후 어떤 시스템 함수들이 수행되서 결국 우리에게 디렉토리와 파일정보를 보여주는지를 추적해서 보여줍니다. c 언어를 아시면 더욱 이해하시기 쉬울것입니다.



참조하시길..
PS LEE
임시 조언자

tusc 에 관한 설명 및 자료 부탁드립니다...

tusc를 비롯한 HP-UX용 troubleshooting 프로그램이 hprc 사이트에도 지원 OS 버전별로 있습니다.

아래의 웹사이트를 이용하시면 도움이 되실듯 합니다.



http://ftp.hprc.co.kr/tool