Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544022

Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include namespaces related info
Date 2016-12-17 18:50 +0100
Message-ID <sPrhn-4eD-15@gated-at.bofh.it> (permalink)
References <sOJ6F-Ms-5@gated-at.bofh.it> <sOJ6F-Ms-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/3] perf: add support for analyzing events for containers Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-15 19:40 +0100
  [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-15 19:40 +0100
    Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-15 19:50 +0100
      Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-16 08:10 +0100
        Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-16 09:30 +0100
          Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-16 19:30 +0100
            Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-16 21:10 +0100
              Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-21 14:10 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-21 14:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-21 17:00 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-22 08:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-22 09:00 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-22 11:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include  namespaces related info Peter Zijlstra <peterz@infradead.org> - 2016-12-22 14:30 +0100
                Re: [PATCH v4 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info ebiederm@xmission.com (Eric W. Biederman) - 2016-12-22 19:30 +0100
  [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-15 19:40 +0100
    Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Jiri Olsa <jolsa@redhat.com> - 2016-12-17 18:50 +0100
      Re: [PATCH v4 2/3] perf tool: add PERF_RECORD_NAMESPACES to include  namespaces related info Hari Bathini <hbathini@linux.vnet.ibm.com> - 2016-12-21 14:20 +0100
  Re: [PATCH v4 0/3] perf: add support for analyzing events for  containers Krister Johansen <kjlx@templeofstupid.com> - 2016-12-29 02:50 +0100
    Re: [PATCH v4 0/3] perf: add support for analyzing events for  containers Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-03 12:30 +0100

csiph-web