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

· 13년 전 · 1600
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,259
13년 전 조회 1,709
13년 전 조회 1,658
13년 전 조회 1,696
13년 전 조회 2,088
13년 전 조회 3,287
13년 전 조회 1,763
13년 전 조회 2,805
13년 전 조회 2,839
13년 전 조회 3,155
13년 전 조회 1,865
13년 전 조회 2,188
13년 전 조회 1,882
13년 전 조회 1,967
13년 전 조회 1,880
13년 전 조회 1,756
13년 전 조회 1,872
13년 전 조회 1,943
13년 전 조회 2,040
13년 전 조회 2,848
13년 전 조회 1,524
13년 전 조회 1,899
13년 전 조회 1,685
13년 전 조회 1,446
13년 전 조회 1,896
13년 전 조회 3,895
13년 전 조회 2,979
13년 전 조회 2,570
13년 전 조회 1,540
13년 전 조회 2,159
13년 전 조회 3,018
13년 전 조회 2,118
13년 전 조회 2,170
13년 전 조회 1,889
13년 전 조회 2,045
13년 전 조회 3,051
13년 전 조회 1,565
13년 전 조회 1,912
13년 전 조회 3,211
13년 전 조회 2,012
13년 전 조회 1,600
13년 전 조회 2,070
13년 전 조회 1,903
13년 전 조회 1,941
13년 전 조회 2,223
13년 전 조회 3,016
13년 전 조회 2,008
13년 전 조회 2,493
13년 전 조회 1,590
13년 전 조회 1,601
13년 전 조회 1,576
13년 전 조회 1,486
13년 전 조회 1,779
13년 전 조회 1,840
13년 전 조회 1,525
13년 전 조회 1,801
13년 전 조회 2,360
13년 전 조회 1,604
13년 전 조회 2,376
13년 전 조회 1,473
13년 전 조회 1,654
13년 전 조회 1,489
13년 전 조회 1,677
13년 전 조회 1,536
13년 전 조회 1,867
13년 전 조회 1,907
13년 전 조회 1,816
13년 전 조회 3,644
13년 전 조회 1,458
13년 전 조회 1,689
13년 전 조회 1,554
13년 전 조회 2,037
13년 전 조회 1,800
13년 전 조회 2,443
13년 전 조회 2,797
13년 전 조회 2,127
13년 전 조회 4,039
13년 전 조회 2,291
13년 전 조회 1,632
13년 전 조회 3,084
13년 전 조회 3,498
13년 전 조회 1,358
13년 전 조회 1,484
13년 전 조회 1,418
13년 전 조회 1,514
13년 전 조회 1,411
13년 전 조회 1,682
13년 전 조회 2,907
13년 전 조회 1,370
13년 전 조회 1,344
13년 전 조회 1,473
13년 전 조회 1,470
13년 전 조회 1,372
13년 전 조회 1,669
13년 전 조회 1,622
13년 전 조회 1,361
13년 전 조회 1,392
13년 전 조회 2,392
13년 전 조회 1,581
13년 전 조회 1,958