[CRIU] [PATCH 78/78] compel: Move in parasite engine

Cyrill Gorcunov gorcunov at openvz.org
Mon Nov 7 08:37:03 PST 2016


This is the final patch in the series. It does a bunch
of renames and fixes headers respectively.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 compel/Makefile                                           |  5 +++++
 .../src/lib/include/{ptrace.h => uapi/asm/breakpoints.h}  |  4 ++--
 .../arch/aarch64/src/lib/include/uapi}/asm/infect-types.h |  2 --
 .../arch/aarch64 => compel/arch/aarch64/src/lib}/infect.c |  8 +++-----
 .../src/lib/include/{ptrace.h => uapi/asm/breakpoints.h}  |  4 ++--
 .../arch/arm/src/lib/include/uapi}/asm/infect-types.h     |  2 --
 compel/arch/arm/src/lib/include/uapi/asm/sigframe.h       |  2 ++
 {criu/arch/arm => compel/arch/arm/src/lib}/infect.c       |  8 +++-----
 .../src/lib/include/{ptrace.h => uapi/asm/breakpoints.h}  |  4 ++--
 .../arch/ppc64/src/lib/include/uapi}/asm/infect-types.h   |  0
 {criu/arch/ppc64 => compel/arch/ppc64/src/lib}/infect.c   | 12 ++++++------
 .../src/lib/include/{ptrace.h => uapi/asm/breakpoints.h}  |  4 ++--
 .../arch/x86/src/lib/include/uapi}/asm/infect-types.h     |  0
 {criu/arch/x86 => compel/arch/x86/src/lib}/infect.c       |  7 ++++---
 {criu => compel}/include/infect-priv.h                    |  0
 {criu => compel}/include/rpc-pie-priv.h                   |  0
 compel/include/uapi/compel.h                              |  6 ++++++
 {criu/include => compel/include/uapi}/infect-rpc.h        |  0
 {criu/include => compel/include/uapi}/infect-util.h       |  0
 {criu/include => compel/include/uapi}/infect.h            |  7 ++++++-
 {criu/include => compel/include/uapi}/ptrace.h            |  9 +++++----
 {criu => compel/src/lib}/infect-rpc.c                     |  0
 {criu => compel/src/lib}/infect-util.c                    |  4 ++--
 {criu => compel/src/lib}/infect.c                         | 15 ++++++++-------
 {criu => compel/src/lib}/ptrace.c                         | 12 +++++-------
 criu/Makefile.crtools                                     |  4 ----
 criu/aio.c                                                |  3 +--
 criu/arch/aarch64/Makefile                                |  1 -
 criu/arch/aarch64/crtools.c                               |  6 +++---
 criu/arch/aarch64/sigframe.c                              |  2 +-
 criu/arch/arm/Makefile                                    |  1 -
 criu/arch/arm/crtools.c                                   |  8 ++++----
 criu/arch/arm/sigframe.c                                  |  2 +-
 criu/arch/ppc64/Makefile                                  |  1 -
 criu/arch/ppc64/crtools.c                                 |  4 ++--
 criu/arch/ppc64/include/asm/restorer.h                    |  2 +-
 criu/arch/x86/Makefile                                    |  1 -
 criu/arch/x86/crtools.c                                   |  4 ++--
 criu/arch/x86/sys-exec-tbl.c                              |  2 +-
 criu/cr-check.c                                           |  2 +-
 criu/cr-dump.c                                            |  1 -
 criu/cr-exec.c                                            |  3 +--
 criu/cr-restore.c                                         |  6 ++----
 criu/include/proc_parse.h                                 |  2 +-
 criu/include/ptrace-compat.h                              |  8 +++++---
 criu/include/types.h                                      |  2 +-
 criu/mem.c                                                |  4 +---
 criu/parasite-syscall.c                                   |  4 +++-
 criu/pie/infect.c                                         |  2 +-
 criu/pie/parasite.c                                       |  2 --
 criu/seccomp.c                                            |  2 +-
 criu/seize.c                                              |  4 ++--
 criu/vdso.c                                               |  3 +--
 53 files changed, 99 insertions(+), 102 deletions(-)
 rename compel/arch/aarch64/src/lib/include/{ptrace.h => uapi/asm/breakpoints.h} (74%)
 rename {criu/arch/aarch64/include => compel/arch/aarch64/src/lib/include/uapi}/asm/infect-types.h (98%)
 rename {criu/arch/aarch64 => compel/arch/aarch64/src/lib}/infect.c (94%)
 rename compel/arch/arm/src/lib/include/{ptrace.h => uapi/asm/breakpoints.h} (74%)
 rename {criu/arch/arm/include => compel/arch/arm/src/lib/include/uapi}/asm/infect-types.h (99%)
 rename {criu/arch/arm => compel/arch/arm/src/lib}/infect.c (94%)
 rename compel/arch/ppc64/src/lib/include/{ptrace.h => uapi/asm/breakpoints.h} (75%)
 rename {criu/arch/ppc64/include => compel/arch/ppc64/src/lib/include/uapi}/asm/infect-types.h (100%)
 rename {criu/arch/ppc64 => compel/arch/ppc64/src/lib}/infect.c (98%)
 rename compel/arch/x86/src/lib/include/{ptrace.h => uapi/asm/breakpoints.h} (68%)
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/uapi}/asm/infect-types.h (100%)
 rename {criu/arch/x86 => compel/arch/x86/src/lib}/infect.c (98%)
 rename {criu => compel}/include/infect-priv.h (100%)
 rename {criu => compel}/include/rpc-pie-priv.h (100%)
 rename {criu/include => compel/include/uapi}/infect-rpc.h (100%)
 rename {criu/include => compel/include/uapi}/infect-util.h (100%)
 rename {criu/include => compel/include/uapi}/infect.h (97%)
 rename {criu/include => compel/include/uapi}/ptrace.h (91%)
 rename {criu => compel/src/lib}/infect-rpc.c (100%)
 rename {criu => compel/src/lib}/infect-util.c (87%)
 rename {criu => compel/src/lib}/infect.c (99%)
 rename {criu => compel/src/lib}/ptrace.c (93%)

