Skip to content

Commit

Permalink
perf maps: Mark ksymbol DSOs with kernel type
Browse files Browse the repository at this point in the history
We add ksymbol map into machine->kmaps, so it needs to be created as
'struct kmap', which is dependent on its dso having kernel type.

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/20200210200847.GA36715@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Jiri Olsa authored and Arnaldo Carvalho de Melo committed Feb 11, 2020
1 parent 02213ce commit 4a4eb61
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/perf/util/machine.c
Original file line number Diff line number Diff line change
@@ -727,9 +727,17 @@ static int machine__process_ksymbol_register(struct machine *machine,
struct map *map = maps__find(&machine->kmaps, event->ksymbol.addr);

if (!map) {
map = dso__new_map(event->ksymbol.name);
if (!map)
struct dso *dso = dso__new(event->ksymbol.name);

if (dso) {
dso->kernel = DSO_TYPE_KERNEL;
map = map__new2(0, dso);
}

if (!dso || !map) {
dso__put(dso);
return -ENOMEM;
}

map->start = event->ksymbol.addr;
map->end = map->start + event->ksymbol.len;

0 comments on commit 4a4eb61

Please sign in to comment.