[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add last processor to process stat
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] Add last processor to process stat |
Date: |
Sun, 27 Oct 2019 19:56:32 +0100 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Almudena Garcia, le dim. 27 oct. 2019 19:44:23 +0100, a ecrit:
> > + #if THREAD_BASIC_INFO_COUNT > 10
>
> That will be always true. What you want to check is *thread_info_count.
>
> --- gnumach/kern/thread.c 2019-09-03 01:22:10.932747830 +0200
> +++ GNUMach_SMP/kern/thread.c 2019-10-27 19:42:15.360761959 +0100
> @@ -1500,11 +1500,11 @@
> if (flavor == THREAD_BASIC_INFO) {
> thread_basic_info_t basic_info;
>
> - /* Allow *thread_info_count to be one smaller than the
> - usual amount, because creation_time is a new member
> - that some callers might not know about. */
> + /* Allow *thread_info_count to be two smaller than the
> + usual amount, because creation_time and last_processor
> + are new members that some callers might not know about. */
>
> - if (*thread_info_count < THREAD_BASIC_INFO_COUNT - 1) {
> + if (*thread_info_count < THREAD_BASIC_INFO_COUNT - 2) {
[...]
> + /* Check if the basic_info includes all new members (including
> last_processor) */
> + if (*thread_info_count == THREAD_BASIC_INFO_COUNT) {
Yes, that's the idea (though you want a >= instead of ==, so that it
will work after adding another field).
That being said I now realize you added the field to the
thread_basic_info_t, while the information really belongs to the
thread_sched_info_t. Please really add it to thread_sched_info_t. You
have access to it from procfs's process_file_gc_stat by adding
thread_basic_info_t thsi = proc_stat_thread_sched_info (ps);
Samuel
- Re: [PATCH] Add last processor to process stat, (continued)
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat,
Samuel Thibault <=
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Almudena Garcia, 2019/10/27
- Re: [PATCH] Add last processor to process stat, Samuel Thibault, 2019/10/27