diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-04-19 14:58:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-04-23 08:50:39 -0400 |
commit | 67d61296ffcc850bffdd4466430cb91e5328f39a (patch) | |
tree | f2092190e27753e358f32ab34ab11b1969e2e4b9 | |
parent | 31b84310c79421d726621e800434c66a48a6c959 (diff) | |
parent | 6566feafb4dba4eef30a9c0b25e6f49f996178b6 (diff) |
Merge tag 'perf-core-for-mingo-20160419' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
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 changes:
- 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>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | tools/perf/builtin-record.c | 14 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 11 | ||||
-rw-r--r-- | tools/perf/builtin-script.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 25 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 10 | ||||
-rw-r--r-- | tools/perf/perf.h | 1 | ||||
-rw-r--r-- | tools/perf/scripts/python/export-to-postgresql.py | 5 | ||||
-rw-r--r-- | tools/perf/tests/vmlinux-kallsyms.c | 11 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 5 | ||||
-rw-r--r-- | tools/perf/util/Build | 4 | ||||
-rw-r--r-- | tools/perf/util/callchain.c | 2 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 2 | ||||
-rw-r--r-- | tools/perf/util/jitdump.c | 4 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 14 | ||||
-rw-r--r-- | tools/perf/util/machine.h | 2 | ||||
-rw-r--r-- | tools/perf/util/session.c | 4 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 12 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 2 |
18 files changed, 74 insertions, 56 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, | |||
946 | const char *arg, bool unset) | 946 | const char *arg, bool unset) |
947 | { | 947 | { |
948 | int ret; | 948 | int ret; |
949 | record->callgraph_set = true; | ||
950 | callchain->enabled = !unset; | 949 | callchain->enabled = !unset; |
951 | 950 | ||
952 | /* --no-call-graph */ | 951 | /* --no-call-graph */ |
@@ -978,15 +977,14 @@ int record_callchain_opt(const struct option *opt, | |||
978 | const char *arg __maybe_unused, | 977 | const char *arg __maybe_unused, |
979 | int unset __maybe_unused) | 978 | int unset __maybe_unused) |
980 | { | 979 | { |
981 | struct record_opts *record = (struct record_opts *)opt->value; | 980 | struct callchain_param *callchain = opt->value; |
982 | 981 | ||
983 | record->callgraph_set = true; | 982 | callchain->enabled = true; |
984 | callchain_param.enabled = true; | ||
985 | 983 | ||
986 | if (callchain_param.record_mode == CALLCHAIN_NONE) | 984 | if (callchain->record_mode == CALLCHAIN_NONE) |
987 | callchain_param.record_mode = CALLCHAIN_FP; | 985 | callchain->record_mode = CALLCHAIN_FP; |
988 | 986 | ||
989 | callchain_debug(&callchain_param); | 987 | callchain_debug(callchain); |
990 | return 0; | 988 | return 0; |
991 | } | 989 | } |
992 | 990 | ||
@@ -1224,7 +1222,7 @@ struct option __record_options[] = { | |||
1224 | record__parse_mmap_pages), | 1222 | record__parse_mmap_pages), |
1225 | OPT_BOOLEAN(0, "group", &record.opts.group, | 1223 | OPT_BOOLEAN(0, "group", &record.opts.group, |
1226 | "put the counters into a counter group"), | 1224 | "put the counters into a counter group"), |
1227 | OPT_CALLBACK_NOOPT('g', NULL, &record.opts, | 1225 | OPT_CALLBACK_NOOPT('g', NULL, &callchain_param, |
1228 | NULL, "enables call-graph recording" , | 1226 | NULL, "enables call-graph recording" , |
1229 | &record_callchain_opt), | 1227 | &record_callchain_opt), |
1230 | OPT_CALLBACK(0, "call-graph", &record.opts, | 1228 | OPT_CALLBACK(0, "call-graph", &record.opts, |
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 { | |||
47 | struct perf_tool tool; | 47 | struct perf_tool tool; |
48 | struct perf_session *session; | 48 | struct perf_session *session; |
49 | bool use_tui, use_gtk, use_stdio; | 49 | bool use_tui, use_gtk, use_stdio; |
50 | bool dont_use_callchains; | ||
51 | bool show_full_info; | 50 | bool show_full_info; |
52 | bool show_threads; | 51 | bool show_threads; |
53 | bool inverted_callchain; | 52 | bool inverted_callchain; |
@@ -247,7 +246,7 @@ static int report__setup_sample_type(struct report *rep) | |||
247 | "you call 'perf record' without -g?\n"); | 246 | "you call 'perf record' without -g?\n"); |
248 | return -1; | 247 | return -1; |
249 | } | 248 | } |
250 | } else if (!rep->dont_use_callchains && | 249 | } else if (!callchain_param.enabled && |
251 | callchain_param.mode != CHAIN_NONE && | 250 | callchain_param.mode != CHAIN_NONE && |
252 | !symbol_conf.use_callchain) { | 251 | !symbol_conf.use_callchain) { |
253 | symbol_conf.use_callchain = true; | 252 | symbol_conf.use_callchain = true; |
@@ -599,13 +598,15 @@ static int __cmd_report(struct report *rep) | |||
599 | static int | 598 | static int |
600 | report_parse_callchain_opt(const struct option *opt, const char *arg, int unset) | 599 | report_parse_callchain_opt(const struct option *opt, const char *arg, int unset) |
601 | { | 600 | { |
602 | struct report *rep = (struct report *)opt->value; | 601 | struct callchain_param *callchain = opt->value; |
603 | 602 | ||
603 | callchain->enabled = !unset; | ||
604 | /* | 604 | /* |
605 | * --no-call-graph | 605 | * --no-call-graph |
606 | */ | 606 | */ |
607 | if (unset) { | 607 | if (unset) { |
608 | rep->dont_use_callchains = true; | 608 | symbol_conf.use_callchain = false; |
609 | callchain->mode = CHAIN_NONE; | ||
609 | return 0; | 610 | return 0; |
610 | } | 611 | } |
611 | 612 | ||
@@ -734,7 +735,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) | |||
734 | "regex filter to identify parent, see: '--sort parent'"), | 735 | "regex filter to identify parent, see: '--sort parent'"), |
735 | OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, | 736 | OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other, |
736 | "Only display entries with parent-match"), | 737 | "Only display entries with parent-match"), |
737 | OPT_CALLBACK_DEFAULT('g', "call-graph", &report, | 738 | OPT_CALLBACK_DEFAULT('g', "call-graph", &callchain_param, |
738 | "print_type,threshold[,print_limit],order,sort_key[,branch],value", | 739 | "print_type,threshold[,print_limit],order,sort_key[,branch],value", |
739 | report_callchain_help, &report_parse_callchain_opt, | 740 | report_callchain_help, &report_parse_callchain_opt, |
740 | callchain_default_opt), | 741 | callchain_default_opt), |
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, | |||
791 | if (PRINT_FIELD(IP)) { | 791 | if (PRINT_FIELD(IP)) { |
792 | struct callchain_cursor *cursor = NULL, cursor_callchain; | 792 | struct callchain_cursor *cursor = NULL, cursor_callchain; |
793 | 793 | ||
794 | if (symbol_conf.use_callchain && | 794 | if (symbol_conf.use_callchain && sample->callchain && |
795 | thread__resolve_callchain(al->thread, &cursor_callchain, evsel, | 795 | thread__resolve_callchain(al->thread, &cursor_callchain, evsel, |
796 | sample, NULL, NULL, scripting_max_stack) == 0) | 796 | sample, NULL, NULL, scripting_max_stack) == 0) |
797 | cursor = &cursor_callchain; | 797 | cursor = &cursor_callchain; |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 8846df0ec0c3..c130a11d3a0d 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -917,15 +917,15 @@ out_err: | |||
917 | return -1; | 917 | return -1; |
918 | } | 918 | } |
919 | 919 | ||
920 | static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused) | 920 | static int callchain_param__setup_sample_type(struct callchain_param *callchain) |
921 | { | 921 | { |
922 | if (!sort__has_sym) { | 922 | if (!sort__has_sym) { |
923 | if (symbol_conf.use_callchain) { | 923 | if (callchain->enabled) { |
924 | ui__error("Selected -g but \"sym\" not present in --sort/-s."); | 924 | ui__error("Selected -g but \"sym\" not present in --sort/-s."); |
925 | return -EINVAL; | 925 | return -EINVAL; |
926 | } | 926 | } |
927 | } else if (callchain_param.mode != CHAIN_NONE) { | 927 | } else if (callchain->mode != CHAIN_NONE) { |
928 | if (callchain_register_param(&callchain_param) < 0) { | 928 | if (callchain_register_param(callchain) < 0) { |
929 | ui__error("Can't register callchain params.\n"); | 929 | ui__error("Can't register callchain params.\n"); |
930 | return -EINVAL; | 930 | return -EINVAL; |
931 | } | 931 | } |
@@ -952,7 +952,7 @@ static int __cmd_top(struct perf_top *top) | |||
952 | goto out_delete; | 952 | goto out_delete; |
953 | } | 953 | } |
954 | 954 | ||
955 | ret = perf_top__setup_sample_type(top); | 955 | ret = callchain_param__setup_sample_type(&callchain_param); |
956 | if (ret) | 956 | if (ret) |
957 | goto out_delete; | 957 | goto out_delete; |
958 | 958 | ||
@@ -1045,18 +1045,17 @@ callchain_opt(const struct option *opt, const char *arg, int unset) | |||
1045 | static int | 1045 | static int |
1046 | parse_callchain_opt(const struct option *opt, const char *arg, int unset) | 1046 | parse_callchain_opt(const struct option *opt, const char *arg, int unset) |
1047 | { | 1047 | { |
1048 | struct record_opts *record = (struct record_opts *)opt->value; | 1048 | struct callchain_param *callchain = opt->value; |
1049 | 1049 | ||
1050 | record->callgraph_set = true; | 1050 | callchain->enabled = !unset; |
1051 | callchain_param.enabled = !unset; | 1051 | callchain->record_mode = CALLCHAIN_FP; |
1052 | callchain_param.record_mode = CALLCHAIN_FP; | ||
1053 | 1052 | ||
1054 | /* | 1053 | /* |
1055 | * --no-call-graph | 1054 | * --no-call-graph |
1056 | */ | 1055 | */ |
1057 | if (unset) { | 1056 | if (unset) { |
1058 | symbol_conf.use_callchain = false; | 1057 | symbol_conf.use_callchain = false; |
1059 | callchain_param.record_mode = CALLCHAIN_NONE; | 1058 | callchain->record_mode = CALLCHAIN_NONE; |
1060 | return 0; | 1059 | return 0; |
1061 | } | 1060 | } |
1062 | 1061 | ||
@@ -1162,10 +1161,10 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1162 | "output field(s): overhead, period, sample plus all of sort keys"), | 1161 | "output field(s): overhead, period, sample plus all of sort keys"), |
1163 | OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, | 1162 | OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, |
1164 | "Show a column with the number of samples"), | 1163 | "Show a column with the number of samples"), |
1165 | OPT_CALLBACK_NOOPT('g', NULL, &top.record_opts, | 1164 | OPT_CALLBACK_NOOPT('g', NULL, &callchain_param, |
1166 | NULL, "enables call-graph recording and display", | 1165 | NULL, "enables call-graph recording and display", |
1167 | &callchain_opt), | 1166 | &callchain_opt), |
1168 | OPT_CALLBACK(0, "call-graph", &top.record_opts, | 1167 | OPT_CALLBACK(0, "call-graph", &callchain_param, |
1169 | "record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]", | 1168 | "record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]", |
1170 | top_callchain_help, &parse_callchain_opt), | 1169 | top_callchain_help, &parse_callchain_opt), |
1171 | OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain, | 1170 | OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain, |
@@ -1312,7 +1311,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1312 | 1311 | ||
1313 | top.sym_evsel = perf_evlist__first(top.evlist); | 1312 | top.sym_evsel = perf_evlist__first(top.evlist); |
1314 | 1313 | ||
1315 | if (!symbol_conf.use_callchain) { | 1314 | if (!callchain_param.enabled) { |
1316 | symbol_conf.cumulate_callchain = false; | 1315 | symbol_conf.cumulate_callchain = false; |
1317 | perf_hpp__cancel_cumulate(); | 1316 | perf_hpp__cancel_cumulate(); |
1318 | } | 1317 | } |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 026ec0c749b0..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) | |||
2457 | perf_evlist__add(evlist, sys_enter); | 2457 | perf_evlist__add(evlist, sys_enter); |
2458 | perf_evlist__add(evlist, sys_exit); | 2458 | perf_evlist__add(evlist, sys_exit); |
2459 | 2459 | ||
2460 | if (trace->opts.callgraph_set && !trace->kernel_syscallchains) { | 2460 | if (callchain_param.enabled && !trace->kernel_syscallchains) { |
2461 | /* | 2461 | /* |
2462 | * We're interested only in the user space callchain | 2462 | * We're interested only in the user space callchain |
2463 | * leading to the syscall, allow overriding that for | 2463 | * leading to the syscall, allow overriding that for |
@@ -2546,7 +2546,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) | |||
2546 | 2546 | ||
2547 | perf_evlist__config(evlist, &trace->opts, NULL); | 2547 | perf_evlist__config(evlist, &trace->opts, NULL); |
2548 | 2548 | ||
2549 | if (trace->opts.callgraph_set && trace->syscalls.events.sys_exit) { | 2549 | if (callchain_param.enabled && trace->syscalls.events.sys_exit) { |
2550 | perf_evsel__config_callchain(trace->syscalls.events.sys_exit, | 2550 | perf_evsel__config_callchain(trace->syscalls.events.sys_exit, |
2551 | &trace->opts, &callchain_param); | 2551 | &trace->opts, &callchain_param); |
2552 | /* | 2552 | /* |
@@ -3109,7 +3109,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused) | |||
3109 | "per thread proc mmap processing timeout in ms"), | 3109 | "per thread proc mmap processing timeout in ms"), |
3110 | OPT_END() | 3110 | OPT_END() |
3111 | }; | 3111 | }; |
3112 | bool max_stack_user_set = true; | 3112 | bool __maybe_unused max_stack_user_set = true; |
3113 | bool mmap_pages_user_set = true; | 3113 | bool mmap_pages_user_set = true; |
3114 | const char * const trace_subcommands[] = { "record", NULL }; | 3114 | const char * const trace_subcommands[] = { "record", NULL }; |
3115 | int err; | 3115 | int err; |
@@ -3153,11 +3153,11 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused) | |||
3153 | } | 3153 | } |
3154 | 3154 | ||
3155 | #ifdef HAVE_DWARF_UNWIND_SUPPORT | 3155 | #ifdef HAVE_DWARF_UNWIND_SUPPORT |
3156 | if ((trace.min_stack || max_stack_user_set) && !trace.opts.callgraph_set) | 3156 | if ((trace.min_stack || max_stack_user_set) && !callchain_param.enabled) |
3157 | record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false); | 3157 | record_opts__parse_callchain(&trace.opts, &callchain_param, "dwarf", false); |
3158 | #endif | 3158 | #endif |
3159 | 3159 | ||
3160 | if (trace.opts.callgraph_set) { | 3160 | if (callchain_param.enabled) { |
3161 | if (!mmap_pages_user_set && geteuid() == 0) | 3161 | if (!mmap_pages_user_set && geteuid() == 0) |
3162 | trace.opts.mmap_pages = perf_event_mlock_kb_in_pages() * 4; | 3162 | trace.opts.mmap_pages = perf_event_mlock_kb_in_pages() * 4; |
3163 | 3163 | ||
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 { | |||
52 | bool sample_weight; | 52 | bool sample_weight; |
53 | bool sample_time; | 53 | bool sample_time; |
54 | bool sample_time_set; | 54 | bool sample_time_set; |
55 | bool callgraph_set; | ||
56 | bool period; | 55 | bool period; |
57 | bool running_time; | 56 | bool running_time; |
58 | bool full_auxtrace; | 57 | bool full_auxtrace; |
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 | |||
34 | # | 34 | # |
35 | # ubuntu: | 35 | # ubuntu: |
36 | # | 36 | # |
37 | # $ sudo apt-get install postgresql | 37 | # $ sudo apt-get install postgresql python-pyside.qtsql libqt4-sql-psql |
38 | # $ sudo su - postgres | 38 | # $ sudo su - postgres |
39 | # $ createuser <your user id here> | 39 | # $ createuser -s <your user id here> |
40 | # Shall the new role be a superuser? (y/n) y | ||
41 | # | 40 | # |
42 | # An example of using this script with Intel PT: | 41 | # An example of using this script with Intel PT: |
43 | # | 42 | # |
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c index 630b0b409b97..e63abab7d5a1 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) | |||
54 | * Step 3: | 54 | * Step 3: |
55 | * | 55 | * |
56 | * Load and split /proc/kallsyms into multiple maps, one per module. | 56 | * Load and split /proc/kallsyms into multiple maps, one per module. |
57 | * Do not use kcore, as this test was designed before kcore support | ||
58 | * and has parts that only make sense if using the non-kcore code. | ||
59 | * XXX: extend it to stress the kcorre code as well, hint: the list | ||
60 | * of modules extracted from /proc/kcore, in its current form, can't | ||
61 | * be compacted against the list of modules found in the "vmlinux" | ||
62 | * code and with the one got from /proc/modules from the "kallsyms" code. | ||
57 | */ | 63 | */ |
58 | if (machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, NULL) <= 0) { | 64 | if (__machine__load_kallsyms(&kallsyms, "/proc/kallsyms", type, true, NULL) <= 0) { |
59 | pr_debug("dso__load_kallsyms "); | 65 | pr_debug("dso__load_kallsyms "); |
60 | goto out; | 66 | goto out; |
61 | } | 67 | } |
@@ -157,6 +163,9 @@ next_pair: | |||
157 | 163 | ||
158 | pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n", | 164 | pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n", |
159 | mem_start, sym->name, pair->name); | 165 | mem_start, sym->name, pair->name); |
166 | } else { | ||
167 | pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n", | ||
168 | mem_start, sym->name, first_pair->name); | ||
160 | } | 169 | } |
161 | } | 170 | } |
162 | } else | 171 | } else |
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, | |||
1896 | bool first = true; | 1896 | bool first = true; |
1897 | int ret; | 1897 | int ret; |
1898 | 1898 | ||
1899 | if (symbol_conf.use_callchain) | 1899 | if (symbol_conf.use_callchain) { |
1900 | folded_sign = hist_entry__folded(he); | 1900 | folded_sign = hist_entry__folded(he); |
1901 | |||
1902 | if (symbol_conf.use_callchain) | ||
1903 | printed += fprintf(fp, "%c ", folded_sign); | 1901 | printed += fprintf(fp, "%c ", folded_sign); |
1902 | } | ||
1904 | 1903 | ||
1905 | hists__for_each_format(browser->hists, fmt) { | 1904 | hists__for_each_format(browser->hists, fmt) { |
1906 | if (perf_hpp__should_skip(fmt, he->hists)) | 1905 | if (perf_hpp__should_skip(fmt, he->hists)) |
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 | |||
150 | CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" | 150 | CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" |
151 | CFLAGS_parse-events.o += -Wno-redundant-decls | 151 | CFLAGS_parse-events.o += -Wno-redundant-decls |
152 | 152 | ||
153 | $(OUTPUT)util/syscalltbl.o: util/syscalltbl.c arch/x86/entry/syscalls/syscall_64.tbl $(OUTPUT)arch/x86/include/generated/asm/syscalls_64.c FORCE | ||
154 | $(call rule_mkdir) | ||
155 | $(call if_changed_dep,cc_o_c) | ||
156 | |||
157 | $(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE | 153 | $(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE |
158 | $(call rule_mkdir) | 154 | $(call rule_mkdir) |
159 | $(call if_changed_dep,cc_o_c) | 155 | $(call if_changed_dep,cc_o_c) |
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) | |||
109 | bool record_opt_set = false; | 109 | bool record_opt_set = false; |
110 | bool try_stack_size = false; | 110 | bool try_stack_size = false; |
111 | 111 | ||
112 | callchain_param.enabled = true; | ||
112 | symbol_conf.use_callchain = true; | 113 | symbol_conf.use_callchain = true; |
113 | 114 | ||
114 | if (!arg) | 115 | if (!arg) |
@@ -117,6 +118,7 @@ __parse_callchain_report_opt(const char *arg, bool allow_record_opt) | |||
117 | while ((tok = strtok((char *)arg, ",")) != NULL) { | 118 | while ((tok = strtok((char *)arg, ",")) != NULL) { |
118 | if (!strncmp(tok, "none", strlen(tok))) { | 119 | if (!strncmp(tok, "none", strlen(tok))) { |
119 | callchain_param.mode = CHAIN_NONE; | 120 | callchain_param.mode = CHAIN_NONE; |
121 | callchain_param.enabled = false; | ||
120 | symbol_conf.use_callchain = false; | 122 | symbol_conf.use_callchain = false; |
121 | return 0; | 123 | return 0; |
122 | } | 124 | } |
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); \ | |||
420 | (_evsel) && (_evsel)->leader == (_leader); \ | 420 | (_evsel) && (_evsel)->leader == (_leader); \ |
421 | (_evsel) = list_entry((_evsel)->node.next, struct perf_evsel, node)) | 421 | (_evsel) = list_entry((_evsel)->node.next, struct perf_evsel, node)) |
422 | 422 | ||
423 | static inline bool has_branch_callstack(struct perf_evsel *evsel) | 423 | static inline bool perf_evsel__has_branch_callstack(const struct perf_evsel *evsel) |
424 | { | 424 | { |
425 | return evsel->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; | 425 | return evsel->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK; |
426 | } | 426 | } |
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) | |||
412 | return -1; | 412 | return -1; |
413 | } | 413 | } |
414 | if (stat(filename, &st)) | 414 | if (stat(filename, &st)) |
415 | memset(&st, 0, sizeof(stat)); | 415 | memset(&st, 0, sizeof(st)); |
416 | 416 | ||
417 | event->mmap2.header.type = PERF_RECORD_MMAP2; | 417 | event->mmap2.header.type = PERF_RECORD_MMAP2; |
418 | event->mmap2.header.misc = PERF_RECORD_MISC_USER; | 418 | 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) | |||
500 | size++; /* for \0 */ | 500 | size++; /* for \0 */ |
501 | 501 | ||
502 | if (stat(filename, &st)) | 502 | if (stat(filename, &st)) |
503 | memset(&st, 0, sizeof(stat)); | 503 | memset(&st, 0, sizeof(st)); |
504 | 504 | ||
505 | size = PERF_ALIGN(size, sizeof(u64)); | 505 | size = PERF_ALIGN(size, sizeof(u64)); |
506 | 506 | ||
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 0c4dabc69932..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) | |||
908 | return machine__create_kernel_maps(machine); | 908 | return machine__create_kernel_maps(machine); |
909 | } | 909 | } |
910 | 910 | ||
911 | int machine__load_kallsyms(struct machine *machine, const char *filename, | 911 | int __machine__load_kallsyms(struct machine *machine, const char *filename, |
912 | enum map_type type, symbol_filter_t filter) | 912 | enum map_type type, bool no_kcore, symbol_filter_t filter) |
913 | { | 913 | { |
914 | struct map *map = machine__kernel_map(machine); | 914 | struct map *map = machine__kernel_map(machine); |
915 | int ret = dso__load_kallsyms(map->dso, filename, map, filter); | 915 | int ret = __dso__load_kallsyms(map->dso, filename, map, no_kcore, filter); |
916 | 916 | ||
917 | if (ret > 0) { | 917 | if (ret > 0) { |
918 | dso__set_loaded(map->dso, type); | 918 | dso__set_loaded(map->dso, type); |
@@ -927,6 +927,12 @@ int machine__load_kallsyms(struct machine *machine, const char *filename, | |||
927 | return ret; | 927 | return ret; |
928 | } | 928 | } |
929 | 929 | ||
930 | int machine__load_kallsyms(struct machine *machine, const char *filename, | ||
931 | enum map_type type, symbol_filter_t filter) | ||
932 | { | ||
933 | return __machine__load_kallsyms(machine, filename, type, false, filter); | ||
934 | } | ||
935 | |||
930 | int machine__load_vmlinux_path(struct machine *machine, enum map_type type, | 936 | int machine__load_vmlinux_path(struct machine *machine, enum map_type type, |
931 | symbol_filter_t filter) | 937 | symbol_filter_t filter) |
932 | { | 938 | { |
@@ -1808,7 +1814,7 @@ static int thread__resolve_callchain_sample(struct thread *thread, | |||
1808 | 1814 | ||
1809 | callchain_cursor_reset(cursor); | 1815 | callchain_cursor_reset(cursor); |
1810 | 1816 | ||
1811 | if (has_branch_callstack(evsel)) { | 1817 | if (perf_evsel__has_branch_callstack(evsel)) { |
1812 | err = resolve_lbr_callchain_sample(thread, cursor, sample, parent, | 1818 | err = resolve_lbr_callchain_sample(thread, cursor, sample, parent, |
1813 | root_al, max_stack); | 1819 | root_al, max_stack); |
1814 | if (err) | 1820 | if (err) |
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, | |||
215 | struct map *machine__findnew_module_map(struct machine *machine, u64 start, | 215 | struct map *machine__findnew_module_map(struct machine *machine, u64 start, |
216 | const char *filename); | 216 | const char *filename); |
217 | 217 | ||
218 | int __machine__load_kallsyms(struct machine *machine, const char *filename, | ||
219 | enum map_type type, bool no_kcore, symbol_filter_t filter); | ||
218 | int machine__load_kallsyms(struct machine *machine, const char *filename, | 220 | int machine__load_kallsyms(struct machine *machine, const char *filename, |
219 | enum map_type type, symbol_filter_t filter); | 221 | enum map_type type, symbol_filter_t filter); |
220 | int machine__load_vmlinux_path(struct machine *machine, enum map_type type, | 222 | int machine__load_vmlinux_path(struct machine *machine, enum map_type type, |
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, | |||
907 | unsigned int i; | 907 | unsigned int i; |
908 | struct ip_callchain *callchain = sample->callchain; | 908 | struct ip_callchain *callchain = sample->callchain; |
909 | 909 | ||
910 | if (has_branch_callstack(evsel)) | 910 | if (perf_evsel__has_branch_callstack(evsel)) |
911 | callchain__lbr_callstack_printf(sample); | 911 | callchain__lbr_callstack_printf(sample); |
912 | 912 | ||
913 | printf("... FP chain: nr:%" PRIu64 "\n", callchain->nr); | 913 | printf("... FP chain: nr:%" PRIu64 "\n", callchain->nr); |
@@ -1081,7 +1081,7 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event, | |||
1081 | if (sample_type & PERF_SAMPLE_CALLCHAIN) | 1081 | if (sample_type & PERF_SAMPLE_CALLCHAIN) |
1082 | callchain__printf(evsel, sample); | 1082 | callchain__printf(evsel, sample); |
1083 | 1083 | ||
1084 | if ((sample_type & PERF_SAMPLE_BRANCH_STACK) && !has_branch_callstack(evsel)) | 1084 | if ((sample_type & PERF_SAMPLE_BRANCH_STACK) && !perf_evsel__has_branch_callstack(evsel)) |
1085 | branch_stack__printf(sample); | 1085 | branch_stack__printf(sample); |
1086 | 1086 | ||
1087 | if (sample_type & PERF_SAMPLE_REGS_USER) | 1087 | if (sample_type & PERF_SAMPLE_REGS_USER) |
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) | |||
1208 | return 0; | 1208 | return 0; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | int dso__load_kallsyms(struct dso *dso, const char *filename, | 1211 | int __dso__load_kallsyms(struct dso *dso, const char *filename, |
1212 | struct map *map, symbol_filter_t filter) | 1212 | struct map *map, bool no_kcore, symbol_filter_t filter) |
1213 | { | 1213 | { |
1214 | u64 delta = 0; | 1214 | u64 delta = 0; |
1215 | 1215 | ||
@@ -1230,12 +1230,18 @@ int dso__load_kallsyms(struct dso *dso, const char *filename, | |||
1230 | else | 1230 | else |
1231 | dso->symtab_type = DSO_BINARY_TYPE__KALLSYMS; | 1231 | dso->symtab_type = DSO_BINARY_TYPE__KALLSYMS; |
1232 | 1232 | ||
1233 | if (!dso__load_kcore(dso, map, filename)) | 1233 | if (!no_kcore && !dso__load_kcore(dso, map, filename)) |
1234 | return dso__split_kallsyms_for_kcore(dso, map, filter); | 1234 | return dso__split_kallsyms_for_kcore(dso, map, filter); |
1235 | else | 1235 | else |
1236 | return dso__split_kallsyms(dso, map, delta, filter); | 1236 | return dso__split_kallsyms(dso, map, delta, filter); |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | int dso__load_kallsyms(struct dso *dso, const char *filename, | ||
1240 | struct map *map, symbol_filter_t filter) | ||
1241 | { | ||
1242 | return __dso__load_kallsyms(dso, filename, map, false, filter); | ||
1243 | } | ||
1244 | |||
1239 | static int dso__load_perf_map(struct dso *dso, struct map *map, | 1245 | static int dso__load_perf_map(struct dso *dso, struct map *map, |
1240 | symbol_filter_t filter) | 1246 | symbol_filter_t filter) |
1241 | { | 1247 | { |
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, | |||
240 | symbol_filter_t filter); | 240 | symbol_filter_t filter); |
241 | int dso__load_vmlinux_path(struct dso *dso, struct map *map, | 241 | int dso__load_vmlinux_path(struct dso *dso, struct map *map, |
242 | symbol_filter_t filter); | 242 | symbol_filter_t filter); |
243 | int __dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map, | ||
244 | bool no_kcore, symbol_filter_t filter); | ||
243 | int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map, | 245 | int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map, |
244 | symbol_filter_t filter); | 246 | symbol_filter_t filter); |
245 | 247 | ||