hardware:gl-ar750s-ext:strace

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
hardware:gl-ar750s-ext:strace [2020/03/16 10:24] – 作成 ともやんhardware:gl-ar750s-ext:strace [2020/09/11 19:08] (現在) – [実行] ともやん
行 1: 行 1:
-<html> 
-  <style> 
-    #result pre { 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-    #result_long pre { 
-      height: 300px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-      font-size: 10px; 
-    } 
-  </style> 
-</html> 
 ====== strace コマンド ====== ====== strace コマンド ======
  
行 46: 行 31:
 </WRAP> </WRAP>
  
 +===== 動作確認 =====
 +<code>
 +# strace -h
 +</code>
 +<WRAP prewrap 100% #result_long>
 +<code>
 +usage: strace [-CdffhiqrtttTvVwxxy] [-I n] [-e expr]...
 +              [-a column] [-o file] [-s strsize] [-P path]...
 +              -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]
 +   or: strace -c[dfw] [-I n] [-e expr]... [-O overhead] [-S sortby]
 +              -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]
 +
 +Output format:
 +  -a column      alignment COLUMN for printing syscall results (default 40)
 +  -i             print instruction pointer at time of syscall
 +  -o file        send trace output to FILE instead of stderr
 +  -q             suppress messages about attaching, detaching, etc.
 +  -r             print relative timestamp
 +  -s strsize     limit length of print strings to STRSIZE chars (default 32)
 +  -t             print absolute timestamp
 +  -tt            print absolute timestamp with usecs
 +  -T             print time spent in each syscall
 +  -x             print non-ascii strings in hex
 +  -xx            print all strings in hex
 +  -y             print paths associated with file descriptor arguments
 +  -yy            print protocol specific information associated with socket file descriptors
 +
 +Statistics:
 +  -c             count time, calls, and errors for each syscall and report summary
 +  -C             like -c but also print regular output
 +  -O overhead    set overhead for tracing syscalls to OVERHEAD usecs
 +  -S sortby      sort syscall counts by: time, calls, name, nothing (default time)
 +  -w             summarise syscall latency (default is system time)
 +
 +Filtering:
 +  -e expr        a qualifying expression: option=[!]all or option=[!]val1[,val2]...
 +     options:    trace, abbrev, verbose, raw, signal, read, write, fault
 +  -P path        trace accesses to path
 +
 +Tracing:
 +  -b execve      detach on execve syscall
 +  -D             run tracer process as a detached grandchild, not as parent
 +  -f             follow forks
 +  -ff            follow forks with output into separate files
 +  -I interruptible
 +     1:          no signals are blocked
 +     2:          fatal signals are blocked while decoding syscall (default)
 +     3:          fatal signals are always blocked (default if '-o FILE PROG')
 +     4:          fatal signals and SIGTSTP (^Z) are always blocked
 +                 (useful to make 'strace -o FILE PROG' not stop on ^Z)
 +
 +Startup:
 +  -E var         remove var from the environment for command
 +  -E var=val     put var=val in the environment for command
 +  -p pid         trace process with process id PID, may be repeated
 +  -u username    run command as username handling setuid and/or setgid
 +
 +Miscellaneous:
 +  -d             enable debug output to stderr
 +  -v             verbose mode: print unabbreviated argv, stat, termios, etc. args
 +  -h             print help message
 +  -V             print version
 +</code>
 +</WRAP>
 +
 +===== 実行 =====
 +strace [プロセス(コマンド等)]\\
 +\\
 +実行例:\\
 +<code>
 +# strace ls
 +</code>
 +<WRAP prewrap 100% #result>
 +<code>
 +execve("/bin/ls", ["ls"], 0x7faec570 /* 13 vars */) = 0
 +set_thread_area(0x77cc1da0)             = 0
 +set_tid_address(0x77cbad08)             = 2290
 +open("/etc/ld-musl-mips-sf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
 +open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
 +fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
 +fstat64(3, {st_mode=S_IFREG|0644, st_size=87624, ...}) = 0
 +read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\10\0\0\0\1\0\0(0\0\0\0004"..., 936) = 936
 +mmap2(NULL, 155648, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x77be2000
 +mmap2(0x77c07000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x15000) = 0x77c07000
 +close(3)                                = 0
 +mprotect(0x45f000, 4096, PROT_READ)     = 0
 +prctl(PR_SET_NAME, "ls"               = 0
 +getuid()                                = 0
 +clock_gettime(CLOCK_REALTIME, {tv_sec=1584324418, tv_nsec=689099805}) = 0
 +ioctl(0, TIOCGWINSZ, 0x7fd4acd8)        = 0
 +ioctl(1, TIOCGWINSZ, 0x7fd4ad10)        = 0
 +ioctl(1, TIOCGWINSZ, 0x7fd4ad10)        = 0
 +stat64(".", {st_mode=S_IFDIR|0755, st_size=3, ...}) = 0
 +open(".", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
 +fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
 +getdents64(3, /* 2 entries */, 2048)    = 48
 +getdents64(3, /* 0 entries */, 2048)    = 0
 +close(3)                                = 0
 +exit_group(0)                           = ?
 ++++ exited with 0 +++
 +</code>
 +</WRAP>
  
  • hardware/gl-ar750s-ext/strace.1584321887.txt.gz
  • 最終更新: 2020/03/16 10:24
  • by ともやん