> That comes directly from the count it passes.
--- gnumach/kern/thread.c 2019-09-03 01:22:10.932747830 +0200 +++ GNUMach_SMP/kern/thread.c 2019-10-27 19:00:17.577010318 +0100 @@ -1530,6 +1530,16 @@ read_time_stamp(&thread->creation_time, &basic_info->creation_time); + #if THREAD_BASIC_INFO_COUNT > 10 + + #if NCPUS > 1 + basic_info->last_processor = thread->last_processor; + #else + basic_info->last_processor = 0; + #endif + + #endif + > That's inconvenient so ideally it should be fixed in procfs by checking that the *thread_info_count count includes the last_processor field, and if > not set it to 0. Attached new patch El dom., 27 oct. 2019 a las 18:24, Samuel Thibault (<samuel.thiba...@gnu.org>) escribió: > Almudena Garcia, le dim. 27 oct. 2019 18:18:46 +0100, a ecrit: > > > Think about an old program built with the old header, running with > > > the new GNU Mach. > > > > Ok, then I have to detect if the program is using the old header or the > new > > header. > > That comes directly from the count it passes. > > > > That's inconvenient so ideally it should be fixed in procfs by > checking that > > the *thread_info_count count includes the last_processor field, and if > > > not set it to 0. > > > > This must be patched in Hurd, improving my previous patch. > > Yes, that's the other side of backward compatiblity. > > Samuel >
--- gnumach/kern/thread.c 2019-09-03 01:22:10.932747830 +0200 +++ GNUMach_SMP/kern/thread.c 2019-10-27 19:00:17.577010318 +0100 @@ -1530,6 +1530,16 @@ read_time_stamp(&thread->creation_time, &basic_info->creation_time); + #if THREAD_BASIC_INFO_COUNT > 10 + + #if NCPUS > 1 + basic_info->last_processor = thread->last_processor; + #else + basic_info->last_processor = 0; + #endif + + #endif + /* * To calculate cpu_usage, first correct for timer rate, * then for 5/8 ageing. The correction factor [3/5] is
--- hurd/procfs/process.c 2019-10-26 23:12:40.495359917 +0200 +++ hurd~/procfs/process.c 2019-10-27 19:06:33.648773329 +0100 @@ -286,7 +286,11 @@ (long unsigned) proc_stat_thread_rpc (ps), /* close enough */ 0L, 0L, 0, + #if THREAD_BASIC_INFO_COUNT > 10 + (long unsigned) thbi->last_processor, + #else 0, + #endif 0, 0, 0LL); }