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

· 13년 전 · 1613
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,273
13년 전 조회 1,718
13년 전 조회 1,666
13년 전 조회 1,708
13년 전 조회 2,097
13년 전 조회 3,295
13년 전 조회 1,779
13년 전 조회 2,810
13년 전 조회 2,851
13년 전 조회 3,164
13년 전 조회 1,872
13년 전 조회 2,195
13년 전 조회 1,889
13년 전 조회 1,975
13년 전 조회 1,889
13년 전 조회 1,765
13년 전 조회 1,880
13년 전 조회 1,948
13년 전 조회 2,056
13년 전 조회 2,854
13년 전 조회 1,535
13년 전 조회 1,905
13년 전 조회 1,701
13년 전 조회 1,461
13년 전 조회 1,906
13년 전 조회 3,906
13년 전 조회 2,989
13년 전 조회 2,577
13년 전 조회 1,547
13년 전 조회 2,167
13년 전 조회 3,027
13년 전 조회 2,128
13년 전 조회 2,182
13년 전 조회 1,901
13년 전 조회 2,057
13년 전 조회 3,058
13년 전 조회 1,575
13년 전 조회 1,923
13년 전 조회 3,222
13년 전 조회 2,022
13년 전 조회 1,610
13년 전 조회 2,087
13년 전 조회 1,914
13년 전 조회 1,946
13년 전 조회 2,236
13년 전 조회 3,025
13년 전 조회 2,011
13년 전 조회 2,502
13년 전 조회 1,605
13년 전 조회 1,614
13년 전 조회 1,588
13년 전 조회 1,494
13년 전 조회 1,796
13년 전 조회 1,850
13년 전 조회 1,532
13년 전 조회 1,815
13년 전 조회 2,367
13년 전 조회 1,614
13년 전 조회 2,383
13년 전 조회 1,485
13년 전 조회 1,669
13년 전 조회 1,495
13년 전 조회 1,692
13년 전 조회 1,546
13년 전 조회 1,878
13년 전 조회 1,918
13년 전 조회 1,830
13년 전 조회 3,654
13년 전 조회 1,466
13년 전 조회 1,695
13년 전 조회 1,568
13년 전 조회 2,046
13년 전 조회 1,808
13년 전 조회 2,452
13년 전 조회 2,809
13년 전 조회 2,137
13년 전 조회 4,044
13년 전 조회 2,298
13년 전 조회 1,638
13년 전 조회 3,095
13년 전 조회 3,510
13년 전 조회 1,372
13년 전 조회 1,500
13년 전 조회 1,429
13년 전 조회 1,530
13년 전 조회 1,422
13년 전 조회 1,688
13년 전 조회 2,917
13년 전 조회 1,380
13년 전 조회 1,360
13년 전 조회 1,487
13년 전 조회 1,477
13년 전 조회 1,387
13년 전 조회 1,681
13년 전 조회 1,632
13년 전 조회 1,371
13년 전 조회 1,403
13년 전 조회 2,398
13년 전 조회 1,586
13년 전 조회 1,964