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

· 13년 전 · 1184
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,826
13년 전 조회 1,271
13년 전 조회 1,219
13년 전 조회 1,279
13년 전 조회 1,669
13년 전 조회 2,845
13년 전 조회 1,364
13년 전 조회 2,373
13년 전 조회 2,460
13년 전 조회 2,815
13년 전 조회 1,458
13년 전 조회 1,756
13년 전 조회 1,475
13년 전 조회 1,558
13년 전 조회 1,474
13년 전 조회 1,336
13년 전 조회 1,479
13년 전 조회 1,503
13년 전 조회 1,607
13년 전 조회 2,426
13년 전 조회 1,110
13년 전 조회 1,477
13년 전 조회 1,237
13년 전 조회 1,012
13년 전 조회 1,498
13년 전 조회 3,468
13년 전 조회 2,581
13년 전 조회 2,140
13년 전 조회 1,092
13년 전 조회 1,742
13년 전 조회 2,554
13년 전 조회 1,677
13년 전 조회 1,737
13년 전 조회 1,483
13년 전 조회 1,646
13년 전 조회 2,629
13년 전 조회 1,113
13년 전 조회 1,470
13년 전 조회 2,822
13년 전 조회 1,621
13년 전 조회 1,179
13년 전 조회 1,661
13년 전 조회 1,467
13년 전 조회 1,539
13년 전 조회 1,779
13년 전 조회 2,609
13년 전 조회 1,649
13년 전 조회 2,142
13년 전 조회 1,139
13년 전 조회 1,185
13년 전 조회 1,116
13년 전 조회 1,061
13년 전 조회 1,381
13년 전 조회 1,394
13년 전 조회 1,102
13년 전 조회 1,345
13년 전 조회 1,923
13년 전 조회 1,140
13년 전 조회 1,968
13년 전 조회 1,045
13년 전 조회 1,260
13년 전 조회 1,031
13년 전 조회 1,263
13년 전 조회 1,115
13년 전 조회 1,455
13년 전 조회 1,505
13년 전 조회 1,373
13년 전 조회 3,223
13년 전 조회 1,014
13년 전 조회 1,254
13년 전 조회 1,125
13년 전 조회 1,622
13년 전 조회 1,365
13년 전 조회 2,063
13년 전 조회 2,389
13년 전 조회 1,741
13년 전 조회 3,693
13년 전 조회 1,885
13년 전 조회 1,233
13년 전 조회 2,688
13년 전 조회 3,138
13년 전 조회 957
13년 전 조회 1,073
13년 전 조회 997
13년 전 조회 1,081
13년 전 조회 998
13년 전 조회 1,224
13년 전 조회 2,468
13년 전 조회 946
13년 전 조회 943
13년 전 조회 1,081
13년 전 조회 1,038
13년 전 조회 941
13년 전 조회 1,246
13년 전 조회 1,200
13년 전 조회 947
13년 전 조회 956
13년 전 조회 1,985
13년 전 조회 1,185
13년 전 조회 1,563