mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: He Kuang <hekuang@huawei.com>,
	peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	wangnan0@huawei.com, bintian.wang@huawei.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2 v2] perf tools: Enable bpf prologue for arm64
Date: Thu, 26 Jan 2017 16:52:12 +0000	[thread overview]
Message-ID: <20170126165211.GK14167@arm.com> (raw)
In-Reply-To: <20170126104916.971478fa29083cf4ae14fac3@kernel.org>

On Thu, Jan 26, 2017 at 10:49:16AM +0900, Masami Hiramatsu wrote:
> On Wed, 25 Jan 2017 13:32:01 +0000
> Will Deacon <will.deacon@arm.com> wrote:
> 
> > On Wed, Jan 25, 2017 at 07:23:11AM +0000, He Kuang wrote:
> > > Since HAVE_KPROBES can be enabled in arm64, this patch introduces
> > > regs_query_register_offset() to convert register name to offset for
> > > arm64, so the BPF prologue feature is ready to use.
> > > 
> > > This patch also changes the 'dwarfnum' to 'offset' in register table,
> > > so the related functions are consistent with x86.
> > 
> > Wouldn't it be an awful lot simpler just to leave the code as-is, and
> > implement regs_query_register_offset in the same way that we implement
> > get_arch_regstr but return the dwarfnum?
> 
> No, since the offset is not same as dwarfnum.
> 
> With this style, the index of array becomes the dwarfnum (the index of
> each register defined by DWARF) and the "offset" member means the
> byte-offset of the register in (user_)pt_regs. Those should be different.

Ok, then do it as two patches then, rather than introduce functionality
along with the renaming.

> > I don't really see the point of all the refactoring.
> 
> Also, from the maintenance point of view, this rewrite work makes
> the code simply similar to x86 implementation, that will be easier to
> maintain :)

Right, apart from the two howling bugs in the version that was nearly merged
initially :p. I tend to err on the "if it ain't broke, don't fix it" side
of the argument but if you really want the refactoring lets keep it as a
separate change.

Will

  reply	other threads:[~2017-01-26 17:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 10:30 [PATCH 0/2] Support " He Kuang
2017-01-24 10:30 ` [PATCH 1/2] perf probe: Fix wrong register name " He Kuang
2017-01-24 19:11   ` Arnaldo Carvalho de Melo
2017-01-25  9:22     ` Will Deacon
2017-01-26  1:24   ` Masami Hiramatsu
2017-01-26 15:28   ` [tip:perf/core] " tip-bot for He Kuang
2017-05-03  8:54   ` [PATCH 1/2] " Pratyush Anand
2017-01-24 10:30 ` [PATCH 2/2] perf tools: Introduce regs_query_register_offset() " He Kuang
2017-01-24 18:25   ` Will Deacon
2017-01-24 19:09     ` Arnaldo Carvalho de Melo
2017-01-25  7:23       ` [PATCH 2/2 v2] perf tools: Enable bpf prologue " He Kuang
2017-01-25 13:32         ` Will Deacon
2017-01-26  1:49           ` Masami Hiramatsu
2017-01-26 16:52             ` Will Deacon [this message]
2017-01-26 19:31               ` Arnaldo Carvalho de Melo
2017-02-03 11:08                 ` Hekuang
2017-01-26  1:51         ` Masami Hiramatsu
2017-01-25  7:26       ` [PATCH 2/2] perf tools: Introduce regs_query_register_offset() " Hekuang
2017-01-24 15:56 ` [PATCH 0/2] Support bpf prologue " Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170126165211.GK14167@arm.com \
    --to=will.deacon@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bintian.wang@huawei.com \
    --cc=hekuang@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome