mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Wang Nan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: xiakaixu@huawei.com, masami.hiramatsu.pt@hitachi.com,
	tglx@linutronix.de, brendan.d.gregg@gmail.com, mingo@kernel.org,
	dsahern@gmail.com, linux-kernel@vger.kernel.org,
	jolsa@kernel.org, hpa@zytor.com, hekuang@huawei.com,
	acme@redhat.com, namhyung@kernel.org, ast@plumgrid.com,
	lizefan@huawei.com, daniel@iogearbox.net, wangnan0@huawei.com,
	paulus@samba.org, a.p.zijlstra@chello.nl
Subject: [tip:perf/core] perf tools: regs_query_register_offset() infrastructure
Date: Wed, 16 Sep 2015 00:30:19 -0700	[thread overview]
Message-ID: <tip-63ab024a5b6f295ca17a293ad81b7c728f49a89a@git.kernel.org> (raw)
In-Reply-To: <1441523623-152703-19-git-send-email-wangnan0@huawei.com>

Commit-ID:  63ab024a5b6f295ca17a293ad81b7c728f49a89a
Gitweb:     http://git.kernel.org/tip/63ab024a5b6f295ca17a293ad81b7c728f49a89a
Author:     Wang Nan <wangnan0@huawei.com>
AuthorDate: Mon, 14 Sep 2015 23:02:49 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 15 Sep 2015 09:48:33 -0300

perf tools: regs_query_register_offset() infrastructure

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.

PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET indicates an architecture
supports converting name of a register to its offset in 'struct
pt_regs'.

HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET is introduced as the corresponding
CFLAGS of PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441523623-152703-19-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com>
[ Extracted from eBPF patches ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/config/Makefile           | 4 ++++
 tools/perf/util/include/dwarf-regs.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 827557f..0435ac4 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -109,6 +109,10 @@ endif
 # include ARCH specific config
 -include $(src-perf)/arch/$(ARCH)/Makefile
 
+ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
+  CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
+endif
+
 include $(src-perf)/config/utilities.mak
 
 ifeq ($(call get-executable,$(FLEX)),)
diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h
index 8f14965..07c644e 100644
--- a/tools/perf/util/include/dwarf-regs.h
+++ b/tools/perf/util/include/dwarf-regs.h
@@ -5,4 +5,12 @@
 const char *get_arch_regstr(unsigned int n);
 #endif
 
+#ifdef HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
+/*
+ * Arch should support fetching the offset of a register in pt_regs
+ * by its name. See kernel's regs_query_register_offset in
+ * arch/xxx/kernel/ptrace.c.
+ */
+int regs_query_register_offset(const char *name);
+#endif
 #endif

  reply	other threads:[~2015-09-16  7:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-06  7:13 [GIT PULL 00/27] perf tools: filtering events using eBPF programs Wang Nan
2015-09-06  7:13 ` [PATCH 01/27] perf tools: Don't write to evsel if parser doesn't collect evsel Wang Nan
2015-09-23  8:43   ` [tip:perf/core] perf tools: Don' t assume that the parser returns non empty evsel list tip-bot for Wang Nan
2015-09-06  7:13 ` [PATCH 02/27] perf tools: Make perf depend on libbpf Wang Nan
2015-09-06  7:13 ` [PATCH 03/27] perf ebpf: Add the libbpf glue Wang Nan
2015-09-06  7:13 ` [PATCH 04/27] perf tools: Enable passing bpf object file to --event Wang Nan
2015-09-06  7:13 ` [PATCH 05/27] perf record, bpf: Parse and create probe points for BPF programs Wang Nan
2015-09-16 21:43   ` Arnaldo Carvalho de Melo
2015-09-17  2:04     ` Wangnan (F)
2015-09-06  7:13 ` [PATCH 06/27] perf bpf: Collect 'struct perf_probe_event' for bpf_program Wang Nan
2015-09-06  7:13 ` [PATCH 07/27] perf record: Load all eBPF object into kernel Wang Nan
2015-09-06  7:13 ` [PATCH 08/27] perf tools: Add bpf_fd field to evsel and config it Wang Nan
2015-09-06  7:13 ` [PATCH 09/27] perf tools: Attach eBPF program to perf event Wang Nan
2015-09-06  7:13 ` [PATCH 10/27] perf tools: Allow BPF placeholder dummy events to collect --filter options Wang Nan
2015-09-06  7:13 ` [PATCH 11/27] perf tools: Sync setting of real bpf events with placeholder Wang Nan
2015-09-06  7:13 ` [PATCH 12/27] perf record: Add clang options for compiling BPF scripts Wang Nan
2015-09-06  7:13 ` [PATCH 13/27] perf tools: Compile scriptlets to BPF objects when passing '.c' to --event Wang Nan
2015-09-06  7:13 ` [PATCH 14/27] perf test: Enforce LLVM test for BPF test Wang Nan
2015-09-06  7:13 ` [PATCH 15/27] perf test: Add 'perf test BPF' Wang Nan
2015-09-06  7:13 ` [PATCH 16/27] bpf tools: Load a program with different instances using preprocessor Wang Nan
2015-09-06  7:13 ` [PATCH 17/27] perf probe: Reset args and nargs for probe_trace_event when failure Wang Nan
2015-09-06  7:13 ` [PATCH 18/27] perf tools: Add BPF_PROLOGUE config options for further patches Wang Nan
2015-09-16  7:30   ` tip-bot for Wang Nan [this message]
2015-09-06  7:13 ` [PATCH 19/27] perf tools: Introduce regs_query_register_offset() for x86 Wang Nan
2015-09-14 21:37   ` Arnaldo Carvalho de Melo
2015-09-15  1:36     ` Wangnan (F)
2015-09-16  7:30   ` [tip:perf/core] perf tools: Introduce regs_query_register_offset( ) " tip-bot for Wang Nan
2015-09-06  7:13 ` [PATCH 20/27] perf tools: Add prologue for BPF programs for fetching arguments Wang Nan
2015-09-06  7:13 ` [PATCH 21/27] perf tools: Generate prologue for BPF programs Wang Nan
2015-09-06  7:13 ` [PATCH 22/27] perf tools: Use same BPF program if arguments are identical Wang Nan
2015-09-06  7:13 ` [PATCH 23/27] perf record: Support custom vmlinux path Wang Nan
2015-09-06  7:13 ` [PATCH 24/27] perf probe: Init symbol as kprobe Wang Nan
2015-09-06  7:13 ` [PATCH 25/27] perf tools: Allow BPF program attach to uprobe events Wang Nan
2015-09-06  7:13 ` [PATCH 26/27] perf test: Enforce LLVM test, add kbuild test Wang Nan
2015-09-06  7:13 ` [PATCH 27/27] perf test: Test BPF prologue Wang Nan

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=tip-63ab024a5b6f295ca17a293ad81b7c728f49a89a@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=ast@plumgrid.com \
    --cc=brendan.d.gregg@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=hekuang@huawei.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=wangnan0@huawei.com \
    --cc=xiakaixu@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