blob: 255246c91987c3c778ce4e96454a09e81f663ad6 [file] [log] [blame]
Elliott Hughesb7556142018-02-20 17:03:16 -08001.\" Copyright (c) 2017 The strace developers.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. The name of the author may not be used to endorse or promote products
13.\" derived from this software without specific prior written permission.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\" Required option.
27.de OR
28. ie \\n(.$-1 \
29. RI "\fB\\$1\fP" "\ \\$2"
30. el \
31. BR "\\$1"
32..
33.\"
34.TH STRACE-LOG-MERGE 1 "@MANPAGE_DATE@" "strace @VERSION@"
35.\"
36.SH NAME
37strace-log-merge \- merge strace \-ff \-tt output
38.\"
39.SH SYNOPSIS
40.SY strace\-log\-merge
41.IR STRACE_LOG
42.YS
43.SY strace\-log\-merge
44.OR \-\-help
45.YS
46.\"
47.SH DESCRIPTION
48.B strace\-log\-merge
49merges the output of
50.B strace \-ff \-tt[t]
51command, prepending PID to each line and sorting the result using time stamp as
52a key.
53.\"
54.SH OPTIONS
55.\"
56.TP
57.B \-\-help
58Show program usage and exit.
59.TP
60.I STRACE_LOG
61Output file name prefix of files produced by a
62.B strace -ff -tt[t]
63command.
64.SH EXIT STATUS
65.TP
66.B 0
67Success
68.TP
69.B Non-zero
70Error occurred: either no argument specified (in that case a usage is printed),
71or something went wrong during the processing of
72.IR STRACE_LOG ".*"
73files.
74.\"
75.SH USAGE EXAMPLE
76.sp
77.nf
78.ft CW
79$ strace -o sleepy -ff -tt -e trace=execve,nanosleep \\
80 sh -c 'sleep 0.1 & sleep 0.2 & sleep 0.3'
81$ strace-log-merge sleepy | fold -w 72 -s
8213475 21:13:52.040837 execve("/bin/sh", ["sh", "-c", "sleep 0.1 & sleep
830.2 & sleep 0."...], 0x7ffde54b2450 /* 33 vars */) = 0
8413478 21:13:52.044050 execve("/bin/sleep", ["sleep", "0.3"],
850x5631be4f87a8 /* 33 vars */) = 0
8613476 21:13:52.044269 execve("/bin/sleep", ["sleep", "0.1"],
870x5631be4f87a8 /* 33 vars */) = 0
8813477 21:13:52.044389 execve("/bin/sleep", ["sleep", "0.2"],
890x5631be4f87a8 /* 33 vars */) = 0
9013478 21:13:52.046207 nanosleep({tv_sec=0, tv_nsec=300000000}, NULL) = 0
9113476 21:13:52.046303 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0
9213477 21:13:52.046318 nanosleep({tv_sec=0, tv_nsec=200000000}, NULL) = 0
9313476 21:13:52.146852 +++ exited with 0 +++
9413475 21:13:52.146942 --- SIGCHLD {si_signo=SIGCHLD,
95si_code=CLD_EXITED, si_pid=13476, si_uid=1000, si_status=0, si_utime=0,
96si_stime=0} ---
9713477 21:13:52.247782 +++ exited with 0 +++
9813475 21:13:52.247885 --- SIGCHLD {si_signo=SIGCHLD,
99si_code=CLD_EXITED, si_pid=13477, si_uid=1000, si_status=0, si_utime=0,
100si_stime=0} ---
10113478 21:13:52.347680 +++ exited with 0 +++
10213475 21:13:52.347786 --- SIGCHLD {si_signo=SIGCHLD,
103si_code=CLD_EXITED, si_pid=13478, si_uid=1000, si_status=0, si_utime=0,
104si_stime=0} ---
10513475 21:13:52.348069 +++ exited with 0 +++
106.ft R
107.fi
108.sp
109.\"
110.SH NOTES
111.I strace-log-merge
112does not work well with
113.B strace
114logs generated by
115.B strace -tt
116invocation that pass midnight, as those lack the information required
117for the proper sorting.
118Employing the
119.B -ttt
120option in the respective
121.B strace
122invocation should solve the problem.
123.\"
124.SH BUGS
125.I strace-log-merge
126does not perform any checks whether the files specified are in the correct
127format and implies that only files from a single
128.I strace
129session match
130.IR STRACE_LOG ".*"
131glob pattern.
132.\"
133.SH HISTORY
134The initial version of
135.I strace-log-merge
136was written by Denys Vlasenko in 2012.
137.\"
138.SH REPORTING BUGS
139Problems with
140.B strace-log-merge
141should be reported to the
142.B strace
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700143mailing list at <strace\-devel@lists.strace.io>.
Elliott Hughesb7556142018-02-20 17:03:16 -0800144.\"
145.SH "SEE ALSO"
146.BR strace (1)