linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	chengdongli@tencent.com, adrian.hunter@intel.com,
	svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com,
	hca@linux.ibm.com
Subject: Re: [PATCH] perf/test: test case 71 fails on s390
Date: Wed, 20 Apr 2022 13:52:03 -0300	[thread overview]
Message-ID: <YmA6M8mM44Hvv/jI@kernel.org> (raw)
In-Reply-To: <20220420062921.1211825-1-tmricht@linux.ibm.com>

Em Wed, Apr 20, 2022 at 08:29:21AM +0200, Thomas Richter escreveu:
> Test case 71 'Convert perf time to TSC' is not supported on s390.
> Subtest 71.1 is skipped with the correct message, but
> subtest 71.2 is not skipped and fails.
> 
> The root cause is function evlist__open() called from
> test__perf_time_to_tsc().  evlist__open() returns -ENOENT because the
> event cycles:u is not supported by the selected PMU, for example 
> platform s390 on z/VM or an x86_64 virtual machine.
> The PMU driver returns -ENOENT in this case. This error is leads to
> the failure.
> Fix this by returning TEST_SKIP on -ENOENT.

Thanks, applied and tested it on x86_64, where it continues to work.

- Arnaldo

 
> Output before:
>  71: Convert perf time to TSC:
>  71.1: TSC support:             Skip (This architecture does not support)
>  71.2: Perf time to TSC:        FAILED!
> 
> Output after:
>  71: Convert perf time to TSC:
>  71.1: TSC support:             Skip (This architecture does not support)
>  71.2: Perf time to TSC:        Skip (perf_read_tsc_conversion is not supported)
> 
> This also happens on an x86_64 virtual machine:
>    # uname -m
>    x86_64
>    $ ./perf test -F 71
>     71: Convert perf time to TSC  :
>     71.1: TSC support             : Ok
>     71.2: Perf time to TSC        : FAILED!
>    $ 
> 
> Fixes: 290fa68bdc45 ("perf test tsc: Fix error message when not supported")
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> ---
>  tools/perf/tests/perf-time-to-tsc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/perf/tests/perf-time-to-tsc.c b/tools/perf/tests/perf-time-to-tsc.c
> index cc6df49a65a1..4ad0dfbc8b21 100644
> --- a/tools/perf/tests/perf-time-to-tsc.c
> +++ b/tools/perf/tests/perf-time-to-tsc.c
> @@ -123,6 +123,10 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
>  		evsel->core.attr.enable_on_exec = 0;
>  	}
>  
> +	if (evlist__open(evlist) == -ENOENT) {
> +		err = TEST_SKIP;
> +		goto out_err;
> +	}
>  	CHECK__(evlist__open(evlist));
>  
>  	CHECK__(evlist__mmap(evlist, UINT_MAX));
> -- 
> 2.35.1

-- 

- Arnaldo

      reply	other threads:[~2022-04-20 16:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  6:29 [PATCH] perf/test: test case 71 fails on s390 Thomas Richter
2022-04-20 16:52 ` Arnaldo Carvalho de Melo [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=YmA6M8mM44Hvv/jI@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=chengdongli@tencent.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sumanthk@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=tmricht@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).