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

· 13년 전 · 1728
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,372
13년 전 조회 1,819
13년 전 조회 1,770
13년 전 조회 1,808
13년 전 조회 2,196
13년 전 조회 3,399
13년 전 조회 1,874
13년 전 조회 2,908
13년 전 조회 2,955
13년 전 조회 3,269
13년 전 조회 1,959
13년 전 조회 2,283
13년 전 조회 1,977
13년 전 조회 2,089
13년 전 조회 1,989
13년 전 조회 1,867
13년 전 조회 1,970
13년 전 조회 2,043
13년 전 조회 2,131
13년 전 조회 2,948
13년 전 조회 1,636
13년 전 조회 1,993
13년 전 조회 1,793
13년 전 조회 1,563
13년 전 조회 2,008
13년 전 조회 4,010
13년 전 조회 3,087
13년 전 조회 2,671
13년 전 조회 1,639
13년 전 조회 2,264
13년 전 조회 3,127
13년 전 조회 2,222
13년 전 조회 2,271
13년 전 조회 1,999
13년 전 조회 2,153
13년 전 조회 3,177
13년 전 조회 1,683
13년 전 조회 2,013
13년 전 조회 3,334
13년 전 조회 2,119
13년 전 조회 1,710
13년 전 조회 2,195
13년 전 조회 2,014
13년 전 조회 2,037
13년 전 조회 2,326
13년 전 조회 3,131
13년 전 조회 2,059
13년 전 조회 2,605
13년 전 조회 1,704
13년 전 조회 1,729
13년 전 조회 1,670
13년 전 조회 1,623
13년 전 조회 1,914
13년 전 조회 1,974
13년 전 조회 1,662
13년 전 조회 1,928
13년 전 조회 2,472
13년 전 조회 1,726
13년 전 조회 2,511
13년 전 조회 1,596
13년 전 조회 1,788
13년 전 조회 1,599
13년 전 조회 1,826
13년 전 조회 1,656
13년 전 조회 1,984
13년 전 조회 2,043
13년 전 조회 1,934
13년 전 조회 3,754
13년 전 조회 1,561
13년 전 조회 1,797
13년 전 조회 1,664
13년 전 조회 2,163
13년 전 조회 1,911
13년 전 조회 2,559
13년 전 조회 2,908
13년 전 조회 2,231
13년 전 조회 4,150
13년 전 조회 2,411
13년 전 조회 1,745
13년 전 조회 3,220
13년 전 조회 3,619
13년 전 조회 1,473
13년 전 조회 1,604
13년 전 조회 1,530
13년 전 조회 1,630
13년 전 조회 1,525
13년 전 조회 1,795
13년 전 조회 3,024
13년 전 조회 1,467
13년 전 조회 1,465
13년 전 조회 1,603
13년 전 조회 1,584
13년 전 조회 1,493
13년 전 조회 1,782
13년 전 조회 1,722
13년 전 조회 1,473
13년 전 조회 1,499
13년 전 조회 2,517
13년 전 조회 1,674
13년 전 조회 2,072