Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
This commit is contained in:
commit
b64909af1c
@ -234,8 +234,8 @@ endif
|
||||
|
||||
export PERL_PATH
|
||||
|
||||
FLEX = $(CROSS_COMPILE)flex
|
||||
BISON= $(CROSS_COMPILE)bison
|
||||
FLEX = flex
|
||||
BISON= bison
|
||||
|
||||
$(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
|
||||
|
@ -374,16 +374,23 @@ static int __cmd_report(struct perf_report *rep)
|
||||
(kernel_map->dso->hit &&
|
||||
(kernel_kmap->ref_reloc_sym == NULL ||
|
||||
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(
|
||||
"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"
|
||||
"Samples in kernel modules can't be resolved as well.\n\n",
|
||||
RB_EMPTY_ROOT(&kdso->symbols[MAP__FUNCTION]) ?
|
||||
"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.");
|
||||
desc);
|
||||
}
|
||||
|
||||
if (dump_trace) {
|
||||
|
@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *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)
|
||||
{
|
||||
struct perf_evsel *evsel = list_entry(evlist->entries.next,
|
||||
@ -1091,6 +1113,14 @@ static struct test__event_st {
|
||||
.name = "r1,syscalls:sys_enter_open:k,1:1:hp",
|
||||
.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))
|
||||
|
@ -54,7 +54,7 @@ num_dec [0-9]+
|
||||
num_hex 0x[a-fA-F0-9]+
|
||||
num_raw_hex [a-fA-F0-9]+
|
||||
name [a-zA-Z_*?][a-zA-Z0-9_*?]*
|
||||
modifier_event [ukhp]{1,5}
|
||||
modifier_event [ukhpGH]{1,8}
|
||||
modifier_bp [rwx]
|
||||
|
||||
%%
|
||||
|
@ -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
|
||||
* 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,
|
||||
symbol_filter_t filter)
|
||||
static int
|
||||
dso__synthesize_plt_symbols(struct dso *dso, char *name, struct map *map,
|
||||
symbol_filter_t filter)
|
||||
{
|
||||
uint32_t nr_rel_entries, idx;
|
||||
GElf_Sym sym;
|
||||
@ -993,10 +994,7 @@ static int dso__synthesize_plt_symbols(struct dso *dso, struct map *map,
|
||||
char sympltname[1024];
|
||||
Elf *elf;
|
||||
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);
|
||||
if (fd < 0)
|
||||
goto out;
|
||||
@ -1703,8 +1701,9 @@ restart:
|
||||
continue;
|
||||
|
||||
if (ret > 0) {
|
||||
int nr_plt = dso__synthesize_plt_symbols(dso, map,
|
||||
filter);
|
||||
int nr_plt;
|
||||
|
||||
nr_plt = dso__synthesize_plt_symbols(dso, name, map, filter);
|
||||
if (nr_plt > 0)
|
||||
ret += nr_plt;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user