Commit 01e985e9 authored by Thadeu Lima de Souza Cascardo's avatar Thadeu Lima de Souza Cascardo Committed by Arnaldo Carvalho de Melo

perf annotate: Fix build on 32 bit for BPF annotation

Commit 6987561c ("perf annotate: Enable annotation of BPF programs") adds
support for BPF programs annotations but the new code does not build on 32-bit.
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Fixes: 6987561c ("perf annotate: Enable annotation of BPF programs")
Link: http://lkml.kernel.org/r/20190403194452.10845-1-cascardo@canonical.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 24e45b49
...@@ -1714,8 +1714,8 @@ static int symbol__disassemble_bpf(struct symbol *sym, ...@@ -1714,8 +1714,8 @@ static int symbol__disassemble_bpf(struct symbol *sym,
if (dso->binary_type != DSO_BINARY_TYPE__BPF_PROG_INFO) if (dso->binary_type != DSO_BINARY_TYPE__BPF_PROG_INFO)
return -1; return -1;
pr_debug("%s: handling sym %s addr %lx len %lx\n", __func__, pr_debug("%s: handling sym %s addr %" PRIx64 " len %" PRIx64 "\n", __func__,
sym->name, sym->start, sym->end - sym->start); sym->name, sym->start, sym->end - sym->start);
memset(tpath, 0, sizeof(tpath)); memset(tpath, 0, sizeof(tpath));
perf_exe(tpath, sizeof(tpath)); perf_exe(tpath, sizeof(tpath));
...@@ -1740,7 +1740,7 @@ static int symbol__disassemble_bpf(struct symbol *sym, ...@@ -1740,7 +1740,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
info_linear = info_node->info_linear; info_linear = info_node->info_linear;
sub_id = dso->bpf_prog.sub_id; sub_id = dso->bpf_prog.sub_id;
info.buffer = (void *)(info_linear->info.jited_prog_insns); info.buffer = (void *)(uintptr_t)(info_linear->info.jited_prog_insns);
info.buffer_length = info_linear->info.jited_prog_len; info.buffer_length = info_linear->info.jited_prog_len;
if (info_linear->info.nr_line_info) if (info_linear->info.nr_line_info)
...@@ -1776,7 +1776,7 @@ static int symbol__disassemble_bpf(struct symbol *sym, ...@@ -1776,7 +1776,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
const char *srcline; const char *srcline;
u64 addr; u64 addr;
addr = pc + ((u64 *)(info_linear->info.jited_ksyms))[sub_id]; addr = pc + ((u64 *)(uintptr_t)(info_linear->info.jited_ksyms))[sub_id];
count = disassemble(pc, &info); count = disassemble(pc, &info);
if (prog_linfo) if (prog_linfo)
......
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