aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-06-25 23:22:40 +0200
committerMattias Andrée <maandree@kth.se>2023-06-25 23:22:40 +0200
commitfd6bd9d9090213d4644fc0a96f06fb34ce5365fc (patch)
treee2d5facad8bb34b84596ee07999fe588dd0c42fc /common.h
parentAdd more test cases (diff)
downloadsctrace-fd6bd9d9090213d4644fc0a96f06fb34ce5365fc.tar.gz
sctrace-fd6bd9d9090213d4644fc0a96f06fb34ce5365fc.tar.bz2
sctrace-fd6bd9d9090213d4644fc0a96f06fb34ce5365fc.tar.xz
Some code improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--common.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/common.h b/common.h
index 3f899fe..99497f9 100644
--- a/common.h
+++ b/common.h
@@ -1,6 +1,8 @@
/* See LICENSE file for copyright and license details. */
#include <asm/unistd.h>
+#include <sys/prctl.h>
#include <sys/uio.h>
+#include <asm/unistd.h>
#include <sys/wait.h>
#include <ctype.h>
#include <errno.h>
@@ -65,15 +67,9 @@ enum type {
};
enum state {
- Normal,
- Syscall,
- CloneChild,
- ForkChild,
- VforkChild,
- CloneParent,
- ForkParent,
- VforkParent,
- Exec
+ UserSpace,
+ KernelSpace,
+ Zombie
};
struct output {
@@ -89,7 +85,7 @@ struct process {
struct process *next;
struct process *prev;
enum state state;
- int silent_until_execed; /* 2 until exec, 1 until "= 0", 0 afterwards */
+ int ignore_until_execed; /* 2 until exec, 1 until "= 0", 0 afterwards */
/* Syscall data */
unsigned long long int scall;
@@ -131,7 +127,7 @@ void print_systemcall_exit(struct process *proc);
/* process.c */
void init_process_list(void);
struct process *find_process(pid_t pid);
-struct process *add_process(pid_t pid, unsigned long int trace_options);
+struct process *add_process(pid_t pid, pid_t leader, unsigned long int trace_options);
void remove_process(struct process *proc);
/* util.c */