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

· 13년 전 · 1605
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년 전 조회 2,267
13년 전 조회 1,713
13년 전 조회 1,662
13년 전 조회 1,698
13년 전 조회 2,092
13년 전 조회 3,290
13년 전 조회 1,772
13년 전 조회 2,806
13년 전 조회 2,840
13년 전 조회 3,159
13년 전 조회 1,869
13년 전 조회 2,192
13년 전 조회 1,885
13년 전 조회 1,971
13년 전 조회 1,885
13년 전 조회 1,760
13년 전 조회 1,878
13년 전 조회 1,946
13년 전 조회 2,048
13년 전 조회 2,849
13년 전 조회 1,527
13년 전 조회 1,901
13년 전 조회 1,696
13년 전 조회 1,452
13년 전 조회 1,899
13년 전 조회 3,899
13년 전 조회 2,983
13년 전 조회 2,572
13년 전 조회 1,545
13년 전 조회 2,162
13년 전 조회 3,023
13년 전 조회 2,121
13년 전 조회 2,173
13년 전 조회 1,892
13년 전 조회 2,053
13년 전 조회 3,054
13년 전 조회 1,568
13년 전 조회 1,917
13년 전 조회 3,214
13년 전 조회 2,015
13년 전 조회 1,605
13년 전 조회 2,077
13년 전 조회 1,904
13년 전 조회 1,943
13년 전 조회 2,227
13년 전 조회 3,019
13년 전 조회 2,008
13년 전 조회 2,496
13년 전 조회 1,595
13년 전 조회 1,606
13년 전 조회 1,581
13년 전 조회 1,490
13년 전 조회 1,784
13년 전 조회 1,843
13년 전 조회 1,528
13년 전 조회 1,806
13년 전 조회 2,360
13년 전 조회 1,605
13년 전 조회 2,378
13년 전 조회 1,476
13년 전 조회 1,657
13년 전 조회 1,491
13년 전 조회 1,682
13년 전 조회 1,538
13년 전 조회 1,874
13년 전 조회 1,909
13년 전 조회 1,822
13년 전 조회 3,649
13년 전 조회 1,461
13년 전 조회 1,693
13년 전 조회 1,558
13년 전 조회 2,040
13년 전 조회 1,804
13년 전 조회 2,447
13년 전 조회 2,802
13년 전 조회 2,132
13년 전 조회 4,041
13년 전 조회 2,295
13년 전 조회 1,634
13년 전 조회 3,087
13년 전 조회 3,500
13년 전 조회 1,363
13년 전 조회 1,490
13년 전 조회 1,422
13년 전 조회 1,522
13년 전 조회 1,416
13년 전 조회 1,684
13년 전 조회 2,912
13년 전 조회 1,376
13년 전 조회 1,351
13년 전 조회 1,478
13년 전 조회 1,472
13년 전 조회 1,377
13년 전 조회 1,675
13년 전 조회 1,625
13년 전 조회 1,363
13년 전 조회 1,395
13년 전 조회 2,395
13년 전 조회 1,583
13년 전 조회 1,960