public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] perf, tools, stat: Avoid crash with --per-thread
Date: Wed, 2 Mar 2016 07:36:59 +0100	[thread overview]
Message-ID: <20160302063659.GA7272@krava> (raw)
In-Reply-To: <1456875157-23263-1-git-send-email-andi@firstfloor.org>

On Tue, Mar 01, 2016 at 03:32:37PM -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> Bug fix:
> 
> The earlier metrics changes broke --per-thread causing a segfault.
> Handle this case correctly. We actually don't print metrics
> in per thread mode, so using a 0 shadow CPU is fine.

right, so --per-thread paths go through perf_stat__print_shadow_stats
but never actually collect shadow data, so it does not print anything

we would need somehow map each thread to the shadow cpu.. I'll try
to come up with something.. however:

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka


> 
> Could be folded into
> "perf, tools, stat: Support metrics in --per-core/socket mode"
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  tools/perf/builtin-stat.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index c11374b..52a37a5 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -977,6 +977,9 @@ static int first_shadow_cpu(struct perf_evsel *evsel, int id)
>  {
>  	int i;
>  
> +	if (!aggr_get_id)
> +		return 0;
> +
>  	if (stat_config.aggr_mode == AGGR_NONE)
>  		return id;
>  
> -- 
> 2.5.0
> 

  reply	other threads:[~2016-03-02  6:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 23:32 [PATCH] perf, tools, stat: Avoid crash with --per-thread Andi Kleen
2016-03-02  6:36 ` Jiri Olsa [this message]
2016-03-02 12:12   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160302063659.GA7272@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox