[CRIU] [PATCH 1/8] core: Introduce task_timers_entry

Pavel Emelyanov xemul at parallels.com
Tue Apr 15 10:58:31 PDT 2014


This one will hold all info about timers in the core_entry.
Since timers are always per-task, this one is on task core
entry.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 protobuf/core.proto  | 3 +++
 protobuf/timer.proto | 3 +++
 pstree.c             | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/protobuf/core.proto b/protobuf/core.proto
index 8d16cee..18ac8d4 100644
--- a/protobuf/core.proto
+++ b/protobuf/core.proto
@@ -3,6 +3,7 @@ import "core-arm.proto";
 import "core-aarch64.proto";
 
 import "rlimit.proto";
+import "timer.proto";
 
 message task_core_entry {
 	required uint32			task_state	= 1;
@@ -13,6 +14,8 @@ message task_core_entry {
 	required uint64			blk_sigset	= 5;
 
 	required string			comm		= 6;
+
+	optional task_timers_entry	timers		= 7;
 }
 
 message task_kobj_ids_entry {
diff --git a/protobuf/timer.proto b/protobuf/timer.proto
index d11f7ef..b5852c3 100644
--- a/protobuf/timer.proto
+++ b/protobuf/timer.proto
@@ -18,3 +18,6 @@ message posix_timer_entry {
 	required uint64		vsec		= 9;
 	required uint64		vnsec		= 10;
 }
+
+message task_timers_entry {
+}
diff --git a/pstree.c b/pstree.c
index b35c3c4..33a97a8 100644
--- a/pstree.c
+++ b/pstree.c
@@ -39,6 +39,7 @@ CoreEntry *core_entry_alloc(int th, int tsk)
 			sz += sizeof(TaskRlimitsEntry);
 			sz += RLIM_NLIMITS * sizeof(RlimitEntry *);
 			sz += RLIM_NLIMITS * sizeof(RlimitEntry);
+			sz += sizeof(TaskTimersEntry);
 		}
 	}
 	if (th)
@@ -71,6 +72,9 @@ CoreEntry *core_entry_alloc(int th, int tsk)
 					rls->rlimits[i] = xptr_pull(&m, RlimitEntry);
 					rlimit_entry__init(rls->rlimits[i]);
 				}
+
+				core->tc->timers = xptr_pull(&m, TaskTimersEntry);
+				task_timers_entry__init(core->tc->timers);
 			}
 		}
 
-- 
1.8.4.2


More information about the CRIU mailing list