Messages in this thread | | | From | "Tomoki Sekiyama" <> | Subject | RE: [PATCH v2] perf sched: fix wrong conversion of task state | Date | Fri, 29 Jul 2016 13:00:34 +0900 |
| |
Hi Hiramatsu-san,
On 2016/7/28, 2016 8:43, Masami Hiramatsu wrote: > Hmm, this includes several fixes and enhancements. > 1. Use first bit of the state instead of state itself (critical bug to avoid crash?) > 2. Check the range of the array and return '?' if out (minor bug, it can access data area) > 3. Fix TASK_STATE_TO_CHAR_STR to swap X and Z. > 4. Add new 'N+' to TASK_STATE_TO_CHAR_STR. (how about 'n'?) > 5. Treat a preempted task as THREAD_WAIT_CPU. > > so IMHO, it is better to split this patch into atleast 2, #1 and #2 (critical bugfix), > #3, #4, and #5 (minor update).
This time I will fix only the invalid array access and adapting to the current kernel TASK_STATE, and leave the preempted task handling for later follow-up.
[..] >> @@ -897,9 +898,10 @@ static int thread_atoms_insert(struct perf_sched *sched, struct thread *thread) >> + return bit < sizeof(str) - 1 ? str[bit] : '?'; > > You'd better use ARRAY_SIZE(str) instead of sizeof() for array here.
OK, will change this to use ARRAY_SIZE on the next update.
Thanks, Tomoki Sekiyama
| |