extern bool qflag;
extern bool not_failing_only;
extern bool show_fd_path;
-extern bool tracing_paths;
+/* are we filtering traces based on paths? */
+extern const char **paths_selected;
+#define tracing_paths (paths_selected != NULL)
extern bool need_fork_exec_workarounds;
extern unsigned xflag;
extern unsigned followfork;
#include "syscall.h"
-static const char **selected = NULL; /* paths selected for tracing */
+const char **paths_selected = NULL;
static unsigned num_selected = 0;
/*
unsigned i;
for (i = 0; i < num_selected; ++i) {
- if (strcmp(path, selected[i]) == 0)
+ if (strcmp(path, paths_selected[i]) == 0)
return 1;
}
return 0;
return; /* already in table */
i = num_selected++;
- selected = realloc(selected, num_selected * sizeof(selected[0]));
- if (!selected)
+ paths_selected = realloc(paths_selected, num_selected * sizeof(paths_selected[0]));
+ if (!paths_selected)
die_out_of_memory();
- selected[i] = path;
+ paths_selected[i] = path;
}
/*
{
const struct_sysent *s;
- if (!selected)
- return 1;
-
s = tcp->s_ent;
if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC)))
/* Show path associated with fd arguments */
bool show_fd_path = 0;
-/* are we filtering traces based on paths? */
-bool tracing_paths = 0;
-
static bool detach_on_execve = 0;
static bool skip_startup_execve = 0;
process_opt_p_list(optarg);
break;
case 'P':
- tracing_paths = 1;
pathtrace_select(optarg);
break;
case 's':