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

· 13년 전 · 1724
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,368
13년 전 조회 1,816
13년 전 조회 1,766
13년 전 조회 1,806
13년 전 조회 2,192
13년 전 조회 3,394
13년 전 조회 1,873
13년 전 조회 2,901
13년 전 조회 2,950
13년 전 조회 3,266
13년 전 조회 1,953
13년 전 조회 2,276
13년 전 조회 1,974
13년 전 조회 2,087
13년 전 조회 1,982
13년 전 조회 1,863
13년 전 조회 1,966
13년 전 조회 2,039
13년 전 조회 2,130
13년 전 조회 2,942
13년 전 조회 1,631
13년 전 조회 1,986
13년 전 조회 1,789
13년 전 조회 1,557
13년 전 조회 2,004
13년 전 조회 4,006
13년 전 조회 3,080
13년 전 조회 2,666
13년 전 조회 1,633
13년 전 조회 2,259
13년 전 조회 3,122
13년 전 조회 2,217
13년 전 조회 2,269
13년 전 조회 1,997
13년 전 조회 2,151
13년 전 조회 3,175
13년 전 조회 1,679
13년 전 조회 2,009
13년 전 조회 3,330
13년 전 조회 2,114
13년 전 조회 1,704
13년 전 조회 2,191
13년 전 조회 2,011
13년 전 조회 2,033
13년 전 조회 2,323
13년 전 조회 3,129
13년 전 조회 2,058
13년 전 조회 2,600
13년 전 조회 1,700
13년 전 조회 1,725
13년 전 조회 1,669
13년 전 조회 1,622
13년 전 조회 1,910
13년 전 조회 1,973
13년 전 조회 1,657
13년 전 조회 1,925
13년 전 조회 2,470
13년 전 조회 1,720
13년 전 조회 2,508
13년 전 조회 1,596
13년 전 조회 1,785
13년 전 조회 1,598
13년 전 조회 1,821
13년 전 조회 1,654
13년 전 조회 1,978
13년 전 조회 2,036
13년 전 조회 1,932
13년 전 조회 3,750
13년 전 조회 1,556
13년 전 조회 1,793
13년 전 조회 1,660
13년 전 조회 2,158
13년 전 조회 1,905
13년 전 조회 2,554
13년 전 조회 2,905
13년 전 조회 2,227
13년 전 조회 4,144
13년 전 조회 2,406
13년 전 조회 1,738
13년 전 조회 3,212
13년 전 조회 3,614
13년 전 조회 1,469
13년 전 조회 1,597
13년 전 조회 1,523
13년 전 조회 1,625
13년 전 조회 1,520
13년 전 조회 1,793
13년 전 조회 3,018
13년 전 조회 1,466
13년 전 조회 1,463
13년 전 조회 1,598
13년 전 조회 1,582
13년 전 조회 1,489
13년 전 조회 1,777
13년 전 조회 1,721
13년 전 조회 1,466
13년 전 조회 1,498
13년 전 조회 2,513
13년 전 조회 1,673
13년 전 조회 2,069