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

· 13년 전 · 1162
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년 전 조회 1,801
13년 전 조회 1,245
13년 전 조회 1,197
13년 전 조회 1,251
13년 전 조회 1,645
13년 전 조회 2,812
13년 전 조회 1,340
13년 전 조회 2,344
13년 전 조회 2,437
13년 전 조회 2,791
13년 전 조회 1,431
13년 전 조회 1,726
13년 전 조회 1,447
13년 전 조회 1,528
13년 전 조회 1,447
13년 전 조회 1,306
13년 전 조회 1,456
13년 전 조회 1,475
13년 전 조회 1,568
13년 전 조회 2,397
13년 전 조회 1,076
13년 전 조회 1,450
13년 전 조회 1,214
13년 전 조회 991
13년 전 조회 1,474
13년 전 조회 3,448
13년 전 조회 2,557
13년 전 조회 2,114
13년 전 조회 1,066
13년 전 조회 1,711
13년 전 조회 2,527
13년 전 조회 1,658
13년 전 조회 1,709
13년 전 조회 1,453
13년 전 조회 1,621
13년 전 조회 2,608
13년 전 조회 1,080
13년 전 조회 1,439
13년 전 조회 2,792
13년 전 조회 1,593
13년 전 조회 1,152
13년 전 조회 1,638
13년 전 조회 1,437
13년 전 조회 1,509
13년 전 조회 1,763
13년 전 조회 2,581
13년 전 조회 1,631
13년 전 조회 2,109
13년 전 조회 1,114
13년 전 조회 1,163
13년 전 조회 1,081
13년 전 조회 1,032
13년 전 조회 1,352
13년 전 조회 1,368
13년 전 조회 1,076
13년 전 조회 1,313
13년 전 조회 1,891
13년 전 조회 1,127
13년 전 조회 1,939
13년 전 조회 1,019
13년 전 조회 1,233
13년 전 조회 1,010
13년 전 조회 1,240
13년 전 조회 1,082
13년 전 조회 1,418
13년 전 조회 1,484
13년 전 조회 1,342
13년 전 조회 3,198
13년 전 조회 989
13년 전 조회 1,234
13년 전 조회 1,103
13년 전 조회 1,597
13년 전 조회 1,340
13년 전 조회 2,039
13년 전 조회 2,370
13년 전 조회 1,708
13년 전 조회 3,669
13년 전 조회 1,859
13년 전 조회 1,206
13년 전 조회 2,668
13년 전 조회 3,107
13년 전 조회 942
13년 전 조회 1,042
13년 전 조회 973
13년 전 조회 1,054
13년 전 조회 968
13년 전 조회 1,201
13년 전 조회 2,445
13년 전 조회 920
13년 전 조회 922
13년 전 조회 1,050
13년 전 조회 1,013
13년 전 조회 920
13년 전 조회 1,222
13년 전 조회 1,168
13년 전 조회 924
13년 전 조회 928
13년 전 조회 1,960
13년 전 조회 1,154
13년 전 조회 1,537