[CRIU] [PATCH] pstree: Add more debug output for prepare_pstree_kobj_ids

Pavel Emelyanov xemul at parallels.com
Fri Mar 15 05:53:07 EDT 2013


On 03/15/2013 01:48 PM, Cyrill Gorcunov wrote:
> On Fri, Mar 15, 2013 at 01:40:16PM +0400, Pavel Emelyanov wrote:
>> On 03/15/2013 12:51 PM, Cyrill Gorcunov wrote:
>>> Quite useful for debuggin.
>>>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  pstree.c | 15 +++++++++++++++
>>>  1 file changed, 15 insertions(+)
>>>
>>> diff --git a/pstree.c b/pstree.c
>>> index fb0b25b..0cd8fbd 100644
>>> --- a/pstree.c
>>> +++ b/pstree.c
>>> @@ -473,6 +473,17 @@ static unsigned long get_clone_mask(TaskKobjIdsEntry *i,
>>>  	return mask;
>>>  }
>>>  
>>> +static void __show_kobj_ids(char *prefix, TaskKobjIdsEntry *ids)
>>> +{
>>> +	if (!ids)
>>> +		return;
>>> +
>>> +	pr_debug("%s: %x %x %x %x %x %x %x %x %x\n", prefix,
>>> +		ids->vm_id, ids->files_id, ids->fs_id, ids->sighand_id,
>>> +		ids->pid_ns_id, ids->net_ns_id, ids->ipc_ns_id,
>>> +		ids->uts_ns_id, ids->mnt_ns_id);
>>> +}
>>
>> This can be found out by crtoold show -f
> 
> Huh? It's a way more inconvenient, this output shows parent -> child
> ids in a column which is quite convenient for debuggin purpose.

Why not add pr_debug right into the pb_read_one to dump
contents of every single image entry we read? Please, no.

>>
>>> +
>>>  static int prepare_pstree_kobj_ids(void)
>>>  {
>>>  	struct pstree_item *item;
>>> @@ -507,6 +518,9 @@ static int prepare_pstree_kobj_ids(void)
>>>  			}
>>>  		}
>>>  
>>> +		__show_kobj_ids("parent ids", ids);
>>> +		__show_kobj_ids("child  ids", item->ids);
>>> +
>>>  		cflags = get_clone_mask(item->ids, ids);
>>>  
>>>  		if (cflags & CLONE_FILES) {
>>> @@ -546,6 +560,7 @@ set_mask:
>>>  		}
>>>  	}
>>>  
>>> +	pr_debug("NS mask to use %lx\n", current_ns_mask);
>>
>> Missing info for what pid this mask is generated
> 
> This is global variable used as a mask for root task.
> .
> 




More information about the CRIU mailing list