lkml.org 
[lkml]   [2014]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 14/37] perf tools: Convert dead thread list into rbtree
On Sat, Dec 27, 2014 at 2:14 AM, David Ahern <dsahern@gmail.com> wrote:
> On 12/25/14 7:26 PM, Namhyung Kim wrote:
>>>>
>>>> diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
>>>> index 0b6dcd70bc8b..413f28cf689b 100644
>>>> --- a/tools/perf/util/thread.h
>>>> +++ b/tools/perf/util/thread.h
>>>> @@ -11,10 +11,8 @@
>>>> struct thread_stack;
>>>>
>>>> struct thread {
>>>> - union {
>>>> - struct rb_node rb_node;
>>>> - struct list_head node;
>>>> - };
>>>> + struct rb_node rb_node;
>>>> + struct list_head node;
>>>> struct map_groups *mg;
>>>> pid_t pid_; /* Not all tools update this */
>>>> pid_t tid;
>>>> @@ -22,7 +20,8 @@ struct thread {
>>>> int cpu;
>>>> char shortname[3];
>>>> bool comm_set;
>>>> - bool dead; /* if set thread has exited */
>>>> + bool exited; /* if set thread has exited */
>>>> + bool dead; /* thread is in dead_threads list */
>>>
>>>
>>> looks like this also changes the logic (new exited flag),
>>> not just the dead threads storage wheel
>>
>>
>> AFAICS the 'dead' flag is not used other than thread__exited(). And
>> it confused me a dead thread might not be in a dead_threads tree (or
>> list). So I changed the name and no logical change intended.
>
>
> git show 236a3bbd5cb51

Thanks for the pointer. I understand the need of delaying the move to
dead_threads list, but anyway it still makes me confused. So I
renamed the flag to keep the current behavior and match the name
'dead' to the list/tree management to reduce further confusion.

Thanks,
Namhyung


\
 
 \ /
  Last update: 2014-12-27 07:01    [W:0.073 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site