public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tests record: Allow for 'sleep' being 'coreutils'
Date: Mon, 26 Nov 2018 17:06:25 -0300	[thread overview]
Message-ID: <20181126200625.GH18491@kernel.org> (raw)
In-Reply-To: <20181122135545.16295-1-adrian.hunter@intel.com>

Em Thu, Nov 22, 2018 at 03:55:45PM +0200, Adrian Hunter escreveu:
> If the 'sleep' command is provided by coreutils, then the "PERF_RECORD_*
> events & perf_sample fields" test will fail because the MMAP name is
> 'coreutils' not 'sleep', and there is an extra COMM event. Fix the test to
> detect that case.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  tools/perf/tests/perf-record.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
> index 34394cc05077..07f6bd8ed719 100644
> --- a/tools/perf/tests/perf-record.c
> +++ b/tools/perf/tests/perf-record.c
> @@ -58,6 +58,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
>  	char *bname, *mmap_filename;
>  	u64 prev_time = 0;
>  	bool found_cmd_mmap = false,
> +	     found_coreutils_mmap = false,
>  	     found_libc_mmap = false,
>  	     found_vdso_mmap = false,
>  	     found_ld_mmap = false;
> @@ -254,6 +255,8 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
>  					if (bname != NULL) {
>  						if (!found_cmd_mmap)
>  							found_cmd_mmap = !strcmp(bname + 1, cmd);
> +						if (!found_coreutils_mmap)
> +							found_coreutils_mmap = !strcmp(bname + 1, "coreutils");
>  						if (!found_libc_mmap)
>  							found_libc_mmap = !strncmp(bname + 1, "libc", 4);
>  						if (!found_ld_mmap)
> @@ -292,7 +295,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
>  	}
>  
>  found_exit:
> -	if (nr_events[PERF_RECORD_COMM] > 1) {
> +	if (nr_events[PERF_RECORD_COMM] > 1 + !!found_coreutils_mmap) {
>  		pr_debug("Excessive number of PERF_RECORD_COMM events!\n");
>  		++errs;
>  	}
> @@ -302,7 +305,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
>  		++errs;
>  	}
>  
> -	if (!found_cmd_mmap) {
> +	if (!found_cmd_mmap && !found_coreutils_mmap) {
>  		pr_debug("PERF_RECORD_MMAP for %s missing!\n", cmd);
>  		++errs;
>  	}
> -- 
> 2.17.1

-- 

- Arnaldo

  reply	other threads:[~2018-11-27 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 13:55 [PATCH] perf tests record: Allow for 'sleep' being 'coreutils' Adrian Hunter
2018-11-26 20:06 ` Arnaldo Carvalho de Melo [this message]
2018-12-14 20:24 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-12-18 13:51 ` tip-bot for Adrian Hunter

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=20181126200625.GH18491@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@redhat.com \
    --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