COMING SOON 🚀

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

· 13년 전 · 1497
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,159
13년 전 조회 1,609
13년 전 조회 1,560
13년 전 조회 1,612
13년 전 조회 1,970
13년 전 조회 3,189
13년 전 조회 1,677
13년 전 조회 2,718
13년 전 조회 2,755
13년 전 조회 3,058
13년 전 조회 1,782
13년 전 조회 2,093
13년 전 조회 1,787
13년 전 조회 1,884
13년 전 조회 1,782
13년 전 조회 1,650
13년 전 조회 1,771
13년 전 조회 1,843
13년 전 조회 1,963
13년 전 조회 2,767
13년 전 조회 1,420
13년 전 조회 1,823
13년 전 조회 1,587
13년 전 조회 1,356
13년 전 조회 1,810
13년 전 조회 3,803
13년 전 조회 2,893
13년 전 조회 2,483
13년 전 조회 1,438
13년 전 조회 2,063
13년 전 조회 2,919
13년 전 조회 2,014
13년 전 조회 2,091
13년 전 조회 1,800
13년 전 조회 1,976
13년 전 조회 2,957
13년 전 조회 1,463
13년 전 조회 1,809
13년 전 조회 3,120
13년 전 조회 1,934
13년 전 조회 1,498
13년 전 조회 1,967
13년 전 조회 1,804
13년 전 조회 1,854
13년 전 조회 2,094
13년 전 조회 2,920
13년 전 조회 1,993
13년 전 조회 2,408
13년 전 조회 1,476
13년 전 조회 1,498
13년 전 조회 1,467
13년 전 조회 1,401
13년 전 조회 1,685
13년 전 조회 1,729
13년 전 조회 1,426
13년 전 조회 1,692
13년 전 조회 2,244
13년 전 조회 1,504
13년 전 조회 2,285
13년 전 조회 1,373
13년 전 조회 1,559
13년 전 조회 1,393
13년 전 조회 1,579
13년 전 조회 1,420
13년 전 조회 1,767
13년 전 조회 1,811
13년 전 조회 1,715
13년 전 조회 3,538
13년 전 조회 1,352
13년 전 조회 1,603
13년 전 조회 1,457
13년 전 조회 1,955
13년 전 조회 1,696
13년 전 조회 2,378
13년 전 조회 2,712
13년 전 조회 2,052
13년 전 조회 3,948
13년 전 조회 2,192
13년 전 조회 1,545
13년 전 조회 2,998
13년 전 조회 3,426
13년 전 조회 1,259
13년 전 조회 1,407
13년 전 조회 1,310
13년 전 조회 1,418
13년 전 조회 1,318
13년 전 조회 1,575
13년 전 조회 2,810
13년 전 조회 1,277
13년 전 조회 1,250
13년 전 조회 1,402
13년 전 조회 1,357
13년 전 조회 1,279
13년 전 조회 1,570
13년 전 조회 1,535
13년 전 조회 1,267
13년 전 조회 1,291
13년 전 조회 2,311
13년 전 조회 1,508
13년 전 조회 1,876