From: Namhyung Kim <namhyung@gmail.com>
To: Don Zickus <dzickus@redhat.com>
Cc: jolsa@redhat.com, Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
eranian@google.com, Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH 2/7] Revert "perf: Disable PERF_RECORD_MMAP2 support"
Date: Fri, 30 May 2014 16:05:12 +0900 [thread overview]
Message-ID: <87zjhzeogn.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1401208087-181977-3-git-send-email-dzickus@redhat.com> (Don Zickus's message of "Tue, 27 May 2014 12:28:02 -0400")
Hi Don,
On Tue, 27 May 2014 12:28:02 -0400, Don Zickus wrote:
> This reverts commit 3090ffb5a2515990182f3f55b0688a7817325488.
>
> Re-enable the mmap2 interface as we will have a user soon.
>
> Since things have changed since perf disabled mmap2, small tweaks
> to the revert had to be done:
>
> o commit 9d4ecc88 forced (n!=8) to become (n<7)
> o a new libunwind test needed updating to use mmap2 interface
Just few nitpicks..
[SNIP]
> @@ -195,14 +196,15 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
> strcpy(execname, "");
>
> /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */
> - n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %*x:%*x %*u %s\n",
> - &event->mmap.start, &event->mmap.len, prot,
> - &event->mmap.pgoff,
> - execname);
> - /*
> - * Anon maps don't have the execname.
> - */
I think it's better to leave this comment as is.
> - if (n < 4)
> + n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n",
> + &event->mmap2.start, &event->mmap2.len, prot,
> + &event->mmap2.pgoff, &event->mmap2.maj,
> + &event->mmap2.min,
> + &ino, execname);
> +
> + event->mmap2.ino = (u64)ino;
And this can be moved below check..
Thanks,
Namhyung
> +
> + if (n < 7)
> continue;
> /*
> * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c
> @@ -223,15 +225,15 @@ int perf_event__synthesize_mmap_events(struct perf_tool *tool,
> strcpy(execname, anonstr);
>
> size = strlen(execname) + 1;
> - memcpy(event->mmap.filename, execname, size);
> + memcpy(event->mmap2.filename, execname, size);
> size = PERF_ALIGN(size, sizeof(u64));
> - event->mmap.len -= event->mmap.start;
> - event->mmap.header.size = (sizeof(event->mmap) -
> - (sizeof(event->mmap.filename) - size));
> - memset(event->mmap.filename + size, 0, machine->id_hdr_size);
> - event->mmap.header.size += machine->id_hdr_size;
> - event->mmap.pid = tgid;
> - event->mmap.tid = pid;
> + event->mmap2.len -= event->mmap.start;
> + event->mmap2.header.size = (sizeof(event->mmap2) -
> + (sizeof(event->mmap2.filename) - size));
> + memset(event->mmap2.filename + size, 0, machine->id_hdr_size);
> + event->mmap2.header.size += machine->id_hdr_size;
> + event->mmap2.pid = tgid;
> + event->mmap2.tid = pid;
>
> if (process(tool, event, &synth_sample, machine) != 0) {
> rc = -1;
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index 5c28d82..21154da 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -659,6 +659,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts)
> perf_evsel__set_sample_bit(evsel, WEIGHT);
>
> attr->mmap = track;
> + attr->mmap2 = track && !perf_missing_features.mmap2;
> attr->comm = track;
>
> if (opts->sample_transaction)
next prev parent reply other threads:[~2014-05-30 7:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-27 16:28 [PATCH 0/7 V4] perf: Enable mmap2 and add dcacheline sorting Don Zickus
2014-05-27 16:28 ` [PATCH 1/7] events, perf: Pass protection and flags bits through mmap2 interface Don Zickus
2014-05-27 16:28 ` [PATCH 2/7] Revert "perf: Disable PERF_RECORD_MMAP2 support" Don Zickus
2014-05-30 7:05 ` Namhyung Kim [this message]
2014-05-30 14:49 ` [PATCH 2/7 V2] " Don Zickus
2014-06-12 12:02 ` [tip:perf/core] " tip-bot for Don Zickus
2014-05-27 16:28 ` [PATCH 3/7] perf: Update mmap2 interface with protection and flag bits Don Zickus
2014-05-27 16:28 ` [PATCH 4/7] perf report: Add mem-mode documentation to report command Don Zickus
2014-05-27 16:28 ` [PATCH 5/7] perf: Add cpumode to struct hist_entry Don Zickus
2014-06-12 12:03 ` [tip:perf/core] perf tools: " tip-bot for Don Zickus
2014-05-27 16:28 ` [PATCH 6/7] perf: Add support to dynamically get cacheline size Don Zickus
2014-05-30 7:09 ` Namhyung Kim
2014-05-30 14:50 ` [PATCH 6/7 V2] " Don Zickus
2014-05-30 15:28 ` Arnaldo Carvalho de Melo
2014-05-30 16:20 ` Don Zickus
2014-05-30 20:10 ` [PATCH 6/7 V3] " Don Zickus
2014-06-12 12:03 ` [tip:perf/core] perf tools: " tip-bot for Don Zickus
2014-05-27 16:28 ` [PATCH 7/7] perf: Add dcacheline sort Don Zickus
2014-06-12 12:03 ` [tip:perf/core] perf tools: " tip-bot for Don Zickus
2014-05-30 7:15 ` [PATCH 0/7 V4] perf: Enable mmap2 and add dcacheline sorting Namhyung Kim
-- strict thread matches above, loose matches on Subject: below --
2014-05-19 19:13 [PATCH 0/7 V3] x86, nmi: Various fixes and cleanups Don Zickus
2014-05-19 19:13 ` [PATCH 2/7] Revert "perf: Disable PERF_RECORD_MMAP2 support" Don Zickus
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=87zjhzeogn.fsf@sejong.aot.lge.com \
--to=namhyung@gmail.com \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=dzickus@redhat.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®