[CRIU] [PATCH 05/10] deduplication: add dedup comand to criu
Tikhomirov Pavel
snorcht at gmail.com
Tue Nov 19 02:28:24 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 3030ce9..b029188 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 3b2919b..d8e8bcb 100644
--- a/crtools.c
+++ b/crtools.c
@@ -352,6 +352,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"
@@ -363,6 +366,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"
@@ -373,6 +377,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 9b5e909..679fcb0 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -60,6 +60,7 @@ int cr_show(int pid);
int convert_to_elf(char *elf_path, int fd_core);
int cr_check(void);
int cr_exec(int pid, char **opts);
+int cr_dedup(void);
/*
* When we have to restore a shared resource, we mush select which
--
1.7.9.5
More information about the CRIU
mailing list