diff --git a/compel/Makefile b/compel/Makefile
index d421bc07891a..ad98e9d6d75f 100644
--- a/compel/Makefile
+++ b/compel/Makefile
@@ -23,6 +23,11 @@ lib-y			+= src/lib/log.o
 host-lib-y		+= src/lib/log.o
 
 lib-y			+= arch/$(ARCH)/src/lib/cpu.o
+lib-y			+= arch/$(ARCH)/src/lib/infect.o
+lib-y			+= src/lib/infect-rpc.o
+lib-y			+= src/lib/infect-util.o
+lib-y			+= src/lib/infect.o
+lib-y			+= src/lib/ptrace.o
 
 ifeq ($(ARCH),x86)
 lib-y			+= src/lib/handle-elf-32.o
diff --git a/compel/arch/aarch64/src/lib/include/ptrace.h b/compel/arch/aarch64/src/lib/include/uapi/asm/breakpoints.h
similarity index 74%
rename from compel/arch/aarch64/src/lib/include/ptrace.h
rename to compel/arch/aarch64/src/lib/include/uapi/asm/breakpoints.h
index e18454df24bb..5f090490d999 100644
--- a/compel/arch/aarch64/src/lib/include/ptrace.h
+++ b/compel/arch/aarch64/src/lib/include/uapi/asm/breakpoints.h
@@ -1,5 +1,5 @@
-#ifndef __COMPEL_PTRACE_H__
-#define __COMPEL_PTRACE_H__
+#ifndef __COMPEL_BREAKPOINTS_H__
+#define __COMPEL_BREAKPOINTS_H__
 #define ARCH_SI_TRAP TRAP_BRKPT
 
 static inline int ptrace_set_breakpoint(pid_t pid, void *addr)
diff --git a/criu/arch/aarch64/include/asm/infect-types.h b/compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h
similarity index 98%
rename from criu/arch/aarch64/include/asm/infect-types.h
rename to compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h
index 20c47b34edaf..7bc195b14d92 100644
--- a/criu/arch/aarch64/include/asm/infect-types.h
+++ b/compel/arch/aarch64/src/lib/include/uapi/asm/infect-types.h
@@ -7,8 +7,6 @@
 #include <asm/ptrace.h>
 #include "common/page.h"
 
-#include "page.h"
-
 #define SIGMAX			64
 #define SIGMAX_OLD		31
 
diff --git a/criu/arch/aarch64/infect.c b/compel/arch/aarch64/src/lib/infect.c
similarity index 94%
rename from criu/arch/aarch64/infect.c
rename to compel/arch/aarch64/src/lib/infect.c
index aeb73478179e..fceea2816bf4 100644
--- a/criu/arch/aarch64/infect.c
+++ b/compel/arch/aarch64/src/lib/infect.c
@@ -2,12 +2,10 @@
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <linux/elf.h>
-#include "asm/parasite-syscall.h"
 #include <compel/plugins/std/syscall-codes.h>
-#include "asm/types.h"
-#include "criu-log.h"
-#include "parasite-syscall.h"
-#include "compel/include/errno.h"
+#include "uapi/compel/asm/infect-types.h"
+#include "log.h"
+#include "errno.h"
 #include "infect.h"
 #include "infect-priv.h"
 
diff --git a/compel/arch/arm/src/lib/include/ptrace.h b/compel/arch/arm/src/lib/include/uapi/asm/breakpoints.h
similarity index 74%
rename from compel/arch/arm/src/lib/include/ptrace.h
rename to compel/arch/arm/src/lib/include/uapi/asm/breakpoints.h
index e18454df24bb..5f090490d999 100644
--- a/compel/arch/arm/src/lib/include/ptrace.h
+++ b/compel/arch/arm/src/lib/include/uapi/asm/breakpoints.h
@@ -1,5 +1,5 @@
-#ifndef __COMPEL_PTRACE_H__
-#define __COMPEL_PTRACE_H__
+#ifndef __COMPEL_BREAKPOINTS_H__
+#define __COMPEL_BREAKPOINTS_H__
 #define ARCH_SI_TRAP TRAP_BRKPT
 
 static inline int ptrace_set_breakpoint(pid_t pid, void *addr)
