linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Oleg Latin <oleglatin@yandex-team.ru>
Cc: linux-kernel@vger.kernel.org, nfraser@codeweavers.com,
	peterz@infradead.org, dmtrmonakhov@yandex-team.ru
Subject: Re: [PATCH] perf: add missing cpu entry in json output
Date: Sun, 14 Nov 2021 17:45:37 +0100	[thread overview]
Message-ID: <YZE9MT6b2QmYedMm@krava> (raw)
In-Reply-To: <20211112115738.175001-1-oleglatin@yandex-team.ru>

On Fri, Nov 12, 2021 at 02:57:38PM +0300, Oleg Latin wrote:
> After converting perf.data with 'perf covert data --to-json' the
> resulting json file missing cpu entries:
> 
> 	{
> 	    "timestamp": 5716840788599,
> 	    "pid": 79661,
> 	    "tid": 79661,
> 	    "comm": "python3",
> 	    "callchain": [
> 		{
> 		    "ip": "0xffffffffafd05fc0"
> 		}
> 	    ]
> 	},
> 
> Seems addr_location::thread::cpu is never assigned during
> machine__resolve() call. This patch uses addr_location::cpu to store it
> in json file.
> 
> Signed-off-by: Oleg Latin <oleglatin@yandex-team.ru>

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> ---
>  tools/perf/util/data-convert-json.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/data-convert-json.c b/tools/perf/util/data-convert-json.c
> index f1ab6edba446..b0e3d69c6835 100644
> --- a/tools/perf/util/data-convert-json.c
> +++ b/tools/perf/util/data-convert-json.c
> @@ -168,8 +168,8 @@ static int process_sample_event(struct perf_tool *tool,
>  	output_json_key_format(out, true, 3, "pid", "%i", al.thread->pid_);
>  	output_json_key_format(out, true, 3, "tid", "%i", al.thread->tid);
>  
> -	if (al.thread->cpu >= 0)
> -		output_json_key_format(out, true, 3, "cpu", "%i", al.thread->cpu);
> +	if (al.cpu >= 0)
> +		output_json_key_format(out, true, 3, "cpu", "%i", al.cpu);
>  
>  	output_json_key_string(out, true, 3, "comm", thread__comm_str(al.thread));
>  
> -- 
> 2.25.1
> 


      reply	other threads:[~2021-11-14 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 11:57 [PATCH] perf: add missing cpu entry in json output Oleg Latin
2021-11-14 16:45 ` Jiri Olsa [this message]

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=YZE9MT6b2QmYedMm@krava \
    --to=jolsa@redhat.com \
    --cc=dmtrmonakhov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfraser@codeweavers.com \
    --cc=oleglatin@yandex-team.ru \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).