These patches add the last processor used by a thread.
The first patch add the field to the *thread_basic_info *structure in
gnumach

The second patch replace the *processor *value (previously hardcoded to 0)
in *stat *structure with the real value stored in *thbi . *This patch must
be applied over Hurd

*These patches isn't tested yet. It's recommended to check and test them
before commit. *
--- gnumach/include/mach/thread_info.h	2019-09-03 01:22:10.920747802 +0200
+++ GNUMach_SMP/include/mach/thread_info.h	2019-10-26 20:37:34.827966396 +0200
@@ -66,6 +66,7 @@
 	integer_t	sleep_time;	/* number of seconds that thread
 					   has been sleeping */
 	time_value_t	creation_time;	/* time stamp of creation */
+	integer_t	last_processor; /* last processor used by the thread */
 };
 
 typedef struct thread_basic_info	thread_basic_info_data_t;
--- hurd/procfs/process.c	2019-10-26 23:12:40.495359917 +0200
+++ hurd~/procfs/process.c	2019-10-26 23:09:51.251138576 +0200
@@ -286,7 +286,7 @@
       (long unsigned) proc_stat_thread_rpc (ps), /* close enough */
       0L, 0L,
       0,
-      0,
+      (long unsigned) thbi->last_processor,
       0, 0,
       0LL);
 }

Reply via email to