The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Tommi Rantala <tommi.t.rantala@nokia.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ravi Bangoria <ravi.bangoria@linux.ibm.com>,
	Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf test session topology: Fix data path
Date: Thu, 23 Apr 2020 14:17:10 +0200	[thread overview]
Message-ID: <20200423121710.GM1136647@krava> (raw)
In-Reply-To: <20200423115341.562782-1-tommi.t.rantala@nokia.com>

On Thu, Apr 23, 2020 at 02:53:40PM +0300, Tommi Rantala wrote:
> Commit 2d4f27999b88 ("perf data: Add global path holder") missed path
> conversion in tests/topology.c, causing the "Session topology" testcase
> to "hang" (waits forever for input from stdin) when doing "ssh $VM perf
> test".
> 
> Can be reproduced by running "cat | perf test topo", and crashed by
> replacing cat with true:
> 
>   $ true | perf test -v topo
>   40: Session topology                                      :
>   --- start ---
>   test child forked, pid 3638
>   templ file: /tmp/perf-test-QPvAch
>   incompatible file format
>   incompatible file format (rerun with -v to learn more)
>   free(): invalid pointer
>   test child interrupted
>   ---- end ----
>   Session topology: FAILED!
> 
> Fixes: 2d4f27999b88 ("perf data: Add global path holder")
> Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>

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

thanks,
jirka

> ---
>  tools/perf/tests/topology.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
> index 4a800499d7c3..22daf2bdf5fa 100644
> --- a/tools/perf/tests/topology.c
> +++ b/tools/perf/tests/topology.c
> @@ -33,10 +33,8 @@ static int session_write_header(char *path)
>  {
>  	struct perf_session *session;
>  	struct perf_data data = {
> -		.file      = {
> -			.path = path,
> -		},
> -		.mode      = PERF_DATA_MODE_WRITE,
> +		.path = path,
> +		.mode = PERF_DATA_MODE_WRITE,
>  	};
>  
>  	session = perf_session__new(&data, false, NULL);
> @@ -63,10 +61,8 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
>  {
>  	struct perf_session *session;
>  	struct perf_data data = {
> -		.file      = {
> -			.path = path,
> -		},
> -		.mode      = PERF_DATA_MODE_READ,
> +		.path = path,
> +		.mode = PERF_DATA_MODE_READ,
>  	};
>  	int i;
>  
> -- 
> 2.25.3
> 


  reply	other threads:[~2020-04-23 12:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 11:53 [PATCH] perf test session topology: Fix data path Tommi Rantala
2020-04-23 12:17 ` Jiri Olsa [this message]
2020-05-08 13:05 ` [tip: perf/core] " tip-bot2 for Tommi Rantala

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=20200423121710.GM1136647@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mamatha4@linux.vnet.ibm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=tommi.t.rantala@nokia.com \
    /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