Commit 2530e399 authored by Ingo Molnar's avatar Ingo Molnar

Merge tag 'perf-urgent-for-mingo' of...

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

  - Fix copying of /proc/kcore made to the ~/.debug/ DSO cache to allow using
    objdump with kcore files. (Adrian Hunter)

  - Fix adding perf probes in kernel module functions. (Arnaldo Carvalho de Melo)
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 7e5560a5 b5cabbcb
...@@ -364,21 +364,6 @@ cyc_thresh Specifies how frequently CYC packets are produced - see cyc ...@@ -364,21 +364,6 @@ cyc_thresh Specifies how frequently CYC packets are produced - see cyc
CYC packets are not requested by default. CYC packets are not requested by default.
no_force_psb This is a driver option and is not in the IA32_RTIT_CTL MSR.
It stops the driver resetting the byte count to zero whenever
enabling the trace (for example on context switches) which in
turn results in no PSB being forced. However some processors
will produce a PSB anyway.
In any case, there is still a PSB when the trace is enabled for
the first time.
no_force_psb can be used to slightly decrease the trace size but
may make it harder for the decoder to recover from errors.
no_force_psb is not selected by default.
new snapshot option new snapshot option
------------------- -------------------
......
...@@ -270,11 +270,12 @@ static int kernel_get_module_dso(const char *module, struct dso **pdso) ...@@ -270,11 +270,12 @@ static int kernel_get_module_dso(const char *module, struct dso **pdso)
int ret = 0; int ret = 0;
if (module) { if (module) {
list_for_each_entry(dso, &host_machine->dsos.head, node) { char module_name[128];
if (!dso->kernel)
continue; snprintf(module_name, sizeof(module_name), "[%s]", module);
if (strncmp(dso->short_name + 1, module, map = map_groups__find_by_name(&host_machine->kmaps, MAP__FUNCTION, module_name);
dso->short_name_len - 2) == 0) if (map) {
dso = map->dso;
goto found; goto found;
} }
pr_debug("Failed to find module %s.\n", module); pr_debug("Failed to find module %s.\n", module);
......
...@@ -1271,8 +1271,6 @@ static int kcore__open(struct kcore *kcore, const char *filename) ...@@ -1271,8 +1271,6 @@ static int kcore__open(struct kcore *kcore, const char *filename)
static int kcore__init(struct kcore *kcore, char *filename, int elfclass, static int kcore__init(struct kcore *kcore, char *filename, int elfclass,
bool temp) bool temp)
{ {
GElf_Ehdr *ehdr;
kcore->elfclass = elfclass; kcore->elfclass = elfclass;
if (temp) if (temp)
...@@ -1289,9 +1287,7 @@ static int kcore__init(struct kcore *kcore, char *filename, int elfclass, ...@@ -1289,9 +1287,7 @@ static int kcore__init(struct kcore *kcore, char *filename, int elfclass,
if (!gelf_newehdr(kcore->elf, elfclass)) if (!gelf_newehdr(kcore->elf, elfclass))
goto out_end; goto out_end;
ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr); memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr));
if (!ehdr)
goto out_end;
return 0; return 0;
...@@ -1348,23 +1344,18 @@ static int kcore__copy_hdr(struct kcore *from, struct kcore *to, size_t count) ...@@ -1348,23 +1344,18 @@ static int kcore__copy_hdr(struct kcore *from, struct kcore *to, size_t count)
static int kcore__add_phdr(struct kcore *kcore, int idx, off_t offset, static int kcore__add_phdr(struct kcore *kcore, int idx, off_t offset,
u64 addr, u64 len) u64 addr, u64 len)
{ {
GElf_Phdr gphdr; GElf_Phdr phdr = {
GElf_Phdr *phdr; .p_type = PT_LOAD,
.p_flags = PF_R | PF_W | PF_X,
phdr = gelf_getphdr(kcore->elf, idx, &gphdr); .p_offset = offset,
if (!phdr) .p_vaddr = addr,
return -1; .p_paddr = 0,
.p_filesz = len,
phdr->p_type = PT_LOAD; .p_memsz = len,
phdr->p_flags = PF_R | PF_W | PF_X; .p_align = page_size,
phdr->p_offset = offset; };
phdr->p_vaddr = addr;
phdr->p_paddr = 0; if (!gelf_update_phdr(kcore->elf, idx, &phdr))
phdr->p_filesz = len;
phdr->p_memsz = len;
phdr->p_align = page_size;
if (!gelf_update_phdr(kcore->elf, idx, phdr))
return -1; return -1;
return 0; return 0;
......
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