All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Jiri Olsa" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>,
	Jiri Olsa <jolsa@kernel.org>, Kim Phillips <kim.phillips@amd.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Michael Petlan <mpetlan@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: perf/urgent] perf maps: Fix map__clone() for struct kmap
Date: Sat, 15 Feb 2020 08:41:52 -0000	[thread overview]
Message-ID: <158175611237.13786.17686234515843613570.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200210143218.24948-4-jolsa@kernel.org>

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     7ce66139a99ce57caaf47b64afed5cb6ed02c5ed
Gitweb:        https://git.kernel.org/tip/7ce66139a99ce57caaf47b64afed5cb6ed02c5ed
Author:        Jiri Olsa <jolsa@kernel.org>
AuthorDate:    Mon, 10 Feb 2020 15:32:17 +01:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Tue, 11 Feb 2020 16:41:49 -03:00

perf maps: Fix map__clone() for struct kmap

The map__clone() function can be called on kernel maps as well, so it
needs to duplicate the whole kmap data.

Reported-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Tested-by: Kim Phillips <kim.phillips@amd.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200210143218.24948-4-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/map.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index f67960b..cea05fc 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -375,8 +375,13 @@ struct symbol *map__find_symbol_by_name(struct map *map, const char *name)
 
 struct map *map__clone(struct map *from)
 {
-	struct map *map = memdup(from, sizeof(*map));
+	size_t size = sizeof(struct map);
+	struct map *map;
+
+	if (from->dso && from->dso->kernel)
+		size += sizeof(struct kmap);
 
+	map = memdup(from, size);
 	if (map != NULL) {
 		refcount_set(&map->refcnt, 1);
 		RB_CLEAR_NODE(&map->rb_node);

  reply	other threads:[~2020-02-15  8:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 14:32 [PATCH 0/4] perf tools: Fix kmap handling Jiri Olsa
2020-02-10 14:32 ` [PATCH 1/4] perf tools: Mark modules dsos with kernel type Jiri Olsa
2020-02-15  8:41   ` [tip: perf/urgent] perf maps: Mark module DSOs " tip-bot2 for Jiri Olsa
2020-02-10 14:32 ` [PATCH 2/4] perf tools: Mark ksymbol dsos " Jiri Olsa
2020-02-10 15:17   ` Arnaldo Carvalho de Melo
2020-02-10 15:25     ` Jiri Olsa
2020-02-10 19:58       ` Arnaldo Carvalho de Melo
2020-02-10 20:34         ` Jiri Olsa
2020-02-10 20:08       ` [PATCHv2 " Jiri Olsa
2020-02-11 13:47         ` Arnaldo Carvalho de Melo
2020-02-15  8:41         ` [tip: perf/urgent] perf maps: Mark ksymbol DSOs " tip-bot2 for Jiri Olsa
2020-02-10 14:32 ` [PATCH 3/4] perf tools: Fix map__clone for struct kmap Jiri Olsa
2020-02-15  8:41   ` tip-bot2 for Jiri Olsa [this message]
2020-02-10 14:32 ` [PATCH 4/4] perf tools: Move kmap::kmaps setup to maps__insert Jiri Olsa
2020-02-15  8:41   ` [tip: perf/urgent] perf maps: Move kmap::kmaps setup to maps__insert() tip-bot2 for Jiri Olsa
2020-02-10 16:47 ` [PATCH 0/4] perf tools: Fix kmap handling Kim Phillips
2020-02-10 20:35   ` Jiri Olsa

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=158175611237.13786.17686234515843613570.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kim.phillips@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.