[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161217174016.GA722@krava>
Date: Sat, 17 Dec 2016 18:40:16 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Hari Bathini <hbathini@...ux.vnet.ibm.com>
Cc: ast@...com, peterz@...radead.org,
lkml <linux-kernel@...r.kernel.org>, acme@...nel.org,
alexander.shishkin@...ux.intel.com, mingo@...hat.com,
daniel@...earbox.net, rostedt@...dmis.org,
Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
ebiederm@...ssion.com, sargun@...gun.me,
Aravinda Prasad <aravinda@...ux.vnet.ibm.com>,
brendan.d.gregg@...il.com
Subject: Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include
namespaces related info
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?
thanks,
jirka
Powered by blists - more mailing lists