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

· 13년 전 · 1560
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,213
13년 전 조회 1,674
13년 전 조회 1,615
13년 전 조회 1,657
13년 전 조회 2,031
13년 전 조회 3,239
13년 전 조회 1,726
13년 전 조회 2,774
13년 전 조회 2,804
13년 전 조회 3,116
13년 전 조회 1,835
13년 전 조회 2,144
13년 전 조회 1,846
13년 전 조회 1,931
13년 전 조회 1,836
13년 전 조회 1,710
13년 전 조회 1,822
13년 전 조회 1,903
13년 전 조회 2,009
13년 전 조회 2,807
13년 전 조회 1,486
13년 전 조회 1,871
13년 전 조회 1,637
13년 전 조회 1,404
13년 전 조회 1,869
13년 전 조회 3,855
13년 전 조회 2,946
13년 전 조회 2,526
13년 전 조회 1,498
13년 전 조회 2,121
13년 전 조회 2,977
13년 전 조회 2,069
13년 전 조회 2,132
13년 전 조회 1,846
13년 전 조회 2,021
13년 전 조회 3,015
13년 전 조회 1,526
13년 전 조회 1,866
13년 전 조회 3,170
13년 전 조회 1,971
13년 전 조회 1,546
13년 전 조회 2,024
13년 전 조회 1,854
13년 전 조회 1,903
13년 전 조회 2,161
13년 전 조회 2,969
13년 전 조회 2,001
13년 전 조회 2,451
13년 전 조회 1,533
13년 전 조회 1,561
13년 전 조회 1,530
13년 전 조회 1,445
13년 전 조회 1,731
13년 전 조회 1,781
13년 전 조회 1,478
13년 전 조회 1,757
13년 전 조회 2,310
13년 전 조회 1,566
13년 전 조회 2,338
13년 전 조회 1,431
13년 전 조회 1,617
13년 전 조회 1,444
13년 전 조회 1,638
13년 전 조회 1,492
13년 전 조회 1,812
13년 전 조회 1,864
13년 전 조회 1,766
13년 전 조회 3,595
13년 전 조회 1,404
13년 전 조회 1,644
13년 전 조회 1,509
13년 전 조회 1,998
13년 전 조회 1,751
13년 전 조회 2,415
13년 전 조회 2,749
13년 전 조회 2,086
13년 전 조회 3,990
13년 전 조회 2,246
13년 전 조회 1,581
13년 전 조회 3,046
13년 전 조회 3,460
13년 전 조회 1,309
13년 전 조회 1,446
13년 전 조회 1,371
13년 전 조회 1,467
13년 전 조회 1,371
13년 전 조회 1,639
13년 전 조회 2,872
13년 전 조회 1,332
13년 전 조회 1,312
13년 전 조회 1,445
13년 전 조회 1,422
13년 전 조회 1,342
13년 전 조회 1,630
13년 전 조회 1,579
13년 전 조회 1,325
13년 전 조회 1,347
13년 전 조회 2,358
13년 전 조회 1,548
13년 전 조회 1,920