Fixed
El lun., 28 oct. 2019 a las 23:54, Samuel Thibault (<[email protected]>)
escribió:
> Almudena Garcia, le lun. 28 oct. 2019 20:16:33 +0100, a ecrit:
> > + /* if the structure read doesn't include last_processor field,
> set It to 0 */
> > + if(thcount >= THREAD_SCHED_INFO_COUNT){
> > + thds[i]->last_processor = 0;
> > + }
>
> That'd rather be if(thcount < THREAD_SCHED_INFO_COUNT), and better make
> it akin to other additions: if (thcount < 8).
>
> Samuel
>
--- hurd/procfs/process.c 2019-10-26 23:12:40.495359917 +0200
+++ hurd~/procfs/process.c 2019-10-28 19:41:14.751636209 +0100
@@ -221,6 +221,7 @@
struct procinfo *pi = proc_stat_proc_info (ps);
task_basic_info_t tbi = proc_stat_task_basic_info (ps);
thread_basic_info_t thbi = proc_stat_thread_basic_info (ps);
+ thread_sched_info_t thsi = proc_stat_thread_sched_info (ps);
const char *fn = args_filename (proc_stat_args (ps));
vm_address_t start_code = 1; /* 0 would make killall5.c consider it
@@ -286,7 +288,7 @@
(long unsigned) proc_stat_thread_rpc (ps), /* close enough */
0L, 0L,
0,
- 0,
+ (long unsigned) thsi->last_processor,
0, 0,
0LL);
}
--- hurd/proc/info.c 2019-10-26 23:12:40.495359917 +0200
+++ hurd~/proc/info.c 2019-10-29 00:03:01.636383192 +0100
@@ -713,6 +713,12 @@
*flags &= ~PI_FETCH_THREAD_SCHED;
err = 0;
}
+
+ /* if the structure read doesn't include last_processor field, set It to 0 */
+ if(thcount < 8){
+ thds[i]->last_processor = 0;
+ }
+
}
/* Note that there are thread wait entries only for those threads