Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1216912

Re: [PATCH 23/31] perf tools: Introduce regs_query_register_offset() for x86

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 23/31] perf tools: Introduce regs_query_register_offset() for x86
Date 2015-09-01 17:00 +0200
Message-ID <q3Vcv-1fz-61@gated-at.bofh.it> (permalink)
References <q2FWc-7Rj-59@gated-at.bofh.it> <q3NRE-7PA-17@gated-at.bofh.it> <q3NRD-7PA-15@gated-at.bofh.it> <q3SeC-5tT-9@gated-at.bofh.it> <q3Ugr-8lN-35@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Tue, Sep 01, 2015 at 09:52:30PM +0800, Wangnan (F) escreveu:
> On 2015/9/1 19:47, 平松雅巳 / HIRAMATU,MASAMI wrote:
> >>From: Wang Nan [mailto:wangnan0@huawei.com]
> >>regs_query_register_offset() is a helper function which converts
> >>register name like "%rax" to offset of a register in 'struct pt_regs',
> >>which is required by BPF prologue generator. Since the function is
> >>identical, try to reuse the code in arch/x86/kernel/ptrace.c.

> >>Comment inside dwarf-regs.c list the differences between this
> >>implementation and kernel code.
> >Hmm, this also introduce a duplication of the code...
> >It might be a good time to move them into arch/x86/lib/ and
> >reuse it directly from perf code.
 
> So you want to move it from ./arch/x86/kernel/ptrace.c to arch/x86/lib and
> let perf link against arch/x86/lib/lib.a to use it?
 
> I think it worth a specific work to do it. Currently we lake
> scaffold to compile and link against the kernel side library. Moreover,
> we should also consider other archs. Seems not very easy.
 
> This is not the only one file which can benifite from kernel's arch/x86/lib
> Newly introduced tools/perf/util/intel-pt-decoder/insn.c, and I believe
> there's
> more. Therefore I think it should be a separated work from perf BPF patches.
> So how about keep this patch at this time? Or do you have some idea?

I would go with what Wang did at this time, its a step in the right
direction in the sense that we're trying to use the same function names
and semantics, and, as much as possible, possibly in verbatim form,
using the same implementation.

Doing the work to fully share it is something being discussed, but that
should not get in the way of eBPF work, IMHO.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 22/31] perf tools: Add BPF_PROLOGUE config options for further patches Wang Nan <wangnan0@huawei.com> - 2015-08-29 06:30 +0200
  Re: [PATCH 22/31] perf tools: Add BPF_PROLOGUE config options for  further patches Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-08-31 22:40 +0200
  [PATCH 22/31] perf tools: Add BPF_PROLOGUE config options for further patches Wang Nan <wangnan0@huawei.com> - 2015-09-01 09:10 +0200
    [PATCH 23/31] perf tools: Introduce regs_query_register_offset() for x86 Wang Nan <wangnan0@huawei.com> - 2015-09-01 09:10 +0200
      RE: [PATCH 23/31] perf tools: Introduce  regs_query_register_offset() for x86 平松雅巳 / HIRAMATU,MASAMI   <masami.hiramatsu.pt@hitachi.com> - 2015-09-01 13:50 +0200
        Re: [PATCH 23/31] perf tools: Introduce regs_query_register_offset()  for x86 "Wangnan (F)" <wangnan0@huawei.com> - 2015-09-01 16:00 +0200
          Re: [PATCH 23/31] perf tools: Introduce regs_query_register_offset()  for x86 Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-01 17:00 +0200
        Re: [PATCH 23/31] perf tools: Introduce regs_query_register_offset()  for x86 Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-09-01 16:20 +0200
          RE: [PATCH 23/31] perf tools: Introduce  regs_query_register_offset() for x86 平松雅巳 / HIRAMATU,MASAMI   <masami.hiramatsu.pt@hitachi.com> - 2015-09-01 18:00 +0200
            Re: [PATCH 23/31] perf tools: Introduce regs_query_register_offset()  for x86 "Wangnan (F)" <wangnan0@huawei.com> - 2015-09-06 08:10 +0200
              [PATCH] perf test: Enforce LLVM test, add kbuild test Wang Nan <wangnan0@huawei.com> - 2015-09-06 08:10 +0200
    Re: [PATCH 22/31] perf tools: Add BPF_PROLOGUE config options for  further patches Namhyung Kim <namhyung@kernel.org> - 2015-09-02 16:20 +0200

csiph-web