lkml.org 
[lkml]   [2016]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info
From
Date
Hi Jiri,


On Saturday 17 December 2016 11:10 PM, Jiri Olsa wrote:
> On Fri, Dec 16, 2016 at 12:07:20AM +0530, Hari Bathini wrote:
>
> SNIP
>
>> +
>> +int thread__set_namespaces(struct thread *thread, u64 timestamp,
>> + struct namespaces_event *event)
>> +{
>> + struct namespaces *new, *curr = thread__namespaces(thread);
>> +
>> + new = namespaces__new(event);
>> + if (!new)
>> + return -ENOMEM;
>> +
>> + list_add(&new->list, &thread->namespaces_list);
>> +
>> + if (timestamp && curr) {
>> + /*
>> + * setns syscall must have changed few or all the namespaces
>> + * of this thread. Update end time for the namespaces
>> + * previously used.
>> + */
>> + curr = list_next_entry(new, list);
>> + curr->end_time = timestamp;
> hi,
> couldn't you use just the curr you got from thread__namespaces?
> why to retrieve it again via 'new' pointer?
>

Adding the new namespaces info to the list while keeping the old ones
along with the change timestamp to retain the multiple changes made
for the namespaces of each thread.

Thanks
Hari

\
 
 \ /
  Last update: 2016-12-21 14:19    [W:2.314 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site