Commit b64909af authored by Ingo Molnar's avatar Ingo Molnar

Merge branch 'perf/urgent' of...

Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
parents 6c7b8e82 33ff581e
...@@ -234,8 +234,8 @@ endif ...@@ -234,8 +234,8 @@ endif
export PERL_PATH export PERL_PATH
FLEX = $(CROSS_COMPILE)flex FLEX = flex
BISON= $(CROSS_COMPILE)bison BISON= bison
$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-flex.c: util/parse-events.l
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c
......
...@@ -374,16 +374,23 @@ static int __cmd_report(struct perf_report *rep) ...@@ -374,16 +374,23 @@ static int __cmd_report(struct perf_report *rep)
(kernel_map->dso->hit && (kernel_map->dso->hit &&
(kernel_kmap->ref_reloc_sym == NULL || (kernel_kmap->ref_reloc_sym == NULL ||
kernel_kmap->ref_reloc_sym->addr == 0))) { kernel_kmap->ref_reloc_sym->addr == 0))) {
const struct dso *kdso = kernel_map->dso; const char *desc =
"As no suitable kallsyms nor vmlinux was found, kernel samples\n"
"can't be resolved.";
if (kernel_map) {
const struct dso *kdso = kernel_map->dso;
if (!RB_EMPTY_ROOT(&kdso->symbols[MAP__FUNCTION])) {
desc = "If some relocation was applied (e.g. "
"kexec) symbols may be misresolved.";
}
}
ui__warning( ui__warning(
"Kernel address maps (/proc/{kallsyms,modules}) were restricted.\n\n" "Kernel address maps (/proc/{kallsyms,modules}) were restricted.\n\n"
"Check /proc/sys/kernel/kptr_restrict before running 'perf record'.\n\n%s\n\n" "Check /proc/sys/kernel/kptr_restrict before running 'perf record'.\n\n%s\n\n"
"Samples in kernel modules can't be resolved as well.\n\n", "Samples in kernel modules can't be resolved as well.\n\n",
RB_EMPTY_ROOT(&kdso->symbols[MAP__FUNCTION]) ? desc);
"As no suitable kallsyms nor vmlinux was found, kernel samples\n"
"can't be resolved." :
"If some relocation was applied (e.g. kexec) symbols may be misresolved.");
} }
if (dump_trace) { if (dump_trace) {
......
...@@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist) ...@@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist)
return test__checkevent_symbolic_name(evlist); return test__checkevent_symbolic_name(evlist);
} }
static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = list_entry(evlist->entries.next,
struct perf_evsel, node);
TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest);
TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host);
return test__checkevent_symbolic_name(evlist);
}
static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = list_entry(evlist->entries.next,
struct perf_evsel, node);
TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest);
TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host);
return test__checkevent_symbolic_name(evlist);
}
static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist)
{ {
struct perf_evsel *evsel = list_entry(evlist->entries.next, struct perf_evsel *evsel = list_entry(evlist->entries.next,
...@@ -1091,6 +1113,14 @@ static struct test__event_st { ...@@ -1091,6 +1113,14 @@ static struct test__event_st {
.name = "r1,syscalls:sys_enter_open:k,1:1:hp", .name = "r1,syscalls:sys_enter_open:k,1:1:hp",
.check = test__checkevent_list, .check = test__checkevent_list,
}, },
{
.name = "instructions:G",
.check = test__checkevent_exclude_host_modifier,
},
{
.name = "instructions:H",
.check = test__checkevent_exclude_guest_modifier,
},
}; };
#define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st))
......
...@@ -54,7 +54,7 @@ num_dec [0-9]+ ...@@ -54,7 +54,7 @@ num_dec [0-9]+
num_hex 0x[a-fA-F0-9]+ num_hex 0x[a-fA-F0-9]+
num_raw_hex [a-fA-F0-9]+ num_raw_hex [a-fA-F0-9]+
name [a-zA-Z_*?][a-zA-Z0-9_*?]* name [a-zA-Z_*?][a-zA-Z0-9_*?]*
modifier_event [ukhp]{1,5} modifier_event [ukhpGH]{1,8}
modifier_bp [rwx] modifier_bp [rwx]
%% %%
......
...@@ -977,8 +977,9 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, ...@@ -977,8 +977,9 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
* And always look at the original dso, not at debuginfo packages, that * And always look at the original dso, not at debuginfo packages, that
* have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS). * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
*/ */
static int dso__synthesize_plt_symbols(struct dso *dso, struct map *map, static int
symbol_filter_t filter) dso__synthesize_plt_symbols(struct dso *dso, char *name, struct map *map,
symbol_filter_t filter)
{ {
uint32_t nr_rel_entries, idx; uint32_t nr_rel_entries, idx;
GElf_Sym sym; GElf_Sym sym;
...@@ -993,10 +994,7 @@ static int dso__synthesize_plt_symbols(struct dso *dso, struct map *map, ...@@ -993,10 +994,7 @@ static int dso__synthesize_plt_symbols(struct dso *dso, struct map *map,
char sympltname[1024]; char sympltname[1024];
Elf *elf; Elf *elf;
int nr = 0, symidx, fd, err = 0; int nr = 0, symidx, fd, err = 0;
char name[PATH_MAX];
snprintf(name, sizeof(name), "%s%s",
symbol_conf.symfs, dso->long_name);
fd = open(name, O_RDONLY); fd = open(name, O_RDONLY);
if (fd < 0) if (fd < 0)
goto out; goto out;
...@@ -1703,8 +1701,9 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) ...@@ -1703,8 +1701,9 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
continue; continue;
if (ret > 0) { if (ret > 0) {
int nr_plt = dso__synthesize_plt_symbols(dso, map, int nr_plt;
filter);
nr_plt = dso__synthesize_plt_symbols(dso, name, map, filter);
if (nr_plt > 0) if (nr_plt > 0)
ret += nr_plt; ret += nr_plt;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment