-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
218 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# bash completion for strace-analyzer | ||
|
||
_strace-analyzer() | ||
{ | ||
local cur prev | ||
_init_completion || return | ||
|
||
case $prev in | ||
summary|read|write|io) | ||
_expand || return 0 | ||
compopt -o filenames | ||
COMPREPLY=( $( compgen -fd -- "$cur" ) ) | ||
return 0 | ||
;; | ||
esac | ||
|
||
case $cur in | ||
--*) | ||
COMPREPLY=( $( compgen -W '--help --version' -- $cur ) ) | ||
;; | ||
-*) | ||
COMPREPLY=( $( compgen -W '-? -h -help -version --help --version' -- $cur ) ) | ||
;; | ||
*) | ||
COMPREPLY=( $( compgen -W 'summary read write io' -- $cur ) ) | ||
;; | ||
esac | ||
|
||
return 0 | ||
} && | ||
complete -F _strace-analyzer strace-analyzer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
.\" Automatically generated by Pandoc 1.17.0.3 | ||
.\" | ||
.TH "STRACE\-ANALYZER" "1" "March 2016" "Version 0.1.1" "strace\-analyzer manual" | ||
.hy | ||
.SH NAME | ||
.PP | ||
strace\-analyzer \- analyzes strace output | ||
.SH SYNOPSIS | ||
.PP | ||
\f[B]strace\-analyzer\f[] <\f[I]command\f[]> [\f[I]log1\f[] | ||
\f[I]log2\f[] ...] | ||
.SH DESCRIPTION | ||
.PP | ||
\f[B]strace\-analyzer\f[] analyzes logs created by \f[B]strace(1)\f[]. | ||
There are different analysis commands which are explained in the | ||
\f[B]Analysis Commands\f[] section. | ||
.PP | ||
The file descriptors you see when looking at the logs manually are not | ||
very descriptive, i.e. | ||
to know what happened with which file, pipe, etc. | ||
For this reason, \f[B]strace\-analyzer\f[] associates these file | ||
descriptors with file names. | ||
These associations are made when syscalls like \f[B]open(2)\f[], | ||
\f[B]creat(2)\f[], \f[B]dup(2)\f[] or \f[B]pipe(2)\f[] are read from the | ||
log and are terminated when they get \f[B]close(2)\f[]d. | ||
.PP | ||
There are some \f[B]strace(1)\f[] command line options that are required | ||
for \f[B]strace\-analyzer\f[] to interpret the logs correctly. | ||
The option \f[B]\-T\f[] is required to trace the time spent on the | ||
syscalls themselves. | ||
The option \f[B]\-ttt\f[] is required to trace the syscalls over time. | ||
The option \f[B]\-o\f[] is required to store the logs on disk. | ||
The option \f[B]\-ff\f[] is required for each process to get its own log | ||
file. | ||
The problem with strace and writing syscalls from multiple processes (or | ||
threads) to the same output file is that start and end of a single | ||
syscall are split over two lines and there is no way of merging them | ||
back together with respect to the file descriptor association. | ||
Thus, the resulting \f[B]strace(1)\f[] invocation to create the logs | ||
should look as in the \f[B]EXAMPLES\f[] section. | ||
.SS Analysis Commands | ||
.TP | ||
.B summary | ||
Prints a summary for the syscalls \f[B]read(2)\f[] and | ||
\f[B]write(2)\f[]. | ||
.RS | ||
.RE | ||
.TP | ||
.B read | ||
Prints a \f[B]read(2)\f[] summary for each file. | ||
.RS | ||
.RE | ||
.TP | ||
.B write | ||
Prints a \f[B]write(2)\f[] summary for each file. | ||
.RS | ||
.RE | ||
.TP | ||
.B io | ||
Does both the \f[B]read\f[] and \f[B]write\f[] commands for each file. | ||
.RS | ||
.RE | ||
.SH OPTIONS | ||
.TP | ||
.B \-?, \-h, \-help, \-\-help | ||
Prints usage information. | ||
.RS | ||
.RE | ||
.TP | ||
.B \-version, \-\-version | ||
Prints the current version number. | ||
.RS | ||
.RE | ||
.SH EXAMPLES | ||
.SS create logs | ||
.PP | ||
strace \-T \-ttt \-ff \-o /tmp/strace\-dd.log dd if=/dev/zero | ||
of=/dev/null count=1024 bs=1M | ||
.SS analyze logs | ||
.PP | ||
strace\-analyzer io /tmp/strace\-dd.log.* | ||
.SS analyze logs with filtering and pretty, tabular printing | ||
.PP | ||
strace\-analyzer io /tmp/strace\-dd.log.* | grep /dev/ | column \-t | ||
.SH BUGS, ISSUES and FEATURE REQUESTS | ||
.PP | ||
See GitHub issues: | ||
<https://github.com/wookietreiber/strace-analyzer/issues> | ||
.SH AUTHOR | ||
.PP | ||
Christian Krause <https://github.com/wookietreiber> | ||
.SH SEE ALSO | ||
.PP | ||
\f[B]strace(1)\f[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
% STRACE-ANALYZER(1) Version 0.1.1 | strace-analyzer manual | ||
% | ||
% March 2016 | ||
|
||
# NAME | ||
|
||
strace-analyzer - analyzes strace output | ||
|
||
# SYNOPSIS | ||
|
||
| **strace-analyzer** \<*command*> \[*log1* *log2* ...] | ||
|
||
# DESCRIPTION | ||
|
||
**strace-analyzer** analyzes logs created by **strace(1)**. There are different analysis commands | ||
which are explained in the **Analysis Commands** section. | ||
|
||
The file descriptors you see when looking at the logs manually are not very descriptive, i.e. to | ||
know what happened with which file, pipe, etc. For this reason, **strace-analyzer** associates these | ||
file descriptors with file names. These associations are made when syscalls like **open(2)**, | ||
**creat(2)**, **dup(2)** or **pipe(2)** are read from the log and are terminated when they get | ||
**close(2)**d. | ||
|
||
There are some **strace(1)** command line options that are required for **strace-analyzer** to | ||
interpret the logs correctly. The option **-T** is required to trace the time spent on the syscalls | ||
themselves. The option **-ttt** is required to trace the syscalls over time. The option **-o** is | ||
required to store the logs on disk. The option **-ff** is required for each process to get its own | ||
log file. The problem with strace and writing syscalls from multiple processes (or threads) to the | ||
same output file is that start and end of a single syscall are split over two lines and there is no | ||
way of merging them back together with respect to the file descriptor association. Thus, the | ||
resulting **strace(1)** invocation to create the logs should look as in the **EXAMPLES** section. | ||
|
||
## Analysis Commands | ||
|
||
summary | ||
|
||
: Prints a summary for the syscalls **read(2)** and **write(2)**. | ||
|
||
read | ||
|
||
: Prints a **read(2)** summary for each file. | ||
|
||
write | ||
|
||
: Prints a **write(2)** summary for each file. | ||
|
||
io | ||
|
||
: Does both the **read** and **write** commands for each file. | ||
|
||
# OPTIONS | ||
|
||
-?, -h, -help, --help | ||
|
||
: Prints usage information. | ||
|
||
-version, --version | ||
|
||
: Prints the current version number. | ||
|
||
# EXAMPLES | ||
|
||
## create logs | ||
|
||
strace -T -ttt -ff -o /tmp/strace-dd.log dd if=/dev/zero of=/dev/null count=1024 bs=1M | ||
|
||
## analyze logs | ||
|
||
strace-analyzer io /tmp/strace-dd.log.* | ||
|
||
## analyze logs with filtering and pretty, tabular printing | ||
|
||
strace-analyzer io /tmp/strace-dd.log.* | grep /dev/ | column -t | ||
|
||
# BUGS, ISSUES and FEATURE REQUESTS | ||
|
||
See GitHub issues: <https://github.com/wookietreiber/strace-analyzer/issues> | ||
|
||
# AUTHOR | ||
|
||
Christian Krause <https://github.com/wookietreiber> | ||
|
||
# SEE ALSO | ||
|
||
**strace(1)** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
git.baseVersion in ThisBuild := "0.1.1" |