[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170623054827.3828-4-namhyung@kernel.org>
Date: Fri, 23 Jun 2017 14:48:21 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, kernel-team@....com,
Masami Hiramatsu <mhiramat@...nel.org>,
Andi Kleen <andi@...stfloor.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Wang Nan <wangnan0@...wei.com>
Subject: [PATCH/RFC 3/9] perf symbols: Discard symbols in kallsyms for loaded modules
If a module is already loaded, it should have symbols and no need to
load new symbols from kallsyms. Actually kallsyms can have different
addresses if the module was reloaded.
Current code just discards the first symbols only, but it should do the
same for all symbols in the module. Note that the kernel doesn't set
the dso->loaded bit so simply checking it would do the job IMHO.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Wang Nan <wangnan0@...wei.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/util/symbol.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e7a98dbd2aed..74078ba595b3 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -787,11 +787,12 @@ static int dso__split_kallsyms(struct dso *dso, struct map *map, u64 delta)
curr_map = map;
goto discard_symbol;
}
-
- if (curr_map->dso->loaded &&
- !machine__is_default_guest(machine))
- goto discard_symbol;
}
+
+ if (curr_map->dso->loaded &&
+ !machine__is_default_guest(machine))
+ goto discard_symbol;
+
/*
* So that we look just like we get from .ko files,
* i.e. not prelinked, relative to map->start.
--
2.13.1
Powered by blists - more mailing lists