Re: [BUGFIX] Re: [PATCH v2 3/3] perf-probe: Support probing on offline cross-arch binary

From: Arnaldo Carvalho de Melo
Date: Fri Sep 09 2016 - 11:43:37 EST


Em Sat, Sep 10, 2016 at 12:28:07AM +0900, Masami Hiramatsu escreveu:
> On Fri, 9 Sep 2016 11:59:55 -0300
> Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > # diff /tmp/fail /tmp/ok
> > <SNIP>
> > -Writing event: p:perf_bpf_probe/func _text+5197232 f_mode=+68(%di):x32 offset=%si:s64 orig=dx:s32
> > -Failed to write event: Invalid argument
> > -bpf_probe: failed to apply perf probe eventsFailed to add events selected by BPF
> > +Writing event: p:perf_bpf_probe/func _text+5197232 f_mode=+68(%di):x32 offset=%si:s64 orig=%dx:s32
> > <SNIP>

> > Fixed by this patch:

> > +++ b/tools/perf/arch/x86/include/dwarf-regs-table.h
> > @@ -7,7 +7,7 @@ static const char * const x86_32_regstr_tbl[] = {
> > };

> > static const char * const x86_64_regstr_tbl[] = {
> > - "%ax", "dx", "%cx", "%bx", "%si", "%di",
> > + "%ax", "%dx", "%cx", "%bx", "%si", "%di",
> > "%bp", "%sp", "%r8", "%r9", "%r10", "%r11",
> > "%r12", "%r13", "%r14", "%r15",
> > };

> Oops, it's my typo... thank you for reporting and fixing!

Right, but it was my fault as well, I should've payed attention to the
output of 'perf test' and replied to you so that you could figure this
out and resend.

Anyway, its good that this gets exercised by that test, its just a
matter of us making sure that no regressions appear on 'perf test'
before pushing things upstream.

> Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>

Thanks, added it to the patch.

- Arnaldo

- Arnaldo