Skip to content

Commit

Permalink
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Sep 26, 2015
2 parents 7e5560a + b5cabbc commit 2530e39
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 43 deletions.
15 changes: 0 additions & 15 deletions tools/perf/Documentation/intel-pt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -364,21 +364,6 @@ cyc_thresh Specifies how frequently CYC packets are produced - see cyc

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
-------------------
Expand Down
13 changes: 7 additions & 6 deletions tools/perf/util/probe-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,13 @@ static int kernel_get_module_dso(const char *module, struct dso **pdso)
int ret = 0;

if (module) {
list_for_each_entry(dso, &host_machine->dsos.head, node) {
if (!dso->kernel)
continue;
if (strncmp(dso->short_name + 1, module,
dso->short_name_len - 2) == 0)
goto found;
char module_name[128];

snprintf(module_name, sizeof(module_name), "[%s]", module);
map = map_groups__find_by_name(&host_machine->kmaps, MAP__FUNCTION, module_name);
if (map) {
dso = map->dso;
goto found;
}
pr_debug("Failed to find module %s.\n", module);
return -ENOENT;
Expand Down
35 changes: 13 additions & 22 deletions tools/perf/util/symbol-elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
bool temp)
{
GElf_Ehdr *ehdr;

kcore->elfclass = elfclass;

if (temp)
Expand All @@ -1289,9 +1287,7 @@ static int kcore__init(struct kcore *kcore, char *filename, int elfclass,
if (!gelf_newehdr(kcore->elf, elfclass))
goto out_end;

ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr);
if (!ehdr)
goto out_end;
memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr));

return 0;

Expand Down Expand Up @@ -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,
u64 addr, u64 len)
{
GElf_Phdr gphdr;
GElf_Phdr *phdr;

phdr = gelf_getphdr(kcore->elf, idx, &gphdr);
if (!phdr)
return -1;

phdr->p_type = PT_LOAD;
phdr->p_flags = PF_R | PF_W | PF_X;
phdr->p_offset = offset;
phdr->p_vaddr = addr;
phdr->p_paddr = 0;
phdr->p_filesz = len;
phdr->p_memsz = len;
phdr->p_align = page_size;

if (!gelf_update_phdr(kcore->elf, idx, phdr))
GElf_Phdr phdr = {
.p_type = PT_LOAD,
.p_flags = PF_R | PF_W | PF_X,
.p_offset = offset,
.p_vaddr = addr,
.p_paddr = 0,
.p_filesz = len,
.p_memsz = len,
.p_align = page_size,
};

if (!gelf_update_phdr(kcore->elf, idx, &phdr))
return -1;

return 0;
Expand Down

0 comments on commit 2530e39

Please sign in to comment.