public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] perf/sdt: Hardening argument support
@ 2017-03-27  7:58 Ravi Bangoria
  2017-03-27  7:58 ` [PATCH v2 1/3] perf/sdt/x86: Add renaming logic for (missing) 8 bit registers Ravi Bangoria
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ravi Bangoria @ 2017-03-27  7:58 UTC (permalink / raw)
  To: acme, mhiramat
  Cc: alexis.berlemont, linux-kernel, peterz, mingo, alexander.shishkin,
	naveen.n.rao, mpe, hemant, Ravi Bangoria

SDT event argument support on x86 is recently added to Perf. But
there are couple of issues with it.

It lacks renaming mapping for few 8 bit registers: al, bl, cl and dl.
SDT events using these registers in arguments are failing at 'perf
probe'. Add renaming logic to that. (patch 1)

It still has x86 specific code in general code. It also fails to
convert arguments having no offset but still surrounds register with
parenthesis for ex. 8@(%rdi) is converted to +(%di):u64, which is
rejected by uprobe_events. Also, 'perf probe' is failing for *all SDT
events on all archs except x86*. Solve these issues. (patch 2)

Add argument parser for powerpc. (patch 3)

Changes in v2:
  - Patch 1 is new.

  - (Patch 2) Reimplement argument parsing logic for x86(Esp. OP parser).
    Use regex for parsing which makes code more compact and accurate
    wrt current implementation.

  - (Patch 2) sdt_reg_renamings is bit longer. Rename it to sdt_reg_tbl.

  - (Patch 2) Rename sdt_probe_parse_n() to sdt_probe_parse_size() as
    suggested by Masami.[1]

  - (Patch 2,3) Separate out in/out arguments as suggested by Masami.[1]

  - (Patch 2,3) Introduce enum instead of returning hardcoded values
    from arch_sdt_arg_parse_op().

  - (Parch 2,3) Rename arch_sdt_probe_parse_op() to
    arch_sdt_arg_parse_op().

  - (Patch 2,3) Remove arch_sdt_probe_arg_supp() function. Instead,
    arch_sdt_arg_parse_op() should always return SDT_ARG_SKIP on all
    archs who does not implement argument parser.[1]

v1: https://lkml.org/lkml/2017/2/2/145

I've prepared this patchset on top of acme/perf/core.

[1] https://lkml.org/lkml/2017/3/21/427

Ravi Bangoria (3):
  perf/sdt/x86: Add renaming logic for (missing) 8 bit registers
  perf/sdt/x86: Move OP parser to tools/perf/arch/x86/
  perf/sdt/powerpc: Add argument support

 tools/perf/arch/powerpc/util/perf_regs.c | 111 +++++++++++++++++++
 tools/perf/arch/x86/util/perf_regs.c     | 183 +++++++++++++++++++++++++------
 tools/perf/util/perf_regs.c              |   6 +-
 tools/perf/util/perf_regs.h              |  11 +-
 tools/perf/util/probe-file.c             | 132 +++++++---------------
 5 files changed, 309 insertions(+), 134 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-28  6:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-27  7:58 [PATCH v2 0/3] perf/sdt: Hardening argument support Ravi Bangoria
2017-03-27  7:58 ` [PATCH v2 1/3] perf/sdt/x86: Add renaming logic for (missing) 8 bit registers Ravi Bangoria
2017-03-27 14:17   ` Masami Hiramatsu
2017-03-28  6:54     ` Ravi Bangoria
2017-03-27  7:58 ` [PATCH v2 2/3] perf/sdt/x86: Move OP parser to tools/perf/arch/x86/ Ravi Bangoria
2017-03-27 14:56   ` Masami Hiramatsu
2017-03-27  7:58 ` [PATCH v2 3/3] perf/sdt/powerpc: Add argument support Ravi Bangoria
2017-03-27 15:10   ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox