linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 02/16] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
Date: Fri, 23 Sep 2016 17:38:34 +0300	[thread overview]
Message-ID: <1474641528-18776-3-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1474641528-18776-1-git-send-email-adrian.hunter@intel.com>

Patch "perf record: Mark MAP_HUGETLB when synthesizing mmap events") breaks
MMAP event synthesis.  The executable name comparison will match any name
if the length is zero, resulting in all the user space maps becoming
anonymous.  This is particularly noticeable with system-wide traces.
Example:

	perf record -a sleep 1
	perf script --show-mmap-events

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2880e2226fdb..8ab0d7da956b 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -346,7 +346,8 @@ out:
 		if (!strcmp(execname, ""))
 			strcpy(execname, anonstr);
 
-		if (!strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
+		if (hugetlbfs_mnt_len &&
+		    !strncmp(execname, hugetlbfs_mnt, hugetlbfs_mnt_len)) {
 			strcpy(execname, anonstr);
 			event->mmap2.flags |= MAP_HUGETLB;
 		}
-- 
1.9.1

  parent reply	other threads:[~2016-09-23 14:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 14:38 [PATCH 00/16] perf tools: Add support for using symbols in address filters Adrian Hunter
2016-09-23 14:38 ` [PATCH 01/16] perf record: Fix documentation 'event_sources' -> 'event_source' Adrian Hunter
2016-09-29 18:10   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` Adrian Hunter [this message]
2016-09-29 18:10   ` [tip:perf/core] perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 03/16] perf script: Fix vanished idle symbols Adrian Hunter
2016-09-29 18:13   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 04/16] perf record: Rename label 'out_symbol_exit' Adrian Hunter
2016-09-29 18:14   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 05/16] perf record: Fix error paths Adrian Hunter
2016-09-29 18:14   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 06/16] perf symbols: Add dso__last_symbol() Adrian Hunter
2016-09-29 18:14   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 07/16] perf record: Add support for using symbols in address filters Adrian Hunter
2016-09-29 18:15   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 08/16] perf tools: Increase debug level of SDT debug messages Adrian Hunter
2016-09-24  0:15   ` Masami Hiramatsu
2016-09-26  7:27     ` Adrian Hunter
2016-09-27 17:42       ` Masami Hiramatsu
2016-09-29 18:15   ` [tip:perf/core] perf probe: " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 09/16] perf intel-pt: Fix snapshot overlap detection decoder errors Adrian Hunter
2016-09-29 18:16   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 10/16] perf intel-pt: Add support for recording the max non-turbo ratio Adrian Hunter
2016-09-29 18:16   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 11/16] perf intel-pt: Fix missing error codes processing auxtrace_info Adrian Hunter
2016-09-29 18:17   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 12/16] perf intel-pt: Add a helper function for processing AUXTRACE_INFO Adrian Hunter
2016-09-29 18:17   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 13/16] perf intel-pt: Record address filter in AUXTRACE_INFO event Adrian Hunter
2016-09-29 18:17   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 14/16] perf intel-pt: Read address filter from " Adrian Hunter
2016-09-29 18:18   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 15/16] perf intel-pt: Enable decoder to handle TIP.PGD with missing IP Adrian Hunter
2016-09-29 18:18   ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-09-23 14:38 ` [PATCH 16/16] perf intel-pt: Fix decoding when there are address filters Adrian Hunter
2016-09-29 18:19   ` [tip:perf/core] " 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=1474641528-18776-3-git-send-email-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mhiramat@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;
as well as URLs for NNTP newsgroup(s).