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

· 13년 전 · 1595
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,256
13년 전 조회 1,703
13년 전 조회 1,654
13년 전 조회 1,692
13년 전 조회 2,078
13년 전 조회 3,280
13년 전 조회 1,754
13년 전 조회 2,803
13년 전 조회 2,835
13년 전 조회 3,151
13년 전 조회 1,860
13년 전 조회 2,183
13년 전 조회 1,880
13년 전 조회 1,960
13년 전 조회 1,874
13년 전 조회 1,750
13년 전 조회 1,868
13년 전 조회 1,941
13년 전 조회 2,037
13년 전 조회 2,842
13년 전 조회 1,520
13년 전 조회 1,897
13년 전 조회 1,682
13년 전 조회 1,445
13년 전 조회 1,891
13년 전 조회 3,889
13년 전 조회 2,972
13년 전 조회 2,567
13년 전 조회 1,537
13년 전 조회 2,155
13년 전 조회 3,010
13년 전 조회 2,110
13년 전 조회 2,160
13년 전 조회 1,882
13년 전 조회 2,041
13년 전 조회 3,047
13년 전 조회 1,559
13년 전 조회 1,909
13년 전 조회 3,206
13년 전 조회 2,007
13년 전 조회 1,595
13년 전 조회 2,064
13년 전 조회 1,892
13년 전 조회 1,940
13년 전 조회 2,217
13년 전 조회 3,012
13년 전 조회 2,008
13년 전 조회 2,486
13년 전 조회 1,586
13년 전 조회 1,596
13년 전 조회 1,570
13년 전 조회 1,481
13년 전 조회 1,776
13년 전 조회 1,832
13년 전 조회 1,515
13년 전 조회 1,791
13년 전 조회 2,354
13년 전 조회 1,603
13년 전 조회 2,368
13년 전 조회 1,466
13년 전 조회 1,649
13년 전 조회 1,485
13년 전 조회 1,669
13년 전 조회 1,530
13년 전 조회 1,860
13년 전 조회 1,898
13년 전 조회 1,811
13년 전 조회 3,637
13년 전 조회 1,456
13년 전 조회 1,685
13년 전 조회 1,550
13년 전 조회 2,031
13년 전 조회 1,793
13년 전 조회 2,440
13년 전 조회 2,792
13년 전 조회 2,121
13년 전 조회 4,033
13년 전 조회 2,285
13년 전 조회 1,627
13년 전 조회 3,080
13년 전 조회 3,497
13년 전 조회 1,353
13년 전 조회 1,477
13년 전 조회 1,411
13년 전 조회 1,509
13년 전 조회 1,404
13년 전 조회 1,676
13년 전 조회 2,905
13년 전 조회 1,365
13년 전 조회 1,342
13년 전 조회 1,469
13년 전 조회 1,466
13년 전 조회 1,371
13년 전 조회 1,664
13년 전 조회 1,620
13년 전 조회 1,353
13년 전 조회 1,386
13년 전 조회 2,386
13년 전 조회 1,576
13년 전 조회 1,952