diff --git a/criu/arch/arm/include/asm/infect-types.h b/compel/arch/arm/src/lib/include/uapi/asm/infect-types.h
similarity index 99%
rename from criu/arch/arm/include/asm/infect-types.h
rename to compel/arch/arm/src/lib/include/uapi/asm/infect-types.h
index 944236d14989..1df9f6836069 100644
--- a/criu/arch/arm/include/asm/infect-types.h
+++ b/compel/arch/arm/src/lib/include/uapi/asm/infect-types.h
@@ -5,8 +5,6 @@
 #include <sys/mman.h>
 #include "common/page.h"
 
-#include "page.h"
-
 #define SIGMAX			64
 #define SIGMAX_OLD		31
 
diff --git a/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h b/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h
index 65ae8a8b97c7..3e7bc01049de 100644
--- a/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h
+++ b/compel/arch/arm/src/lib/include/uapi/asm/sigframe.h
@@ -1,6 +1,8 @@
 #ifndef UAPI_COMPEL_ASM_SIGFRAME_H__
 #define UAPI_COMPEL_ASM_SIGFRAME_H__
 
+#include <compel/asm/infect-types.h>
+
 /* Copied from the Linux kernel header arch/arm/include/asm/sigcontext.h */
 
 struct rt_sigcontext {
diff --git a/criu/arch/arm/infect.c b/compel/arch/arm/src/lib/infect.c
similarity index 94%
rename from criu/arch/arm/infect.c
rename to compel/arch/arm/src/lib/infect.c
index b22e98d9c779..b440ff73622a 100644
--- a/criu/arch/arm/infect.c
+++ b/compel/arch/arm/src/lib/infect.c
@@ -1,12 +1,10 @@
 #include <sys/ptrace.h>
 #include <sys/types.h>
-#include "asm/parasite-syscall.h"
 #include <compel/plugins/std/syscall-codes.h>
 #include <compel/asm/processor-flags.h>
-#include "asm/types.h"
-#include "criu-log.h"
-#include "parasite-syscall.h"
-#include "compel/include/errno.h"
+#include "uapi/compel/asm/infect-types.h"
+#include "log.h"
+#include "errno.h"
 #include "infect.h"
 #include "infect-priv.h"
 
diff --git a/compel/arch/ppc64/src/lib/include/ptrace.h b/compel/arch/ppc64/src/lib/include/uapi/asm/breakpoints.h
similarity index 75%
rename from compel/arch/ppc64/src/lib/include/ptrace.h
rename to compel/arch/ppc64/src/lib/include/uapi/asm/breakpoints.h
index 0274c2675237..1ab89af76273 100644
--- a/compel/arch/ppc64/src/lib/include/ptrace.h
+++ b/compel/arch/ppc64/src/lib/include/uapi/asm/breakpoints.h
@@ -1,5 +1,5 @@
-#ifndef __COMPEL_PTRACE_H__
-#define __COMPEL_PTRACE_H__
+#ifndef __COMPEL_BREAKPOINTS_H__
+#define __COMPEL_BREAKPOINTS_H__
 #define ARCH_SI_TRAP TRAP_BRKPT
 
 static inline int ptrace_set_breakpoint(pid_t pid, void *addr)
diff --git a/criu/arch/ppc64/include/asm/infect-types.h b/compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h
similarity index 100%
rename from criu/arch/ppc64/include/asm/infect-types.h
rename to compel/arch/ppc64/src/lib/include/uapi/asm/infect-types.h
diff --git a/criu/arch/ppc64/infect.c b/compel/arch/ppc64/src/lib/infect.c
similarity index 98%
rename from criu/arch/ppc64/infect.c
rename to compel/arch/ppc64/src/lib/infect.c
index d9a356a5e673..959098b8c61e 100644
--- a/criu/arch/ppc64/infect.c
+++ b/compel/arch/ppc64/src/lib/infect.c
@@ -1,13 +1,13 @@
 #include <sys/ptrace.h>
 #include <sys/types.h>
 #include <sys/uio.h>
+#include <stdint.h>
 #include <errno.h>
 #include <compel/plugins/std/syscall-codes.h>
-#include "asm/types.h"
-#include "ptrace.h"
-#include "parasite-syscall.h"
-#include "compel/include/errno.h"
-#include "criu-log.h"
+#include "uapi/compel/asm/infect-types.h"
+#include "errno.h"
+#include "log.h"
+#include "common/bug.h"
 #include "infect.h"
 #include "infect-priv.h"
 
@@ -22,7 +22,7 @@
 /*
  * Injected syscall instruction
  */
-const u32 code_syscall[] = {
+const uint32_t code_syscall[] = {
 	0x44000002,		/* sc 		*/
 	0x0fe00000		/* twi 31,0,0	*/
 };
diff --git a/compel/arch/x86/src/lib/include/ptrace.h b/compel/arch/x86/src/lib/include/uapi/asm/breakpoints.h
similarity index 68%
rename from compel/arch/x86/src/lib/include/ptrace.h
rename to compel/arch/x86/src/lib/include/uapi/asm/breakpoints.h
index 844ea0efd938..980f25d063d5 100644
--- a/compel/arch/x86/src/lib/include/ptrace.h
+++ b/compel/arch/x86/src/lib/include/uapi/asm/breakpoints.h
@@ -1,5 +1,5 @@
-#ifndef __COMPEL_PTRACE_H__
-#define __COMPEL_PTRACE_H__
+#ifndef __COMPEL_BREAKPOINTS_H__
+#define __COMPEL_BREAKPOINTS_H__
 #define ARCH_SI_TRAP SI_KERNEL
 extern int ptrace_set_breakpoint(pid_t pid, void *addr);
 extern int ptrace_flush_breakpoints(pid_t pid);
diff --git a/criu/arch/x86/include/asm/infect-types.h b/compel/arch/x86/src/lib/include/uapi/asm/infect-types.h
similarity index 100%
rename from criu/arch/x86/include/asm/infect-types.h
rename to compel/arch/x86/src/lib/include/uapi/asm/infect-types.h
diff --git a/criu/arch/x86/infect.c b/compel/arch/x86/src/lib/infect.c
similarity index 98%
rename from criu/arch/x86/infect.c
rename to compel/arch/x86/src/lib/infect.c
index c0e848054904..12af08713bf5 100644
--- a/criu/arch/x86/infect.c
+++ b/compel/arch/x86/src/lib/infect.c
@@ -11,15 +11,16 @@
 
 #include <compel/asm/processor-flags.h>
 #include <compel/cpu.h>
-#include "compel/include/errno.h"
+#include "errno.h"
 #include <compel/plugins/std/syscall-codes.h>
 #include <compel/plugins/std/syscall.h>
-#include "compel/include/asm/ptrace.h"
+#include "asm/ptrace.h"
 #include "common/err.h"
 #include "asm/infect-types.h"
-#include "ptrace.h"
+#include "uapi/compel/ptrace.h"
 #include "infect.h"
 #include "infect-priv.h"
+#include "log.h"
 
 /*
  * Injected syscall instruction
diff --git a/criu/include/infect-priv.h b/compel/include/infect-priv.h
similarity index 100%
rename from criu/include/infect-priv.h
rename to compel/include/infect-priv.h
diff --git a/criu/include/rpc-pie-priv.h b/compel/include/rpc-pie-priv.h
similarity index 100%
rename from criu/include/rpc-pie-priv.h
rename to compel/include/rpc-pie-priv.h
diff --git a/compel/include/uapi/compel.h b/compel/include/uapi/compel.h
index 278a85455d9c..3554c159974b 100644
--- a/compel/include/uapi/compel.h
+++ b/compel/include/uapi/compel.h
@@ -4,6 +4,8 @@
 #include <errno.h>
 #include <stdarg.h>
 
+#include <compel/asm/infect-types.h>
+
 #define COMPEL_TYPE_INT		(1u << 0)
 #define COMPEL_TYPE_LONG	(1u << 1)
 #define COMPEL_TYPE_GOTPCREL	(1u << 2)
@@ -22,4 +24,8 @@ typedef void (*compel_log_fn)(unsigned int lvl, const char *fmt, va_list parms);
 extern void compel_log_init(compel_log_fn log_fn, unsigned int level);
 extern unsigned int compel_log_get_loglevel(void);
 
+#include <compel/infect-util.h>
+#include <compel/infect-rpc.h>
+#include <compel/infect.h>
+
 #endif /* UAPI_COMPEL_H__ */
diff --git a/criu/include/infect-rpc.h b/compel/include/uapi/infect-rpc.h
similarity index 100%
rename from criu/include/infect-rpc.h
rename to compel/include/uapi/infect-rpc.h
diff --git a/criu/include/infect-util.h b/compel/include/uapi/infect-util.h
similarity index 100%
rename from criu/include/infect-util.h
rename to compel/include/uapi/infect-util.h
diff --git a/criu/include/infect.h b/compel/include/uapi/infect.h
similarity index 97%
rename from criu/include/infect.h
rename to compel/include/uapi/infect.h
index 760bdb80dc54..38051f4373d4 100644
--- a/criu/include/infect.h
+++ b/compel/include/uapi/infect.h
@@ -1,10 +1,15 @@
 #ifndef __COMPEL_INFECT_H__
 #define __COMPEL_INFECT_H__
 
-#include "asm/infect-types.h"
+#include <stdbool.h>
+
+#include <compel/asm/sigframe.h>
+#include <compel/asm/infect-types.h>
 #include <compel/ksigset.h>
 #include <compel/compel.h>
 
+#include "common/compiler.h"
+
 #define PARASITE_START_AREA_MIN	(4096)
 
 extern int compel_stop_task(int pid);
diff --git a/criu/include/ptrace.h b/compel/include/uapi/ptrace.h
similarity index 91%
rename from criu/include/ptrace.h
rename to compel/include/uapi/ptrace.h
index e3f3374d500b..2ab9e1c7616c 100644
--- a/criu/include/ptrace.h
+++ b/compel/include/uapi/ptrace.h
@@ -1,10 +1,11 @@
-#ifndef __CR_PTRACE_H__
-#define __CR_PTRACE_H__
+#ifndef UAPI_COMPEL_PTRACE_H__
+#define UAPI_COMPEL_PTRACE_H__
 
 #include <linux/types.h>
 #include <sys/ptrace.h>
 
-#include "types.h"
+#include <compel/asm/infect-types.h>
+#include <compel/asm/breakpoints.h>
 
 /* some constants for ptrace */
 #ifndef PTRACE_SEIZE
@@ -72,4 +73,4 @@ extern int ptrace_swap_area(pid_t pid, void *dst, void *src, long bytes);
 extern int ptrace_get_regs(pid_t pid, user_regs_struct_t *regs);
 extern int ptrace_set_regs(pid_t pid, user_regs_struct_t *regs);
 
-#endif /* __CR_PTRACE_H__ */
+#endif /* UAPI_COMPEL_PTRACE_H__ */
diff --git a/criu/infect-rpc.c b/compel/src/lib/infect-rpc.c
similarity index 100%
rename from criu/infect-rpc.c
rename to compel/src/lib/infect-rpc.c
diff --git a/criu/infect-util.c b/compel/src/lib/infect-util.c
similarity index 87%
rename from criu/infect-util.c
rename to compel/src/lib/infect-util.c
index 275e2ec8181e..99dbee0629d7 100644
--- a/criu/infect-util.c
+++ b/compel/src/lib/infect-util.c
@@ -1,8 +1,8 @@
-#include "int.h"
 #include "log.h"
 #include "common/bug.h"
 #include "common/lock.h"
-#include "util-pie.h"
+
+#include "uapi/compel/plugins/plugin-fds.h"
 
 #include "infect-rpc.h"
 #include "infect-util.h"
diff --git a/criu/infect.c b/compel/src/lib/infect.c
similarity index 99%
rename from criu/infect.c
rename to compel/src/lib/infect.c
index e27df9afe04a..d9fd05239b38 100644
--- a/criu/infect.c
+++ b/compel/src/lib/infect.c
@@ -9,19 +9,20 @@
 #include <fcntl.h>
 #include <linux/seccomp.h>
 
-#include "criu-log.h"
+#include "log.h"
 #include "common/bug.h"
 #include "common/xmalloc.h"
 #include "common/lock.h"
+#include "common/page.h"
 
 #include <compel/plugins/std/syscall-codes.h>
 #include <compel/plugins/std/asm/syscall-types.h>
-#include "compel/include/asm/ptrace.h"
-#include "compel/include/asm/syscall.h"
+#include "asm/ptrace.h"
+#include "uapi/compel/plugins/std/syscall.h"
 #include "asm/infect-types.h"
 #include "asm/sigframe.h"
 #include "infect.h"
-#include "ptrace.h"
+#include "uapi/compel/ptrace.h"
 #include "infect-rpc.h"
 #include "infect-priv.h"
 #include "infect-util.h"
@@ -495,7 +496,7 @@ int compel_execute_syscall(struct parasite_ctl *ctl,
 {
 	pid_t pid = ctl->rpid;
 	int err;
-	u8 code_orig[BUILTIN_SYSCALL_SIZE];
+	uint8_t code_orig[BUILTIN_SYSCALL_SIZE];
 
 	/*
 	 * Inject syscall instruction and remember original code,
@@ -549,7 +550,7 @@ static int parasite_init_daemon(struct parasite_ctl *ctl)
 	args = compel_parasite_args(ctl, struct parasite_init_args);
 
 	args->sigframe = (uintptr_t)ctl->rsigframe;
-	args->log_level = log_get_loglevel();
+	args->log_level = compel_log_get_loglevel();
 
 	futex_set(&args->daemon_connected, 0);
 
@@ -653,7 +654,7 @@ static int parasite_mmap_exchange(struct parasite_ctl *ctl, unsigned long size)
 static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size)
 {
 	void *where = (void *)ctl->ictx.syscall_ip + BUILTIN_SYSCALL_SIZE;
-	u8 orig_code[MEMFD_FNAME_SZ] = MEMFD_FNAME;
+	uint8_t orig_code[MEMFD_FNAME_SZ] = MEMFD_FNAME;
 	pid_t pid = ctl->rpid;
 	unsigned long sret = -ENOSYS;
 	int ret, fd, lfd;
diff --git a/criu/ptrace.c b/compel/src/lib/ptrace.c
similarity index 93%
rename from criu/ptrace.c
rename to compel/src/lib/ptrace.c
index 8b9e166ec9a8..c2991b5d897b 100644
--- a/criu/ptrace.c
+++ b/compel/src/lib/ptrace.c
@@ -15,14 +15,12 @@
 #include <sys/resource.h>
 #include <sys/wait.h>
 
-#include "int.h"
 #include "common/compiler.h"
-#include "util.h"
-#include "ptrace.h"
-#include "pid.h"
-#include "proc_parse.h"
-#include "seccomp.h"
-#include "cr_options.h"
+
+#include "uapi/compel/asm/infect-types.h"
+#include "uapi/compel/ptrace.h"
+
+#include "log.h"
 
 int suspend_seccomp(pid_t pid)
 {
diff --git a/criu/Makefile.crtools b/criu/Makefile.crtools
index ab4735611454..b33728ca82e0 100644
--- a/criu/Makefile.crtools
+++ b/criu/Makefile.crtools
@@ -2,9 +2,6 @@ ccflags-y		+= -iquote criu/$(ARCH)
 ccflags-y		+= -I compel/include/uapi
 ccflags-y		+= -I compel/plugins/include/uapi
 
-obj-y			+= infect.o
-obj-y			+= infect-rpc.o
-obj-y			+= infect-util.o
 obj-y			+= action-scripts.o
 obj-y			+= external.o
 obj-y			+= aio.o
@@ -58,7 +55,6 @@ obj-y			+= proc_parse.o
 obj-y			+= protobuf-desc.o
 obj-y			+= protobuf.o
 obj-y			+= pstree.o
-obj-y			+= ptrace.o
 obj-y			+= rbtree.o
 obj-y			+= rst-malloc.o
 obj-y			+= seccomp.o
diff --git a/criu/aio.c b/criu/aio.c
index 011a1afcf135..27c251df587d 100644
--- a/criu/aio.c
+++ b/criu/aio.c
@@ -11,8 +11,7 @@
 #include "parasite.h"
 #include "parasite-syscall.h"
 #include "images/mm.pb-c.h"
-#include "infect.h"
-#include "infect-rpc.h"
+#include <compel/compel.h>
 
 #define NR_IOEVENTS_IN_NPAGES(npages) ((PAGE_SIZE * npages - sizeof(struct aio_ring)) / sizeof(struct io_event))
 
diff --git a/criu/arch/aarch64/Makefile b/criu/arch/aarch64/Makefile
index 2a718f5f0468..7632e59100a0 100644
--- a/criu/arch/aarch64/Makefile
+++ b/criu/arch/aarch64/Makefile
@@ -9,4 +9,3 @@ ccflags-y		+= -I compel/plugins/include/uapi
 obj-y			+= cpu.o
 obj-y			+= crtools.o
 obj-y			+= sigframe.o
-obj-y			+= infect.o
diff --git a/criu/arch/aarch64/crtools.c b/criu/arch/aarch64/crtools.c
index d3cbc7e6f53f..f98743a23be9 100644
--- a/criu/arch/aarch64/crtools.c
+++ b/criu/arch/aarch64/crtools.c
@@ -6,10 +6,10 @@
 #include "types.h"
 #include <compel/asm/processor-flags.h>
 
-#include "asm/infect-types.h"
+#include <compel/asm/infect-types.h>
 #include "asm/restorer.h"
 #include "common/compiler.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "asm/dump.h"
 #include "protobuf.h"
 #include "images/core.pb-c.h"
@@ -19,7 +19,7 @@
 #include "util.h"
 #include "cpu.h"
 #include "restorer.h"
-#include "infect.h"
+#include <compel/compel.h>
 
 #define assign_reg(dst, src, e)		dst->e = (__typeof__(dst->e))(src)->e
 
diff --git a/criu/arch/aarch64/sigframe.c b/criu/arch/aarch64/sigframe.c
index e8d99529ae7d..be57c1670c0b 100644
--- a/criu/arch/aarch64/sigframe.c
+++ b/criu/arch/aarch64/sigframe.c
@@ -1,5 +1,5 @@
 #include "asm/types.h"
-#include "asm/infect-types.h"
+#include <compel/asm/infect-types.h>
 #include "asm/sigframe.h"
 
 int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe,
diff --git a/criu/arch/arm/Makefile b/criu/arch/arm/Makefile
index 2e89d67f6946..fb2112141383 100644
--- a/criu/arch/arm/Makefile
+++ b/criu/arch/arm/Makefile
@@ -9,4 +9,3 @@ ccflags-y		+= -I compel/plugins/include/uapi
 obj-y			+= cpu.o
 obj-y			+= crtools.o
 obj-y			+= sigframe.o
-obj-y			+= infect.o
diff --git a/criu/arch/arm/crtools.c b/criu/arch/arm/crtools.c
index aa3860e93f6e..c216cdc5c03e 100644
--- a/criu/arch/arm/crtools.c
+++ b/criu/arch/arm/crtools.c
@@ -4,11 +4,11 @@
 #include "types.h"
 #include <compel/asm/processor-flags.h>
 
-#include "asm/infect-types.h"
+#include <compel/asm/infect-types.h>
 #include "asm/restorer.h"
 #include "common/compiler.h"
 #include "asm/dump.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "protobuf.h"
 #include "images/core.pb-c.h"
 #include "images/creds.pb-c.h"
@@ -18,8 +18,8 @@
 #include "elf.h"
 #include "parasite-syscall.h"
 #include "restorer.h"
-#include "kerndat.h"
-#include "infect.h"
+
+#include <compel/compel.h>
 
 #define assign_reg(dst, src, e)		dst->e = (__typeof__(dst->e))((src)->ARM_##e)
 
diff --git a/criu/arch/arm/sigframe.c b/criu/arch/arm/sigframe.c
index e8d99529ae7d..be57c1670c0b 100644
--- a/criu/arch/arm/sigframe.c
+++ b/criu/arch/arm/sigframe.c
@@ -1,5 +1,5 @@
 #include "asm/types.h"
-#include "asm/infect-types.h"
+#include <compel/asm/infect-types.h>
 #include "asm/sigframe.h"
 
 int sigreturn_prep_fpu_frame(struct rt_sigframe *sigframe,
diff --git a/criu/arch/ppc64/Makefile b/criu/arch/ppc64/Makefile
index cd7c41250a02..12b8ad2e3fbd 100644
--- a/criu/arch/ppc64/Makefile
+++ b/criu/arch/ppc64/Makefile
@@ -8,4 +8,3 @@ ccflags-y		+= -I compel/plugins/include/uapi
 obj-y			+= cpu.o
 obj-y			+= crtools.o
 obj-y			+= sigframe.o
-obj-y			+= infect.o
diff --git a/criu/arch/ppc64/crtools.c b/criu/arch/ppc64/crtools.c
index 3d662542e8bc..074490956b5a 100644
--- a/criu/arch/ppc64/crtools.c
+++ b/criu/arch/ppc64/crtools.c
@@ -12,12 +12,12 @@
 
 #include "cr_options.h"
 #include "common/compiler.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "parasite-syscall.h"
 #include "log.h"
 #include "util.h"
 #include "cpu.h"
-#include "infect.h"
+#include <compel/compel.h>
 
 #include "protobuf.h"
 #include "images/core.pb-c.h"
diff --git a/criu/arch/ppc64/include/asm/restorer.h b/criu/arch/ppc64/include/asm/restorer.h
index 399bdfb52132..c779a1869b5b 100644
--- a/criu/arch/ppc64/include/asm/restorer.h
+++ b/criu/arch/ppc64/include/asm/restorer.h
@@ -5,7 +5,7 @@
 #include <asm/elf.h>
 #include <asm/types.h>
 #include "asm/types.h"
-#include "asm/infect-types.h"
+#include <compel/asm/infect-types.h>
 
 #include <compel/asm/sigframe.h>
 
diff --git a/criu/arch/x86/Makefile b/criu/arch/x86/Makefile
index fcbb6712941b..6744f9a270b9 100644
--- a/criu/arch/x86/Makefile
+++ b/criu/arch/x86/Makefile
@@ -12,7 +12,6 @@ asflags-y		+= -iquote $(obj)/include
 obj-y			+= cpu.o
 obj-y			+= crtools.o
 obj-y			+= sigframe.o
-obj-y			+= infect.o
 ifeq ($(CONFIG_COMPAT),y)
         obj-y		+= sigaction_compat.o
         obj-y		+= call32.o
diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
index a4982f777e1a..9abc1fa5125c 100644
--- a/criu/arch/x86/crtools.c
+++ b/criu/arch/x86/crtools.c
@@ -14,14 +14,14 @@
 #include "cr_options.h"
 #include "common/compiler.h"
 #include "restorer.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "parasite-syscall.h"
 #include "log.h"
 #include "util.h"
 #include "cpu.h"
 #include <compel/plugins/std/syscall-codes.h>
 #include "kerndat.h"
-#include "infect.h"
+#include <compel/compel.h>
 
 #include "protobuf.h"
 #include "images/core.pb-c.h"
diff --git a/criu/arch/x86/sys-exec-tbl.c b/criu/arch/x86/sys-exec-tbl.c
index 1051af06fe46..608dc2510d19 100644
--- a/criu/arch/x86/sys-exec-tbl.c
+++ b/criu/arch/x86/sys-exec-tbl.c
@@ -1,4 +1,4 @@
-#include "infect.h"
+#include <compel/compel.h>
 
 static struct syscall_exec_desc sc_exec_table_64[] = {
 #include "sys-exec-tbl-64.c"
diff --git a/criu/cr-check.c b/criu/cr-check.c
index cffb5611e1c0..9e60312af23e 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -36,7 +36,7 @@
 #include "proc_parse.h"
 #include "mount.h"
 #include "tty.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "ptrace-compat.h"
 #include "kerndat.h"
 #include "timerfd.h"
diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 62dd97eccbc6..35ff3dc358db 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -42,7 +42,6 @@
 #include "cr_options.h"
 #include "servicefd.h"
 #include "string.h"
-#include "ptrace.h"
 #include "ptrace-compat.h"
 #include "util.h"
 #include "namespaces.h"
diff --git a/criu/cr-exec.c b/criu/cr-exec.c
index e7b3f058f1a4..754bb48807ba 100644
--- a/criu/cr-exec.c
+++ b/criu/cr-exec.c
@@ -10,8 +10,7 @@
 #include "log.h"
 #include "util.h"
 #include "kerndat.h"
-#include "infect.h"
-#include "infect-priv.h"
+#include <compel/compel.h>
 
 struct syscall_exec_desc {
 	char *name;
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index a340167c06e0..3a21002c0a18 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -23,10 +23,8 @@
 
 #include <sys/sendfile.h>
 
-#include "compel/include/asm/ptrace.h"
-
 #include "types.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "common/compiler.h"
 
 #include "cr_options.h"
@@ -72,7 +70,7 @@
 #include "file-lock.h"
 #include "action-scripts.h"
 #include "shmem.h"
-#include "infect.h"
+#include <compel/compel.h>
 #include "aio.h"
 #include "lsm.h"
 #include "seccomp.h"
diff --git a/criu/include/proc_parse.h b/criu/include/proc_parse.h
index 04359e247c74..d67ac5e5625c 100644
--- a/criu/include/proc_parse.h
+++ b/criu/include/proc_parse.h
@@ -3,7 +3,7 @@
 
 #include <sys/types.h>
 
-#include "infect.h"
+#include <compel/compel.h>
 #include "images/seccomp.pb-c.h"
 
 #define PROC_TASK_COMM_LEN	32
diff --git a/criu/include/ptrace-compat.h b/criu/include/ptrace-compat.h
index f6cc8b932588..295fb01c66b5 100644
--- a/criu/include/ptrace-compat.h
+++ b/criu/include/ptrace-compat.h
@@ -1,8 +1,10 @@
-#ifndef __CR_PTRACE_ARCH_H__
-#define __CR_PTRACE_ARCH_H__
+#ifndef __CR_PTRACE_H__
+#define __CR_PTRACE_H__
 
 #include <linux/types.h>
 #include <sys/ptrace.h>
+
+#include "types.h"
 #include "config.h"
 
 #ifndef CONFIG_HAS_PTRACE_PEEKSIGINFO
@@ -13,4 +15,4 @@ struct ptrace_peeksiginfo_args {
 };
 #endif
 
-#endif /* __CR_PTRACE_ARCH_H__ */
+#endif /* __CR_PTRACE_H__ */
diff --git a/criu/include/types.h b/criu/include/types.h
index 36f24085aaba..7600f35923bb 100644
--- a/criu/include/types.h
+++ b/criu/include/types.h
@@ -1,5 +1,5 @@
 #ifndef __CR_INC_TYPES_H__
 #define __CR_INC_TYPES_H__
-#include "asm/infect-types.h"
+#include <compel/asm/infect-types.h>
 #include "asm/types.h"
 #endif
diff --git a/criu/mem.c b/criu/mem.c
index 0bf45f3d9d2e..10cc1973e487 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -27,9 +27,7 @@
 #include "files-reg.h"
 #include "pagemap-cache.h"
 #include "fault-injection.h"
-#include "infect.h"
-#include "infect-rpc.h"
-#include "infect-util.h"
+#include <compel/compel.h>
 
 #include "protobuf.h"
 #include "images/pagemap.pb-c.h"
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 0e33428b0900..79b4e9e64815 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -15,7 +15,7 @@
 #include "images/pagemap.pb-c.h"
 
 #include "imgset.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "parasite-syscall.h"
 #include "parasite.h"
 #include "crtools.h"
@@ -46,6 +46,8 @@
 #include "infect-rpc.h"
 #include "parasite-blob.h"
 
+#include <compel/compel.h>
+
 unsigned long get_exec_start(struct vm_area_list *vmas)
 {
 	struct vma_area *vma_area;
diff --git a/criu/pie/infect.c b/criu/pie/infect.c
index d94fdaafc7af..8ba3f897dd53 100644
--- a/criu/pie/infect.c
+++ b/criu/pie/infect.c
@@ -8,7 +8,7 @@
 #include "sigframe.h"
 #include "infect-rpc.h"
 #include "infect-pie.h"
-#include "rpc-pie-priv.h"
+#include "compel/include/rpc-pie-priv.h"
 
 static int tsock = -1;
 
diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index 5f5d13774ed2..faae3775e4bf 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -18,8 +18,6 @@
 #include "criu-log.h"
 #include "tty.h"
 #include "aio.h"
-#include "infect-rpc.h"
-#include "infect-pie.h"
 
 #include "asm/parasite.h"
 #include "restorer.h"
diff --git a/criu/seccomp.c b/criu/seccomp.c
index c569e7c1a036..099997be4259 100644
--- a/criu/seccomp.c
+++ b/criu/seccomp.c
@@ -7,7 +7,7 @@
 #include "imgset.h"
 #include "kcmp.h"
 #include "pstree.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "proc_parse.h"
 #include "restorer.h"
 #include "seccomp.h"
diff --git a/criu/seize.c b/criu/seize.c
index c69f06346f87..76b6e291a0d5 100644
--- a/criu/seize.c
+++ b/criu/seize.c
@@ -15,13 +15,13 @@
 #include "cr-errno.h"
 #include "pstree.h"
 #include "criu-log.h"
-#include "ptrace.h"
+#include <compel/ptrace.h>
 #include "proc_parse.h"
 #include "seize.h"
 #include "stats.h"
 #include "xmalloc.h"
 #include "util.h"
-#include "infect.h"
+#include <compel/compel.h>
 
 #define NR_ATTEMPTS 5
 
diff --git a/criu/vdso.c b/criu/vdso.c
index 4dd045698eb3..9d38bda9d215 100644
--- a/criu/vdso.c
+++ b/criu/vdso.c
@@ -19,8 +19,7 @@
 #include "log.h"
 #include "mem.h"
 #include "vma.h"
-#include "infect.h"
-#include "infect-rpc.h"
+#include <compel/compel.h>
 
 #ifdef LOG_PREFIX
 # undef LOG_PREFIX
-- 
2.7.4



More information about the CRIU mailing list