* Improvements
* Implemented delay injection (-e inject=SET:delay_enter= and
-e inject=SET:delay_exit= options).
+ * Added -A option for opening output files in append mode
+ (addresses Debian bug #528488).
* IPv6 addresses shown in socket information in -yy mode are now printed
in brackets.
* Enhanced decoding of prctl and ptrace syscalls.
strace \- trace system calls and signals
.SH SYNOPSIS
.SY strace
-.OP \-CdffhikqrtttTvVxxy
+.OP \-ACdffhikqrtttTvVxxy
.OP \-I n
.OP \-b execve
.OM \-e expr
The latter is not compatible with
.B \-ff
option currently.
+.TP \-A
+Open the file provided in the
+.B \-o
+option in append mode.
.TP
.B \-q
Suppress messages about attaching, detaching etc. This happens
static const char *outfname;
/* If -ff, points to stderr. Else, it's our common output log */
static FILE *shared_log;
+static bool open_append;
struct tcb *printing_tcp;
static struct tcb *current_tcp;
FILE *fp;
swap_uid();
- fp = fopen_stream(path, "w");
+ fp = fopen_stream(path, open_append ? "a" : "w");
if (!fp)
perror_msg_and_die("Can't fopen '%s'", path);
swap_uid();
#ifdef USE_LIBUNWIND
"k"
#endif
- "a:b:cCdDe:E:fFhiI:o:O:p:P:qrs:S:tTu:vVwxyz")) != EOF) {
+ "a:Ab:cCdDe:E:fFhiI:o:O:p:P:qrs:S:tTu:vVwxyz")) != EOF) {
switch (c) {
case 'a':
acolumn = string_to_uint(optarg);
if (acolumn < 0)
error_opt_arg(c, optarg);
break;
+ case 'A':
+ open_append = true;
+ break;
case 'b':
if (strcmp(optarg, "execve") != 0)
error_msg_and_die("Syscall '%s' for -b isn't supported",