* [GIT PULL 00/14] perf/core improvements and fixes
@ 2016-04-19 15:50 Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 01/14] perf trace: Fix build when DWARF unwind isn't available Arnaldo Carvalho de Melo
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
Alexander Shishkin, Chris Phlipot, Colin Ian King, David Ahern,
H. Peter Anvin, Jiri Olsa, Milian Wolff, Namhyung Kim,
Peter Zijlstra, Stephane Eranian, Stephen Rothwell,
Thomas Gleixner, Wang Nan, Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 9243ae5b28d02dc7d71a4f00c981ef6feaede3f1:
Merge tag 'perf-core-for-mingo-20160415' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-16 11:09:57 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160419
for you to fetch changes up to 6566feafb4dba4eef30a9c0b25e6f49f996178b6:
perf test: Add missing verbose output explaining the reason for failure (2016-04-19 12:39:36 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
Build fixes:
- Fix 'perf trace' build when DWARF unwind isn't available (Arnaldo Carvalho de Melo)
- Remove x86 references from arch-neutral Build, fixing it in !x86 arches,
reported as breaking the build for powerpc64le in linux-next (Arnaldo Carvalho de Melo)
Infrastructure:
- Do memset() variable 'st' using the correct size in the jit code (Colin Ian King)
- Fix postgresql ubuntu 'perf script' install instructions (Chris Phlipot)
- Use callchain_param more thoroughly when checking how callchains were
configured, eventually will be the only way to look for callchain parameters
(Arnaldo Carvalho de Melo)
- Fix some issues in the 'perf test kallsyms' entry (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (12):
perf trace: Fix build when DWARF unwind isn't available
perf evsel: Add missign class prefix to has_branch_stack method
perf script: Check sample->callchain before using it
perf callchain: Set callchain_param.enabled when parsing --call-graph
perf report: Use callchain_param.enabled instead of tool specific knob
perf tools: Ditch record_opts.callgraph_set
perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs
perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain
perf build: Remove x86 references from arch-neutral Build
perf symbols: Allow loading kallsyms without considering kcore files
perf test: Ignore kcore files in the "vmlinux matches kallsyms" test
perf test: Add missing verbose output explaining the reason for failure
Chris Phlipot (1):
perf script: Fix postgresql ubuntu install instructions
Colin Ian King (1):
perf jit: memset() variable 'st' using the correct size
tools/perf/builtin-record.c | 14 ++++++-------
tools/perf/builtin-report.c | 11 +++++-----
tools/perf/builtin-script.c | 2 +-
tools/perf/builtin-top.c | 25 +++++++++++------------
tools/perf/builtin-trace.c | 10 ++++-----
tools/perf/perf.h | 1 -
tools/perf/scripts/python/export-to-postgresql.py | 5 ++---
tools/perf/tests/vmlinux-kallsyms.c | 11 +++++++++-
tools/perf/ui/browsers/hists.c | 5 ++---
tools/perf/util/Build | 4 ----
tools/perf/util/callchain.c | 2 ++
tools/perf/util/evsel.h | 2 +-
tools/perf/util/jitdump.c | 4 ++--
tools/perf/util/machine.c | 14 +++++++++----
tools/perf/util/machine.h | 2 ++
tools/perf/util/session.c | 4 ++--
tools/perf/util/symbol.c | 12 ++++++++---
tools/perf/util/symbol.h | 2 ++
18 files changed, 74 insertions(+), 56 deletions(-)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 01/14] perf trace: Fix build when DWARF unwind isn't available
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 02/14] perf evsel: Add missign class prefix to has_branch_stack method Arnaldo Carvalho de Melo
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
The variable is initialized and then conditionally set to a different
value, but not used when DWARF unwinding is not available, bummer, write
1000 times: "Run make -C tools/perf build-test"...
builtin-trace.c: In function ‘cmd_trace’:
builtin-trace.c:3112:6: error: variable ‘max_stack_user_set’ set but not
used [-Werror=unused-but-set-variable]
bool max_stack_user_set = true;
^
cc1: all warnings being treated as err
Fix it by marking it as __maybe_unused.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 056149932602 ("perf trace: Make --(min,max}-stack imply "--call-graph dwarf"")
Link: http://lkml.kernel.org/n/tip-85r40c5hhv6jnmph77l1hgsr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 026ec0c749b0..0e3c1cecef1b 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -3109,7 +3109,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
"per thread proc mmap processing timeout in ms"),
OPT_END()
};
- bool max_stack_user_set = true;
+ bool __maybe_unused max_stack_user_set = true;
bool mmap_pages_user_set = true;
const char * const trace_subcommands[] = { "record", NULL };
int err;
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 02/14] perf evsel: Add missign class prefix to has_branch_stack method
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 01/14] perf trace: Fix build when DWARF unwind isn't available Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 03/14] perf script: Check sample->callchain before using it Arnaldo Carvalho de Melo
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-5i07ivw1yjsweb7gztr255jd@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evsel.h | 2 +-
tools/perf/util/machine.c | 2 +-
tools/perf/util/session.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index b993218744d4..8a644fef452c 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -420,7 +420,7 @@ for ((_evsel) = list_entry((_leader)->node.next, struct perf_evsel, node); \
(_evsel) && (_evsel)->leader == (_leader); \
(_evsel) = list_entry((_evsel)->node.next, struct perf_evsel, node))
-static inline bool has_branch_callstack(struct perf_evsel *evsel)
+static inline bool perf_evsel__has_branch_callstack(const struct perf_evsel *evsel)
{
return evsel->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK;
}
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 0c4dabc69932..52b51e004fe8 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1808,7 +1808,7 @@ static int thread__resolve_callchain_sample(struct thread *thread,
callchain_cursor_reset(cursor);
- if (has_branch_callstack(evsel)) {
+ if (perf_evsel__has_branch_callstack(evsel)) {
err = resolve_lbr_callchain_sample(thread, cursor, sample, parent,
root_al, max_stack);
if (err)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ca1827c4af4a..2335b2824d8a 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -907,7 +907,7 @@ static void callchain__printf(struct perf_evsel *evsel,
unsigned int i;
struct ip_callchain *callchain = sample->callchain;
- if (has_branch_callstack(evsel))
+ if (perf_evsel__has_branch_callstack(evsel))
callchain__lbr_callstack_printf(sample);
printf("... FP chain: nr:%" PRIu64 "\n", callchain->nr);
@@ -1081,7 +1081,7 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event,
if (sample_type & PERF_SAMPLE_CALLCHAIN)
callchain__printf(evsel, sample);
- if ((sample_type & PERF_SAMPLE_BRANCH_STACK) && !has_branch_callstack(evsel))
+ if ((sample_type & PERF_SAMPLE_BRANCH_STACK) && !perf_evsel__has_branch_callstack(evsel))
branch_stack__printf(sample);
if (sample_type & PERF_SAMPLE_REGS_USER)
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 03/14] perf script: Check sample->callchain before using it
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 01/14] perf trace: Fix build when DWARF unwind isn't available Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 02/14] perf evsel: Add missign class prefix to has_branch_stack method Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 04/14] perf callchain: Set callchain_param.enabled when parsing --call-graph Arnaldo Carvalho de Melo
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Found by code inspection, while looking at thread__resolve_callchain()
callsites, one had it, the other didn't.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-6r8i2afd3523thuuaxl39yhk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-script.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 0e93282b405e..5099740aa50b 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -791,7 +791,7 @@ static void process_event(struct perf_script *script,
if (PRINT_FIELD(IP)) {
struct callchain_cursor *cursor = NULL, cursor_callchain;
- if (symbol_conf.use_callchain &&
+ if (symbol_conf.use_callchain && sample->callchain &&
thread__resolve_callchain(al->thread, &cursor_callchain, evsel,
sample, NULL, NULL, scripting_max_stack) == 0)
cursor = &cursor_callchain;
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 04/14] perf callchain: Set callchain_param.enabled when parsing --call-graph
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 03/14] perf script: Check sample->callchain before using it Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 05/14] perf report: Use callchain_param.enabled instead of tool specific knob Arnaldo Carvalho de Melo
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Trying to move in the direction of using callchain_param for all
callchain parameters, eventually ditching them from symbol_conf.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-kixllia6r26mz45ng056zq7z@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/callchain.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 2b4ceaf058bb..aa248dcb4440 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -109,6 +109,7 @@ __parse_callchain_report_opt(const char *arg, bool allow_record_opt)
bool record_opt_set = false;
bool try_stack_size = false;
+ callchain_param.enabled = true;
symbol_conf.use_callchain = true;
if (!arg)
@@ -117,6 +118,7 @@ __parse_callchain_report_opt(const char *arg, bool allow_record_opt)
while ((tok = strtok((char *)arg, ",")) != NULL) {
if (!strncmp(tok, "none", strlen(tok))) {
callchain_param.mode = CHAIN_NONE;
+ callchain_param.enabled = false;
symbol_conf.use_callchain = false;
return 0;
}
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 05/14] perf report: Use callchain_param.enabled instead of tool specific knob
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (3 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 04/14] perf callchain: Set callchain_param.enabled when parsing --call-graph Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 06/14] perf tools: Ditch record_opts.callgraph_set Arnaldo Carvalho de Melo
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
We have callchain_param.enabled, so no need to have something just for
'perf report' to do the same thing.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-wbeisubpualwogwi5u8utnt1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-report.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 160ea23b45aa..1d5be0bd426f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -47,7 +47,6 @@ struct report {
struct perf_tool tool;
struct perf_session *session;
bool use_tui, use_gtk, use_stdio;
- bool dont_use_callchains;
bool show_full_info;
bool show_threads;
bool inverted_callchain;
@@ -247,7 +246,7 @@ static int report__setup_sample_type(struct report *rep)
"you call 'perf record' without -g?\n");
return -1;
}
- } else if (!rep->dont_use_callchains &&
+ } else if (!callchain_param.enabled &&
callchain_param.mode != CHAIN_NONE &&
!symbol_conf.use_callchain) {
symbol_conf.use_callchain = true;
@@ -599,13 +598,15 @@ static int __cmd_report(struct report *rep)
static int
report_parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
- struct report *rep = (struct report *)opt->value;
+ struct callchain_param *callchain = opt->value;
+ callchain->enabled = !unset;
/*
* --no-call-graph
*/
if (unset) {
- rep->dont_use_callchains = true;
+ symbol_conf.use_callchain = false;
+ callchain->mode = CHAIN_NONE;
return 0;
}
@@ -734,7 +735,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
"regex filter to identify parent, see: '--sort parent'"),
OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
"Only display entries with parent-match"),
- OPT_CALLBACK_DEFAULT('g', "call-graph", &report,
+ OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param,
"print_type,threshold[,print_limit],order,sort_key[,branch],value",
report_callchain_help, &report_parse_callchain_opt,
callchain_default_opt),
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 06/14] perf tools: Ditch record_opts.callgraph_set
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (4 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 05/14] perf report: Use callchain_param.enabled instead of tool specific knob Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 07/14] perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs Arnaldo Carvalho de Melo
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
We have callchain_param.enabled for that.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-silwqjc2t25ls42dsvg28pp5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 14 ++++++--------
tools/perf/builtin-top.c | 13 ++++++-------
tools/perf/builtin-trace.c | 8 ++++----
tools/perf/perf.h | 1 -
4 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 5b4758a08a49..bd9593346bb2 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -946,7 +946,6 @@ int record_opts__parse_callchain(struct record_opts *record,
const char *arg, bool unset)
{
int ret;
- record->callgraph_set = true;
callchain->enabled = !unset;
/* --no-call-graph */
@@ -978,15 +977,14 @@ int record_callchain_opt(const struct option *opt,
const char *arg __maybe_unused,
int unset __maybe_unused)
{
- struct record_opts *record = (struct record_opts *)opt->value;
+ struct callchain_param *callchain = opt->value;
- record->callgraph_set = true;
- callchain_param.enabled = true;
+ callchain->enabled = true;
- if (callchain_param.record_mode == CALLCHAIN_NONE)
- callchain_param.record_mode = CALLCHAIN_FP;
+ if (callchain->record_mode == CALLCHAIN_NONE)
+ callchain->record_mode = CALLCHAIN_FP;
- callchain_debug(&callchain_param);
+ callchain_debug(callchain);
return 0;
}
@@ -1224,7 +1222,7 @@ struct option __record_options[] = {
record__parse_mmap_pages),
OPT_BOOLEAN(0, "group", &record.opts.group,
"put the counters into a counter group"),
- OPT_CALLBACK_NOOPT('g', NULL, &record.opts,
+ OPT_CALLBACK_NOOPT('g', NULL, &callchain_param,
NULL, "enables call-graph recording" ,
&record_callchain_opt),
OPT_CALLBACK(0, "call-graph", &record.opts,
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 8846df0ec0c3..f0cfdf394fac 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1045,18 +1045,17 @@ callchain_opt(const struct option *opt, const char *arg, int unset)
static int
parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
- struct record_opts *record = (struct record_opts *)opt->value;
+ struct callchain_param *callchain = opt->value;
- record->callgraph_set = true;
- callchain_param.enabled = !unset;
- callchain_param.record_mode = CALLCHAIN_FP;
+ callchain->enabled = !unset;
+ callchain->record_mode = CALLCHAIN_FP;
/*
* --no-call-graph
*/
if (unset) {
symbol_conf.use_callchain = false;
- callchain_param.record_mode = CALLCHAIN_NONE;
+ callchain->record_mode = CALLCHAIN_NONE;
return 0;
}
@@ -1162,10 +1161,10 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
"output field(s): overhead, period, sample plus all of sort keys"),
OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
"Show a column with the number of samples"),
- OPT_CALLBACK_NOOPT('g', NULL, &top.record_opts,
+ OPT_CALLBACK_NOOPT('g', NULL, &callchain_param,
NULL, "enables call-graph recording and display",
&callchain_opt),
- OPT_CALLBACK(0, "call-graph", &top.record_opts,
+ OPT_CALLBACK(0, "call-graph", &callchain_param,
"record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]",
top_callchain_help, &parse_callchain_opt),
OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 0e3c1cecef1b..5e2614bbb48d 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2457,7 +2457,7 @@ static int trace__add_syscall_newtp(struct trace *trace)
perf_evlist__add(evlist, sys_enter);
perf_evlist__add(evlist, sys_exit);
- if (trace->opts.callgraph_set && !trace->kernel_syscallchains) {
+ if (callchain_param.enabled && !trace->kernel_syscallchains) {
/*
* We're interested only in the user space callchain
* leading to the syscall, allow overriding that for
@@ -2546,7 +2546,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
perf_evlist__config(evlist, &trace->opts, NULL);
- if (trace->opts.callgraph_set && trace->syscalls.events.sys_exit) {
+ if (callchain_param.enabled && trace->syscalls.events.sys_exit) {
perf_evsel__config_callchain(trace->syscalls.events.sys_exit,
&trace->opts, &callchain_param);
/*
@@ -3153,11 +3153,11 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
}
#ifdef HAVE_DWARF_UNWIND_SUPPORT
- if ((trace.min_stack || max_stack_user_set) && !trace.opts.callgraph_set)
+ if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled)
record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false);
#endif
- if (trace.opts.callgraph_set) {
+ if (callchain_param.enabled) {
if (!mmap_pages_user_set && geteuid() == 0)
trace.opts.mmap_pages = perf_event_mlock_kb_in_pages() * 4;
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 5381a01c0610..cd8f1b150f9e 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -52,7 +52,6 @@ struct record_opts {
bool sample_weight;
bool sample_time;
bool sample_time_set;
- bool callgraph_set;
bool period;
bool running_time;
bool full_auxtrace;
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 07/14] perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (5 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 06/14] perf tools: Ditch record_opts.callgraph_set Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 08/14] perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain Arnaldo Carvalho de Melo
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-u701i6qpecgm9jiat52i8l98@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/hists.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e70df2e54d66..6a4681932ba5 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1896,11 +1896,10 @@ static int hist_browser__fprintf_entry(struct hist_browser *browser,
bool first = true;
int ret;
- if (symbol_conf.use_callchain)
+ if (symbol_conf.use_callchain) {
folded_sign = hist_entry__folded(he);
-
- if (symbol_conf.use_callchain)
printed += fprintf(fp, "%c ", folded_sign);
+ }
hists__for_each_format(browser->hists, fmt) {
if (perf_hpp__should_skip(fmt, he->hists))
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 08/14] perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (6 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 07/14] perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 09/14] perf script: Fix postgresql ubuntu install instructions Arnaldo Carvalho de Melo
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Milian Wolff, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
One more step in the direction of using just callchain_param for
callchain parameters.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-3b1o9kb2dc94zldz0klckti6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-top.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index f0cfdf394fac..c130a11d3a0d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -917,15 +917,15 @@ out_err:
return -1;
}
-static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
+static int callchain_param__setup_sample_type(struct callchain_param *callchain)
{
if (!sort__has_sym) {
- if (symbol_conf.use_callchain) {
+ if (callchain->enabled) {
ui__error("Selected -g but \"sym\" not present in --sort/-s.");
return -EINVAL;
}
- } else if (callchain_param.mode != CHAIN_NONE) {
- if (callchain_register_param(&callchain_param) < 0) {
+ } else if (callchain->mode != CHAIN_NONE) {
+ if (callchain_register_param(callchain) < 0) {
ui__error("Can't register callchain params.\n");
return -EINVAL;
}
@@ -952,7 +952,7 @@ static int __cmd_top(struct perf_top *top)
goto out_delete;
}
- ret = perf_top__setup_sample_type(top);
+ ret = callchain_param__setup_sample_type(&callchain_param);
if (ret)
goto out_delete;
@@ -1311,7 +1311,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
top.sym_evsel = perf_evlist__first(top.evlist);
- if (!symbol_conf.use_callchain) {
+ if (!callchain_param.enabled) {
symbol_conf.cumulate_callchain = false;
perf_hpp__cancel_cumulate();
}
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 09/14] perf script: Fix postgresql ubuntu install instructions
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (7 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 08/14] perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 10/14] perf jit: memset() variable 'st' using the correct size Arnaldo Carvalho de Melo
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Chris Phlipot, Adrian Hunter, Peter Zijlstra,
Arnaldo Carvalho de Melo
From: Chris Phlipot <cphlipot0@gmail.com>
The current instructions for setting up an Ubuntu system for using the
export-to-postgresql.py script are incorrect.
The instructions in the script have been updated to work on newer
versions of ubuntu.
-Add missing dependencies to apt-get command:
python-pyside.qtsql, libqt4-sql-psql
-Add '-s' option to createuser command to force the user to be a
superuser since the command doesn't prompt as indicated in the
current instructions.
Tested on: Ubuntu 14.04, Ubuntu 16.04(beta)
Signed-off-by: Chris Phlipot <cphlipot0@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1461056164-14914-3-git-send-email-cphlipot0@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/scripts/python/export-to-postgresql.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py
index 1b02cdc0cab6..6f0ca6873c17 100644
--- a/tools/perf/scripts/python/export-to-postgresql.py
+++ b/tools/perf/scripts/python/export-to-postgresql.py
@@ -34,10 +34,9 @@ import datetime
#
# ubuntu:
#
-# $ sudo apt-get install postgresql
+# $ sudo apt-get install postgresql python-pyside.qtsql libqt4-sql-psql
# $ sudo su - postgres
-# $ createuser <your user id here>
-# Shall the new role be a superuser? (y/n) y
+# $ createuser -s <your user id here>
#
# An example of using this script with Intel PT:
#
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 10/14] perf jit: memset() variable 'st' using the correct size
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (8 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 09/14] perf script: Fix postgresql ubuntu install instructions Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 11/14] perf build: Remove x86 references from arch-neutral Build Arnaldo Carvalho de Melo
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Colin Ian King, Adrian Hunter, Alexander Shishkin,
Peter Zijlstra, Stephane Eranian, Arnaldo Carvalho de Melo
From: Colin Ian King <colin.king@canonical.com>
The current code is memsetting the 'struct stat' variable 'st' with the size of
'stat' (which turns out to be 1 byte) rather than the size of variable 'sz'.
Committer notes:
sizeof(function) isn't valid, the result depends on the compiler used, with
gcc, enabling pedantic warnings we get:
$ cat sizeof_function.c
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
int main(void)
{
printf("sizeof(stat)=%zd, stat=%p\n", sizeof(stat), stat);
return 0;
}
$ readelf -sW sizeof_function | grep -w stat
49: 0000000000400630 16 FUNC WEAK HIDDEN 13 stat
$ cc -pedantic sizeof_function.c -o sizeof_function
sizeof_function.c: In function ‘main’:
sizeof_function.c:8:46: warning: invalid application of ‘sizeof’ to a function type [-Wpointer-arith]
printf("sizeof(stat)=%zd, stat=%p\n", sizeof(stat), stat);
^
$ ./sizeof_function
sizeof(stat)=1, stat=0x400630
$
Standard C, section 6.5.3.4:
"The sizeof operator shall not be applied to an expression that has function
type or an incomplete type, to the parenthesized name of such a type,
or to an expression that designates a bit-field member."
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Fixes: 9b07e27f88b9 ("perf inject: Add jitdump mmap injection support")
Link: http://lkml.kernel.org/r/1461020838-9260-1-git-send-email-colin.king@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/jitdump.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 52fcef3074fe..86afe9618bb0 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -412,7 +412,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr)
return -1;
}
if (stat(filename, &st))
- memset(&st, 0, sizeof(stat));
+ memset(&st, 0, sizeof(st));
event->mmap2.header.type = PERF_RECORD_MMAP2;
event->mmap2.header.misc = PERF_RECORD_MISC_USER;
@@ -500,7 +500,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr)
size++; /* for \0 */
if (stat(filename, &st))
- memset(&st, 0, sizeof(stat));
+ memset(&st, 0, sizeof(st));
size = PERF_ALIGN(size, sizeof(u64));
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 11/14] perf build: Remove x86 references from arch-neutral Build
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (9 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 10/14] perf jit: memset() variable 'st' using the correct size Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 12/14] perf symbols: Allow loading kallsyms without considering kcore files Arnaldo Carvalho de Melo
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, H. Peter Anvin, Namhyung Kim, Peter Zijlstra,
Thomas Gleixner, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
It will already be dealt with generating the syscalltbl.c file in the
x86 arch specific Build files, namely via 'archheaders'.
This fixes the build on !x86 arches, as reported for powerpcle
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 1b700c997500 ("perf tools: Build syscall table .c header from kernel's syscall_64.tbl")
Link: http://lkml.kernel.org/r/20160415212831.GT9056@kernel.org
[ Removed the syscalltbl.o altogether, as per Jiri's suggestion ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/Build | 4 ----
1 file changed, 4 deletions(-)
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 85a9ab62e23f..90229a88f969 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -150,10 +150,6 @@ CFLAGS_libstring.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ET
CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
CFLAGS_parse-events.o += -Wno-redundant-decls
-$(OUTPUT)util/syscalltbl.o: util/syscalltbl.c arch/x86/entry/syscalls/syscall_64.tbl $(OUTPUT)arch/x86/include/generated/asm/syscalls_64.c FORCE
- $(call rule_mkdir)
- $(call if_changed_dep,cc_o_c)
-
$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
$(call rule_mkdir)
$(call if_changed_dep,cc_o_c)
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 12/14] perf symbols: Allow loading kallsyms without considering kcore files
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (10 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 11/14] perf build: Remove x86 references from arch-neutral Build Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 13/14] perf test: Ignore kcore files in the "vmlinux matches kallsyms" test Arnaldo Carvalho de Melo
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Before the support for using /proc/kcore was introduced, the kallsyms
routines used /proc/modules and the first 'perf test' entry expected
finding maps for each module in the system, which is not the case with
the kcore code. Provide a way to ignore kcore files so that the test can
have its expectations met.
Improving the test to cover kcore files as well needs to be done.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-ek5urnu103dlhfk4l6pcw041@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/machine.c | 12 +++++++++---
tools/perf/util/machine.h | 2 ++
tools/perf/util/symbol.c | 12 +++++++++---
tools/perf/util/symbol.h | 2 ++
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 52b51e004fe8..656c1d7ee7d4 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -908,11 +908,11 @@ int machines__create_kernel_maps(struct machines *machines, pid_t pid)
return machine__create_kernel_maps(machine);
}
-int machine__load_kallsyms(struct machine *machine, const char *filename,
- enum map_type type, symbol_filter_t filter)
+int __machine__load_kallsyms(struct machine *machine, const char *filename,
+ enum map_type type, bool no_kcore, symbol_filter_t filter)
{
struct map *map = machine__kernel_map(machine);
- int ret = dso__load_kallsyms(map->dso, filename, map, filter);
+ int ret = __dso__load_kallsyms(map->dso, filename, map, no_kcore, filter);
if (ret > 0) {
dso__set_loaded(map->dso, type);
@@ -927,6 +927,12 @@ int machine__load_kallsyms(struct machine *machine, const char *filename,
return ret;
}
+int machine__load_kallsyms(struct machine *machine, const char *filename,
+ enum map_type type, symbol_filter_t filter)
+{
+ return __machine__load_kallsyms(machine, filename, type, false, filter);
+}
+
int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
symbol_filter_t filter)
{
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index 382873bdc563..4822de5e4544 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -215,6 +215,8 @@ struct symbol *machine__find_kernel_function_by_name(struct machine *machine,
struct map *machine__findnew_module_map(struct machine *machine, u64 start,
const char *filename);
+int __machine__load_kallsyms(struct machine *machine, const char *filename,
+ enum map_type type, bool no_kcore, symbol_filter_t filter);
int machine__load_kallsyms(struct machine *machine, const char *filename,
enum map_type type, symbol_filter_t filter);
int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index a36823c3b7c0..415c4f6d98fd 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1208,8 +1208,8 @@ static int kallsyms__delta(struct map *map, const char *filename, u64 *delta)
return 0;
}
-int dso__load_kallsyms(struct dso *dso, const char *filename,
- struct map *map, symbol_filter_t filter)
+int __dso__load_kallsyms(struct dso *dso, const char *filename,
+ struct map *map, bool no_kcore, symbol_filter_t filter)
{
u64 delta = 0;
@@ -1230,12 +1230,18 @@ int dso__load_kallsyms(struct dso *dso, const char *filename,
else
dso->symtab_type = DSO_BINARY_TYPE__KALLSYMS;
- if (!dso__load_kcore(dso, map, filename))
+ if (!no_kcore && !dso__load_kcore(dso, map, filename))
return dso__split_kallsyms_for_kcore(dso, map, filter);
else
return dso__split_kallsyms(dso, map, delta, filter);
}
+int dso__load_kallsyms(struct dso *dso, const char *filename,
+ struct map *map, symbol_filter_t filter)
+{
+ return __dso__load_kallsyms(dso, filename, map, false, filter);
+}
+
static int dso__load_perf_map(struct dso *dso, struct map *map,
symbol_filter_t filter)
{
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 1da7b101bc7f..c8e43979ed5c 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -240,6 +240,8 @@ int dso__load_vmlinux(struct dso *dso, struct map *map,
symbol_filter_t filter);
int dso__load_vmlinux_path(struct dso *dso, struct map *map,
symbol_filter_t filter);
+int __dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map,
+ bool no_kcore, symbol_filter_t filter);
int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map,
symbol_filter_t filter);
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 13/14] perf test: Ignore kcore files in the "vmlinux matches kallsyms" test
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (11 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 12/14] perf symbols: Allow loading kallsyms without considering kcore files Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 14/14] perf test: Add missing verbose output explaining the reason for failure Arnaldo Carvalho de Melo
2016-04-19 19:00 ` [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Before:
# perf test -v kallsyms
<SNIP>
Maps only in vmlinux:
ffffffff81d5e000-ffffffff81ec3ac8 115e000 [kernel].init.text
ffffffff81ec3ac8-ffffffffa0000000 12c3ac8 [kernel].exit.text
ffffffffa0000000-ffffffffa000c000 0 [fjes]
ffffffffa000c000-ffffffffa0017000 0 [video]
ffffffffa0017000-ffffffffa001c000 0 [grace]
<SNIP>
ffffffffa0a7f000-ffffffffa0ba5000 0 [xfs]
ffffffffa0ba5000-ffffffffffffffff 0 [veth]
Maps in vmlinux with a different name in kallsyms:
Maps only in kallsyms:
ffff880000100000-ffff88001000b000 80000103000 [kernel.kallsyms]
ffff88001000b000-ffff880100000000 8001000e000 [kernel.kallsyms]
ffff880100000000-ffffc90000000000 80100003000 [kernel.kallsyms]
<SNIP>
ffffffffa0000000-ffffffffff600000 7fffa0003000 [kernel.kallsyms]
ffffffffff600000-ffffffffffffffff 7fffff603000 [kernel.kallsyms]
test child finished with -1
---- end ----
vmlinux symtab matches kallsyms: FAILED!
#
After:
# perf test -v 1
1: vmlinux symtab matches kallsyms :
--- start ---
test child forked, pid 7058
Looking at the vmlinux_path (8 entries long)
Using /lib/modules/4.6.0-rc1+/build/vmlinux for symbols
0xffffffff81076870: diff end addr for aesni_gcm_dec v: 0xffffffff810791f2 k: 0xffffffff81076902
0xffffffff81079200: diff end addr for aesni_gcm_enc v: 0xffffffff8107bb03 k: 0xffffffff81079292
0xffffffff8107e8d0: diff end addr for aesni_gcm_enc_avx_gen2 v: 0xffffffff81083e76 k: 0xffffffff8107e943
0xffffffff81083e80: diff end addr for aesni_gcm_dec_avx_gen2 v: 0xffffffff81089611 k: 0xffffffff81083ef3
0xffffffff81089990: diff end addr for aesni_gcm_enc_avx_gen4 v: 0xffffffff8108e7c4 k: 0xffffffff81089a03
0xffffffff8108e7d0: diff end addr for aesni_gcm_dec_avx_gen4 v: 0xffffffff810937ef k: 0xffffffff8108e843
Maps only in vmlinux:
ffffffff81d5e000-ffffffff81ec3ac8 115e000 [kernel].init.text
ffffffff81ec3ac8-ffffffffa0000000 12c3ac8 [kernel].exit.text
Maps in vmlinux with a different name in kallsyms:
Maps only in kallsyms:
test child finished with -1
---- end ----
vmlinux symtab matches kallsyms: FAILED!
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 8e0cf965f95e ("perf symbols: Add support for reading from /proc/kcore")
Link: http://lkml.kernel.org/n/tip-n6vrwt9t89w8k769y349govx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/vmlinux-kallsyms.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 630b0b409b97..c05f1bdd9210 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -54,8 +54,14 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused)
* Step 3:
*
* Load and split /proc/kallsyms into multiple maps, one per module.
+ * Do not use kcore, as this test was designed before kcore support
+ * and has parts that only make sense if using the non-kcore code.
+ * XXX: extend it to stress the kcorre code as well, hint: the list
+ * of modules extracted from /proc/kcore, in its current form, can't
+ * be compacted against the list of modules found in the "vmlinux"
+ * code and with the one got from /proc/modules from the "kallsyms" code.
*/
- if (machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, NULL) <= 0) {
+ if (__machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, true, NULL) <= 0) {
pr_debug("dso__load_kallsyms ");
goto out;
}
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 14/14] perf test: Add missing verbose output explaining the reason for failure
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (12 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 13/14] perf test: Ignore kcore files in the "vmlinux matches kallsyms" test Arnaldo Carvalho de Melo
@ 2016-04-19 15:50 ` Arnaldo Carvalho de Melo
2016-04-19 19:00 ` [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar
14 siblings, 0 replies; 16+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-19 15:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Jiri Olsa, Namhyung Kim, Wang Nan
From: Arnaldo Carvalho de Melo <acme@redhat.com>
One of the branches leading to an error had no debug message emitted,
fix it, the new lines are:
# perf test -v kallsyms
<SNIP>
0xffffffff81001000: diff name v: xen_hypercall_set_trap_table k: hypercall_page
0xffffffff810691f0: diff name v: try_to_free_pud_page k: try_to_free_pmd_page
<SNIP>
0xffffffff8150bb20: diff name v: wakeup_expire_count_show.part.5 k: wakeup_active_count_show.part.7
0xffffffff816bc7f0: diff name v: phys_switch_id_show.part.11 k: phys_port_name_show.part.12
0xffffffff817bbb90: diff name v: __do_softirq k: __softirqentry_text_start
<SNIP>
This in turn exercises another bug, still under investigation, because those
aliases _are_ in kallsyms, with the same name...
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: ab414dcda8fa ("perf test: Fixup aliases checking in the 'vmlinux matches kallsyms' test")
Link: http://lkml.kernel.org/n/tip-5fhea7a54a54gsmagu9obpr4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/vmlinux-kallsyms.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index c05f1bdd9210..e63abab7d5a1 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -163,6 +163,9 @@ next_pair:
pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
mem_start, sym->name, pair->name);
+ } else {
+ pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
+ mem_start, sym->name, first_pair->name);
}
}
} else
--
2.5.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [GIT PULL 00/14] perf/core improvements and fixes
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
` (13 preceding siblings ...)
2016-04-19 15:50 ` [PATCH 14/14] perf test: Add missing verbose output explaining the reason for failure Arnaldo Carvalho de Melo
@ 2016-04-19 19:00 ` Ingo Molnar
14 siblings, 0 replies; 16+ messages in thread
From: Ingo Molnar @ 2016-04-19 19:00 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Alexander Shishkin, Chris Phlipot,
Colin Ian King, David Ahern, H. Peter Anvin, Jiri Olsa,
Milian Wolff, Namhyung Kim, Peter Zijlstra, Stephane Eranian,
Stephen Rothwell, Thomas Gleixner, Wang Nan,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
>
> The following changes since commit 9243ae5b28d02dc7d71a4f00c981ef6feaede3f1:
>
> Merge tag 'perf-core-for-mingo-20160415' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2016-04-16 11:09:57 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160419
>
> for you to fetch changes up to 6566feafb4dba4eef30a9c0b25e6f49f996178b6:
>
> perf test: Add missing verbose output explaining the reason for failure (2016-04-19 12:39:36 -0300)
>
> ----------------------------------------------------------------
> perf/core improvements and fixes:
>
> Build fixes:
>
> - Fix 'perf trace' build when DWARF unwind isn't available (Arnaldo Carvalho de Melo)
>
> - Remove x86 references from arch-neutral Build, fixing it in !x86 arches,
> reported as breaking the build for powerpc64le in linux-next (Arnaldo Carvalho de Melo)
>
> Infrastructure:
>
> - Do memset() variable 'st' using the correct size in the jit code (Colin Ian King)
>
> - Fix postgresql ubuntu 'perf script' install instructions (Chris Phlipot)
>
> - Use callchain_param more thoroughly when checking how callchains were
> configured, eventually will be the only way to look for callchain parameters
> (Arnaldo Carvalho de Melo)
>
> - Fix some issues in the 'perf test kallsyms' entry (Arnaldo Carvalho de Melo)
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (12):
> perf trace: Fix build when DWARF unwind isn't available
> perf evsel: Add missign class prefix to has_branch_stack method
> perf script: Check sample->callchain before using it
> perf callchain: Set callchain_param.enabled when parsing --call-graph
> perf report: Use callchain_param.enabled instead of tool specific knob
> perf tools: Ditch record_opts.callgraph_set
> perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs
> perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain
> perf build: Remove x86 references from arch-neutral Build
> perf symbols: Allow loading kallsyms without considering kcore files
> perf test: Ignore kcore files in the "vmlinux matches kallsyms" test
> perf test: Add missing verbose output explaining the reason for failure
>
> Chris Phlipot (1):
> perf script: Fix postgresql ubuntu install instructions
>
> Colin Ian King (1):
> perf jit: memset() variable 'st' using the correct size
>
> tools/perf/builtin-record.c | 14 ++++++-------
> tools/perf/builtin-report.c | 11 +++++-----
> tools/perf/builtin-script.c | 2 +-
> tools/perf/builtin-top.c | 25 +++++++++++------------
> tools/perf/builtin-trace.c | 10 ++++-----
> tools/perf/perf.h | 1 -
> tools/perf/scripts/python/export-to-postgresql.py | 5 ++---
> tools/perf/tests/vmlinux-kallsyms.c | 11 +++++++++-
> tools/perf/ui/browsers/hists.c | 5 ++---
> tools/perf/util/Build | 4 ----
> tools/perf/util/callchain.c | 2 ++
> tools/perf/util/evsel.h | 2 +-
> tools/perf/util/jitdump.c | 4 ++--
> tools/perf/util/machine.c | 14 +++++++++----
> tools/perf/util/machine.h | 2 ++
> tools/perf/util/session.c | 4 ++--
> tools/perf/util/symbol.c | 12 ++++++++---
> tools/perf/util/symbol.h | 2 ++
> 18 files changed, 74 insertions(+), 56 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-04-19 19:00 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-19 15:50 [GIT PULL 00/14] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 01/14] perf trace: Fix build when DWARF unwind isn't available Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 02/14] perf evsel: Add missign class prefix to has_branch_stack method Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 03/14] perf script: Check sample->callchain before using it Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 04/14] perf callchain: Set callchain_param.enabled when parsing --call-graph Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 05/14] perf report: Use callchain_param.enabled instead of tool specific knob Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 06/14] perf tools: Ditch record_opts.callgraph_set Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 07/14] perf hists browser: Fold two consecutive symbol_conf.use_callchain ifs Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 08/14] perf top: Use callchain_param.enabled instead of symbol_conf.use_callchain Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 09/14] perf script: Fix postgresql ubuntu install instructions Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 10/14] perf jit: memset() variable 'st' using the correct size Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 11/14] perf build: Remove x86 references from arch-neutral Build Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 12/14] perf symbols: Allow loading kallsyms without considering kcore files Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 13/14] perf test: Ignore kcore files in the "vmlinux matches kallsyms" test Arnaldo Carvalho de Melo
2016-04-19 15:50 ` [PATCH 14/14] perf test: Add missing verbose output explaining the reason for failure Arnaldo Carvalho de Melo
2016-04-19 19:00 ` [GIT PULL 00/14] perf/core improvements and fixes Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).