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

· 13년 전 · 1753
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,399
13년 전 조회 1,847
13년 전 조회 1,809
13년 전 조회 1,837
13년 전 조회 2,229
13년 전 조회 3,426
13년 전 조회 1,906
13년 전 조회 2,938
13년 전 조회 2,985
13년 전 조회 3,304
13년 전 조회 1,997
13년 전 조회 2,317
13년 전 조회 2,014
13년 전 조회 2,116
13년 전 조회 2,021
13년 전 조회 1,901
13년 전 조회 2,005
13년 전 조회 2,069
13년 전 조회 2,167
13년 전 조회 2,973
13년 전 조회 1,663
13년 전 조회 2,037
13년 전 조회 1,822
13년 전 조회 1,593
13년 전 조회 2,036
13년 전 조회 4,051
13년 전 조회 3,112
13년 전 조회 2,708
13년 전 조회 1,671
13년 전 조회 2,295
13년 전 조회 3,155
13년 전 조회 2,251
13년 전 조회 2,309
13년 전 조회 2,022
13년 전 조회 2,186
13년 전 조회 3,212
13년 전 조회 1,710
13년 전 조회 2,043
13년 전 조회 3,355
13년 전 조회 2,152
13년 전 조회 1,742
13년 전 조회 2,225
13년 전 조회 2,043
13년 전 조회 2,063
13년 전 조회 2,355
13년 전 조회 3,158
13년 전 조회 2,071
13년 전 조회 2,633
13년 전 조회 1,738
13년 전 조회 1,754
13년 전 조회 1,696
13년 전 조회 1,651
13년 전 조회 1,936
13년 전 조회 2,005
13년 전 조회 1,692
13년 전 조회 1,953
13년 전 조회 2,509
13년 전 조회 1,764
13년 전 조회 2,532
13년 전 조회 1,619
13년 전 조회 1,821
13년 전 조회 1,631
13년 전 조회 1,851
13년 전 조회 1,690
13년 전 조회 2,013
13년 전 조회 2,066
13년 전 조회 1,968
13년 전 조회 3,791
13년 전 조회 1,591
13년 전 조회 1,830
13년 전 조회 1,703
13년 전 조회 2,196
13년 전 조회 1,936
13년 전 조회 2,596
13년 전 조회 2,936
13년 전 조회 2,261
13년 전 조회 4,185
13년 전 조회 2,443
13년 전 조회 1,784
13년 전 조회 3,250
13년 전 조회 3,660
13년 전 조회 1,508
13년 전 조회 1,636
13년 전 조회 1,562
13년 전 조회 1,661
13년 전 조회 1,556
13년 전 조회 1,835
13년 전 조회 3,053
13년 전 조회 1,505
13년 전 조회 1,499
13년 전 조회 1,637
13년 전 조회 1,627
13년 전 조회 1,520
13년 전 조회 1,820
13년 전 조회 1,753
13년 전 조회 1,507
13년 전 조회 1,534
13년 전 조회 2,550
13년 전 조회 1,706
13년 전 조회 2,108