[02/10] Revert "stats: add a helper to get stats of parent pre-dump"

Submitted by Pavel Tikhomirov on April 3, 2018, 9:34 a.m.

Details

Message ID 20180403093426.10894-3-ptikhomirov@virtuozzo.com
State Accepted
Series "don't use wrong pagemap (from other task) on pid reuse"
Commit 7ca133f5b358814c44dec81f1c5c2e8d124ff483
Headers show

Commit Message

Pavel Tikhomirov April 3, 2018, 9:34 a.m.
This reverts commit 4a43486e24cf543ed2c0320552087f506c51635f.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 criu/include/stats.h |  4 ----
 criu/stats.c         | 31 -------------------------------
 2 files changed, 35 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/include/stats.h b/criu/include/stats.h
index 14acdd59f..81775c856 100644
--- a/criu/include/stats.h
+++ b/criu/include/stats.h
@@ -1,8 +1,6 @@ 
 #ifndef __CR_STATS_H__
 #define __CR_STATS_H__
 
-#include "images/stats.pb-c.h"
-
 enum {
 	TIME_FREEZING,
 	TIME_FROZEN,
@@ -25,8 +23,6 @@  extern void timing_start(int t);
 extern void timing_stop(int t);
 extern int timing_uptime(int t);
 
-extern StatsEntry *get_parent_stats(void);
-
 enum {
 	CNT_PAGES_SCANNED,
 	CNT_PAGES_SKIPPED_PARENT,
diff --git a/criu/stats.c b/criu/stats.c
index 2c880102c..2944474cd 100644
--- a/criu/stats.c
+++ b/criu/stats.c
@@ -213,37 +213,6 @@  void write_stats(int what)
 		display_stats(what, &stats);
 }
 
-__maybe_unused StatsEntry *get_parent_stats(void)
-{
-	struct cr_img *img;
-	StatsEntry *se;
-	int dir;
-
-	dir = openat(get_service_fd(IMG_FD_OFF), CR_PARENT_LINK, O_RDONLY);
-	if (dir == -1) {
-		pr_warn("Failed to open parent directory");
-		return NULL;
-	}
-
-	img = open_image_at(dir, CR_FD_STATS, O_RSTR, "dump");
-	if (!img) {
-		pr_warn("Failed to open parent dump stats");
-		close(dir);
-		return NULL;
-	}
-
-	if (pb_read_one(img, &se, PB_STATS) < 0) {
-		pr_warn("Failed to read parent dump stats");
-		close_image(img);
-		close(dir);
-		return NULL;
-	}
-
-	close_image(img);
-	close(dir);
-	return se;
-}
-
 int init_stats(int what)
 {
 	if (what == DUMP_STATS) {