linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 11/75] perf tests record: Allow for 'sleep' being 'coreutils'
Date: Thu,  6 Dec 2018 18:24:58 -0300	[thread overview]
Message-ID: <20181206212602.20474-12-acme@kernel.org> (raw)
In-Reply-To: <20181206212602.20474-1-acme@kernel.org>

From: Adrian Hunter <adrian.hunter@intel.com>

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.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20181122135545.16295-1-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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.19.2


  parent reply	other threads:[~2018-12-06 21:27 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181206212602.20474-1-acme@kernel.org>
2018-12-06 21:24 ` [PATCH 01/75] perf build: Give better hint about devel package for libssl Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 02/75] perf stat: Fix shadow stats for clock events Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 03/75] perf stat: Fix CSV mode column output for non-cgroup events Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 04/75] perf map: Remove extra indirection from map__find() Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 05/75] perf env: Also consider env->arch == NULL as local operation Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 06/75] perf machine: Record if a arch has a single user/kernel address space Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 07/75] perf thread: Add fallback functions for cases where cpumode is insufficient Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 08/75] perf tools: Use fallback for sample_addr_correlates_sym() cases Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 09/75] perf script: Use fallbacks for branch stacks Arnaldo Carvalho de Melo
2018-12-06 21:24 ` [PATCH 10/75] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Arnaldo Carvalho de Melo
2018-12-06 21:24 ` Arnaldo Carvalho de Melo [this message]
2018-12-06 21:24 ` [PATCH 12/75] perf test: Fix perf_event_attr test failure Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 13/75] tools include: Adopt ERR_CAST() from the kernel err.h header Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 14/75] perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 15/75] perf top: Allow passing a kallsyms file Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 16/75] perf intel-pt: Fix error with config term "pt=0" Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 17/75] tools build feature: Check if libaio is available Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 18/75] perf mmap: Map data buffer for preserving collected data Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 19/75] perf record: Enable asynchronous trace writing Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 20/75] perf record: Extend trace writing to multi AIO Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 21/75] perf beauty mmap_flags: Check if the arch has a mmap.h file Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 22/75] tools lib traceevent: Add sanity check to is_timestamp_in_us() Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 23/75] perf annotate: Compute average IPC and IPC coverage per symbol Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 24/75] perf annotate: Create a annotate2 flag in struct symbol Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 25/75] perf report: Display average IPC and IPC coverage per symbol Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 26/75] perf report: Documentation average IPC and IPC coverage Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 27/75] tools lib traceevent: Implement new API tep_get_ref() Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 28/75] tools lib traceevent: Added support for pkg-config Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 29/75] tools lib traceevent: Install trace-seq.h API header file Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 30/75] tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 31/75] tools lib traceevent: Rename tep_free_format() to tep_free_event() Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 32/75] perf tools: traceevent API cleanup, remove __tep_data2host*() Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 33/75] tools lib traceevent: traceevent API cleanup Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 34/75] perf beauty mmap_flags: Fixed syntax error Fixed missing ']' error Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 35/75] perf cs-etm: Support for ARM A32/T32 instruction sets in CoreSight trace Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 36/75] perf tests ARM: Disable breakpoint tests 32-bit Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 37/75] perf vendor events intel: Fix diverse typos Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 38/75] tools lib traceevent: Fix diverse typos in comments Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 39/75] perf tools Documentation: Fix diverse typos Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 40/75] perf bpf-loader: Fix debugging message typo Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 41/75] perf tools: Fix diverse comment typos Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 42/75] tools lib subcmd: Fix a few source code " Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 43/75] perf tools: Allow specifying proc-map-timeout in config file Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 44/75] perf trace: We need to consider "nr" if "__syscall_nr" is not there Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 45/75] perf tools: Support 'srccode' output Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 46/75] perf ordered_events: Rework show_progress for __ordered_events__flush Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 47/75] perf ordered_events: Add private data member Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 48/75] perf top: Save and display the lost count stats Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 49/75] perf top: Move lost events warning to helpline Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 50/75] perf top: Add processing thread Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 51/75] perf top: Use cond variable instead of a lock Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 52/75] perf top: Set the 'session_done' volatile variable when exiting Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 53/75] perf top: Drop samples which are behind the refresh rate Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 54/75] perf top: Save and display the drop count stats Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 55/75] perf top: Display slow reader warning when droping samples Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 56/75] perf top: Move perf_top__reset_sample_counters() to after counts display Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 57/75] perf cs-etm: Add configuration for ETMv3 trace protocol Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 58/75] perf cs-etm: Add support for ETMv3 trace decoding Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 59/75] perf cs-etm: Add support for PTMv1.1 decoding Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 60/75] perf dso: Fix unchecked usage of strncpy() Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 61/75] perf header: " Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 62/75] " Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 63/75] perf help: Remove needless use " Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 64/75] perf svghelper: Fix unchecked usage " Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 65/75] perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 66/75] perf probe: Fix unchecked usage of strncpy() Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 67/75] perf parse-events: " Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 68/75] perf vendor events intel: Fix Load_Miss_Real_Latency on SKL/SKX Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 69/75] perf record: Fix memory leak on AIO objects deallocation Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 70/75] perf config: Modify size factor of snprintf Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 71/75] perf annotate: Introduce basic support for ARC Arnaldo Carvalho de Melo
2018-12-06 21:25 ` [PATCH 72/75] perf ordered_events: Add ordered_events__flush_time interface Arnaldo Carvalho de Melo
2018-12-06 21:26 ` [PATCH 73/75] perf trace: Move event delivery to a new deliver_event() function Arnaldo Carvalho de Melo
2018-12-06 21:26 ` [PATCH 74/75] perf ordered_events: Add first_time() method Arnaldo Carvalho de Melo
2018-12-06 21:26 ` [PATCH 75/75] perf trace: Add ordered processing 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=20181206212602.20474-12-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=williams@redhat.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).