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

· 13년 전 · 1398
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,071
13년 전 조회 1,506
13년 전 조회 1,456
13년 전 조회 1,500
13년 전 조회 1,878
13년 전 조회 3,067
13년 전 조회 1,587
13년 전 조회 2,622
13년 전 조회 2,653
13년 전 조회 2,968
13년 전 조회 1,676
13년 전 조회 1,999
13년 전 조회 1,687
13년 전 조회 1,796
13년 전 조회 1,694
13년 전 조회 1,567
13년 전 조회 1,684
13년 전 조회 1,738
13년 전 조회 1,868
13년 전 조회 2,659
13년 전 조회 1,335
13년 전 조회 1,722
13년 전 조회 1,466
13년 전 조회 1,251
13년 전 조회 1,713
13년 전 조회 3,696
13년 전 조회 2,819
13년 전 조회 2,371
13년 전 조회 1,326
13년 전 조회 1,966
13년 전 조회 2,800
13년 전 조회 1,928
13년 전 조회 2,006
13년 전 조회 1,703
13년 전 조회 1,883
13년 전 조회 2,851
13년 전 조회 1,336
13년 전 조회 1,698
13년 전 조회 3,028
13년 전 조회 1,838
13년 전 조회 1,405
13년 전 조회 1,868
13년 전 조회 1,709
13년 전 조회 1,763
13년 전 조회 1,999
13년 전 조회 2,821
13년 전 조회 1,835
13년 전 조회 2,300
13년 전 조회 1,364
13년 전 조회 1,399
13년 전 조회 1,360
13년 전 조회 1,294
13년 전 조회 1,590
13년 전 조회 1,615
13년 전 조회 1,312
13년 전 조회 1,581
13년 전 조회 2,132
13년 전 조회 1,403
13년 전 조회 2,198
13년 전 조회 1,262
13년 전 조회 1,473
13년 전 조회 1,287
13년 전 조회 1,478
13년 전 조회 1,321
13년 전 조회 1,668
13년 전 조회 1,731
13년 전 조회 1,616
13년 전 조회 3,435
13년 전 조회 1,242
13년 전 조회 1,490
13년 전 조회 1,358
13년 전 조회 1,879
13년 전 조회 1,596
13년 전 조회 2,306
13년 전 조회 2,642
13년 전 조회 1,954
13년 전 조회 3,856
13년 전 조회 2,102
13년 전 조회 1,470
13년 전 조회 2,906
13년 전 조회 3,337
13년 전 조회 1,161
13년 전 조회 1,300
13년 전 조회 1,224
13년 전 조회 1,300
13년 전 조회 1,223
13년 전 조회 1,461
13년 전 조회 2,706
13년 전 조회 1,172
13년 전 조회 1,144
13년 전 조회 1,291
13년 전 조회 1,256
13년 전 조회 1,177
13년 전 조회 1,485
13년 전 조회 1,432
13년 전 조회 1,169
13년 전 조회 1,181
13년 전 조회 2,216
13년 전 조회 1,420
13년 전 조회 1,788