환경변수 path 를 확인하여 스크립트 속도향상하기

· 13년 전 · 1261
strace -o output -fp <실행할려고하는 스크립트 pid>
 
grep "No such file" output > output1
 
 
예시)
 
아래 예시는 ls -al 실행하고 10초 쉬고 다시 ls -al 실행하는 쉡스크립트입니다.
 
 
[root@oracle ~]# cat test.sh 
#!/bin/sh
 
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
ls -al 
sleep 10
 
[root@oracle ~]# ps -ef | grep test.sh | grep -v grep
root      3567 16338  0 15:09 pts/4    00:00:00 /bin/sh ./test.sh
 
[root@oracle ~]# strace -o output -fp 3567
 
ctrl + c 를 눌러 중지.
 
grep "No such file" output > output1
 
[root@oracle ~]# cat output1
3618  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3618  open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3619  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
3620  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.UTF-8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.utf8/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en/LC_TIME/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3620  open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
3621  access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
 
 
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 1,927
13년 전 조회 1,372
13년 전 조회 1,318
13년 전 조회 1,373
13년 전 조회 1,764
13년 전 조회 2,935
13년 전 조회 1,463
13년 전 조회 2,477
13년 전 조회 2,539
13년 전 조회 2,890
13년 전 조회 1,563
13년 전 조회 1,865
13년 전 조회 1,570
13년 전 조회 1,650
13년 전 조회 1,563
13년 전 조회 1,429
13년 전 조회 1,564
13년 전 조회 1,600
13년 전 조회 1,715
13년 전 조회 2,522
13년 전 조회 1,203
13년 전 조회 1,567
13년 전 조회 1,329
13년 전 조회 1,105
13년 전 조회 1,592
13년 전 조회 3,562
13년 전 조회 2,666
13년 전 조회 2,240
13년 전 조회 1,191
13년 전 조회 1,834
13년 전 조회 2,645
13년 전 조회 1,772
13년 전 조회 1,839
13년 전 조회 1,575
13년 전 조회 1,737
13년 전 조회 2,726
13년 전 조회 1,214
13년 전 조회 1,550
13년 전 조회 2,916
13년 전 조회 1,706
13년 전 조회 1,261
13년 전 조회 1,735
13년 전 조회 1,565
13년 전 조회 1,631
13년 전 조회 1,870
13년 전 조회 2,693
13년 전 조회 1,666
13년 전 조회 2,200
13년 전 조회 1,235
13년 전 조회 1,262
13년 전 조회 1,206
13년 전 조회 1,152
13년 전 조회 1,470
13년 전 조회 1,483
13년 전 조회 1,189
13년 전 조회 1,431
13년 전 조회 2,015
13년 전 조회 1,249
13년 전 조회 2,055
13년 전 조회 1,134
13년 전 조회 1,348
13년 전 조회 1,138
13년 전 조회 1,364
13년 전 조회 1,205
13년 전 조회 1,539
13년 전 조회 1,605
13년 전 조회 1,461
13년 전 조회 3,313
13년 전 조회 1,103
13년 전 조회 1,345
13년 전 조회 1,230
13년 전 조회 1,748
13년 전 조회 1,461
13년 전 조회 2,157
13년 전 조회 2,491
13년 전 조회 1,827
13년 전 조회 3,760
13년 전 조회 1,974
13년 전 조회 1,334
13년 전 조회 2,789
13년 전 조회 3,217
13년 전 조회 1,042
13년 전 조회 1,180
13년 전 조회 1,094
13년 전 조회 1,167
13년 전 조회 1,102
13년 전 조회 1,317
13년 전 조회 2,561
13년 전 조회 1,038
13년 전 조회 1,038
13년 전 조회 1,184
13년 전 조회 1,126
13년 전 조회 1,027
13년 전 조회 1,355
13년 전 조회 1,304
13년 전 조회 1,054
13년 전 조회 1,042
13년 전 조회 2,088
13년 전 조회 1,296
13년 전 조회 1,653