[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158175611237.13786.17686234515843613570.tip-bot2@tip-bot2>
Date: Sat, 15 Feb 2020 08:41:52 -0000
From: "tip-bot2 for Jiri Olsa" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>,
Jiri Olsa <jolsa@...nel.org>,
Kim Phillips <kim.phillips@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Michael Petlan <mpetlan@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/urgent] perf maps: Fix map__clone() for struct kmap
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@...nel.org>
AuthorDate: Mon, 10 Feb 2020 15:32:17 +01:00
Committer: Arnaldo Carvalho de Melo <acme@...hat.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@...ux.ibm.com>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Tested-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Tested-by: Kim Phillips <kim.phillips@....com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Michael Petlan <mpetlan@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lore.kernel.org/lkml/20200210143218.24948-4-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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);
Powered by blists - more mailing lists