[CRIU] [PATCH 06/12]v2 deduplication: add dedup comand to criu

Tikhomirov Pavel snorcht at gmail.com
Mon Dec 16 02:55:30 PST 2013


Signed-off-by: Tikhomirov Pavel <snorcht at gmail.com>
---
 Makefile.crtools  |    1 +
 cr-dedup.c        |    8 ++++++++
 crtools.c         |    5 +++++
 include/crtools.h |    1 +
 4 files changed, 15 insertions(+)
 create mode 100644 cr-dedup.c

diff --git a/Makefile.crtools b/Makefile.crtools
index 71e9d1c..befdc25 100644
--- a/Makefile.crtools
+++ b/Makefile.crtools
@@ -12,6 +12,7 @@ obj-y	+= proc_parse.o
 obj-y	+= cr-dump.o
 obj-y	+= cr-show.o
 obj-y	+= cr-check.o
+obj-y	+= cr-dedup.o
 obj-y	+= util.o
 obj-y	+= sysctl.o
 obj-y	+= ptrace.o
diff --git a/cr-dedup.c b/cr-dedup.c
new file mode 100644
index 0000000..225ab2d
--- /dev/null
+++ b/cr-dedup.c
@@ -0,0 +1,8 @@
+#include <unistd.h>
+
+#include "crtools.h"
+
+int cr_dedup(void)
+{
+	return 0;
+}
diff --git a/crtools.c b/crtools.c
index ab885e6..1076a46 100644
--- a/crtools.c
+++ b/crtools.c
@@ -359,6 +359,9 @@ int main(int argc, char *argv[])
 	if (!strcmp(argv[optind], "service"))
 		return cr_service(opts.restore_detach);
 
+	if (!strcmp(argv[optind], "dedup"))
+		return cr_dedup();
+
 	pr_msg("Unknown command \"%s\"\n", argv[optind]);
 usage:
 	pr_msg("\n"
@@ -370,6 +373,7 @@ usage:
 "  criu exec -p PID <syscall-string>\n"
 "  criu page-server\n"
 "  criu service [<options>]\n"
+"  criu dedup\n"
 "\n"
 "Commands:\n"
 "  dump           checkpoint a process/tree identified by pid\n"
@@ -380,6 +384,7 @@ usage:
 "  exec           execute a system call by other task\n"
 "  page-server    launch page server\n"
 "  service        launch service\n"
+"  dedup          remove dublicates in memory dump\n"
 	);
 
 	if (argc < 2) {
diff --git a/include/crtools.h b/include/crtools.h
index 7c08fd6..06dd9c2 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -22,6 +22,7 @@ extern int cr_show(int pid);
 extern int convert_to_elf(char *elf_path, int fd_core);
 extern int cr_check(void);
 extern int cr_exec(int pid, char **opts);
+extern int cr_dedup(void);
 
 extern void restrict_uid(unsigned int uid, unsigned int gid);
 struct proc_status_creds;
-- 
1.7.9.5



More information about the CRIU mailing list