tracing/kprobes, perf: perf kprobe support
Subsystems (3)
cover tracing/kprobes, perf: perf kprobe support
Hi,
These patches introduce perf kprobe command and update kprobe-tracer. perf kprobe command allows you to add new probe points by C line number and local variable names.
Usage
-----
perf kprobe [<options>] -P PROBEDEF [-P PROBEDEF ...]
-k, --vmlinux <file> vmlinux/module pathname
-r, --release <rel> kernel release
-P, --probe <p|r:[GRP/]NAME,FUNC[+OFFS][@SRC]|@SRC:LINE,ARG[,ARG,...]>
probe point definition, where
p: kprobe probe
r: kretprobe probe
GRP: Group name (optional)
NAME: Event name
FUNC: Function name
OFFS: Offset from function entry (in byte)
SRC: Source code path
LINE: Line number
ARG: Probe argument (local variable name or
kprobe-tracer argument format is supported.)
Examples
--------
1) Add a new kprobe probe on a line of C source code. ./perf kprobe -P 'p:myprobe,@fs/bio.c:162,bv,idx' Adding new event: p:myprobe bvec_free_bs+17 bv=%bx idx=%cx
2) Add a new kretprobe probe on a function return. ./perf kprobe -P 'r:myretprobe,vfs_read,$rv' Adding new event: r:myretprobe vfs_read+0 $rv
3) Check it in the perf list.
./perf list
...
rNNN [raw hardware event descriptor]
kprobes:myprobe [Tracepoint event] kprobes:myretprobe [Tracepoint event] skb:kfree_skb [Tracepoint event]
...
4) Check its format
$ cat /sys/kernel/debug/tracing/events/kprobes/myprobe/format name: myprobe ID: 687 format: field:unsigned short common_type; offset:0; size:2; field:unsigned char common_flags; offset:2; size:1; field:unsigned char common_preempt_count; offset:3; size:1; field:int common_pid; offset:4; size:4; field:int common_lock_depth; offset:8; size:4;
field: unsigned long __probe_ip; offset:12; size:4; field: int __probe_nargs; offset:16; size:4; field: unsigned long bv; offset:20; size:4; field: unsigned long idx; offset:24; size:4;
print fmt: "(%lx) bv=%lx idx=%lx", REC->__probe_ip, REC->bv, REC->idx
Syntax Issue
------------
This version picks '-P event-definition' syntax, but I think '-p event -a arg' is also possible. I'd like to ask you which you like or support both?
TODO
----
There are still many enhancements required for catching up 'tracing side' of systemtap. I think it should be done one by one. I hope that systemtap developers cooperate with us on this development.
- Support sys_perf_counter_open (non-root)
- Type support
- Non-auto static variable
- Fields of data structure (var->field)
- Bit fields
- Array (var[N])
- Dynamic array indexing (var[var2])
- String/dynamic arrays (var:string, var[N..M])
- Force Type casting ((type)var)
- Non-inline search
- libdw, libdwfl
Thank you,
---
Masami Hiramatsu (5):
perf: kprobe command supports without libdwarf
perf: Support perf kprobe command for kprobe-event setup helper tracing/kprobes: Rename fixed field name tracing/kprobes: Avoid field name confliction tracing/kprobes: Rename special variables syntax
Documentation/trace/kprobetrace.txt | 10 - kernel/trace/trace_kprobe.c | 124 +++++- tools/perf/Makefile | 10 + tools/perf/builtin-kprobe.c | 340 +++++++++++++++++ tools/perf/builtin.h | 1 tools/perf/perf.c | 1 tools/perf/util/probe-finder.c | 684 +++++++++++++++++++++++++++++++++++ tools/perf/util/probe-finder.h | 70 ++++ 8 files changed, 1200 insertions(+), 40 deletions(-) create mode 100644 tools/perf/builtin-kprobe.c create mode 100644 tools/perf/util/probe-finder.c create mode 100644 tools/perf/util/probe-finder.h
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
RFC PATCH 1/5 tracing/kprobes: Rename special variables syntax
Add $ prefix to the special variables(e.g. sa, rv) of kprobe-tracer. This resolves consistency issue between kprobe_events and perf-kprobe.
---
Documentation/trace/kprobetrace.txt | 10 +++--- kernel/trace/trace_kprobe.c | 60 ++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 28 deletions(-)
Documentation/trace/kprobetrace.txt +5 -5
@@ -36,13 +36,13 @@ Synopsis of kprobe_events FETCHARGS : Arguments. Each probe can have up to 128 args. %REG : Fetch register REG - sN : Fetch Nth entry of stack (N >= 0) - sa : Fetch stack address. @ADDR : Fetch memory at ADDR (ADDR should be in kernel) @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol) - aN : Fetch function argument. (N >= 0)(*) - rv : Fetch return value.(**) - ra : Fetch return address.(**) + $sN : Fetch Nth entry of stack (N >= 0) + $sa : Fetch stack address. + $aN : Fetch function argument. (N >= 0)(*) + $rv : Fetch return value.(**) + $ra : Fetch return address.(**) +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(***) NAME=FETCHARG: Set NAME as the argument name of FETCHARG.
kernel/trace/trace_kprobe.c +37 -23
112 lines not on this page · raw message
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
RFC PATCH 2/5 tracing/kprobes: Avoid field name confliction
In reply to Masami HiramatsuCheck whether the argument name is conflict with other field names.
---
kernel/trace/trace_kprobe.c | 64 +++++++++++++++++++++++++++++++++++-------- 1 files changed, 52 insertions(+), 12 deletions(-)
kernel/trace/trace_kprobe.c +52 -12
@@ -38,6 +38,24 @@#define MAX_EVENT_NAME_LEN 64#define KPROBE_EVENT_SYSTEM "kprobes" +/* Reserved field names */ +#define FIELD_STRING_IP "ip" +#define FIELD_STRING_NARGS "nargs" +#define FIELD_STRING_RETIP "ret_ip" +#define FIELD_STRING_FUNC "func" + +const char *reserved_field_names[] = { +"common_type" , +"common_flags" , +"common_preempt_count" , +"common_pid" , +"common_tgid" , +FIELD_STRING_IP , +FIELD_STRING_NARGS , +FIELD_STRING_RETIP , +FIELD_STRING_FUNC , +}; +/* currently, trace_kprobe only supports X86. */ struct fetch_func {
@@ -551,6 +569,20 @@ static int parse_probe_arg(char *arg, struct fetch_func *ff, int is_return)return ret; } +/* Return 1 if name is reserved or already used by another argument */ +static int conflict_field_name (const char *name, +struct probe_arg *args,int narg) +{ +int i; +for (i =0 ; i <ARRAY_SIZE (reserved_field_names); i++) +if (!strcmp (reserved_field_names[i], name)) +return 1 ; +for (i =0 ; i < narg; i++) +if (!strcmp (args[i].name, name)) +return 1 ; +return 0 ; +} +static int create_trace_probe (int argc,char **argv) {/*
@@ -652,6 +684,12 @@ static int create_trace_probe(int argc, char **argv) *arg++ ='\0' ; else arg = argv[i]; + +if (conflict_field_name (argv[i], tp->args, i)) { + ret = -EINVAL ; + goto error; + } + tp->args[i].name =kstrdup (argv[i],GFP_KERNEL );/* Parse fetch argument */
@@ -1054,8 +1092,8 @@ static int kprobe_event_define_fields(struct ftrace_event_call *event_call)if (!ret)return ret; - DEFINE_FIELD(unsigned long, ip, "ip", 0); -DEFINE_FIELD (int, nargs,"nargs" ,1 ); + DEFINE_FIELD(unsigned long, ip, FIELD_STRING_IP, 0); +DEFINE_FIELD (int, nargs,FIELD_STRING_NARGS ,1 );/* Set argument names as fields */ for (i =0 ; i < tp->nr_args; i++) DEFINE_FIELD(unsigned long, args[i], tp->args[i].name, 0);
@@ -1072,9 +1110,9 @@ static int kretprobe_event_define_fields(struct ftrace_event_call *event_call)if (!ret)return ret; - DEFINE_FIELD(unsigned long, func, "func", 0); - DEFINE_FIELD(unsigned long, ret_ip, "ret_ip", 0); -DEFINE_FIELD (int, nargs,"nargs" ,1 ); + DEFINE_FIELD(unsigned long, func, FIELD_STRING_FUNC, 0); + DEFINE_FIELD(unsigned long, ret_ip, FIELD_STRING_RETIP, 0); +DEFINE_FIELD (int, nargs,FIELD_STRING_NARGS ,1 );/* Set argument names as fields */ for (i =0 ; i < tp->nr_args; i++) DEFINE_FIELD(unsigned long, args[i], tp->args[i].name, 0);
@@ -1123,15 +1161,16 @@ static int kprobe_event_show_format(struct ftrace_event_call *call,int ret, i;struct trace_probe *tp = (struct trace_probe *)call->data; - SHOW_FIELD(unsigned long, ip, "ip"); -SHOW_FIELD (int, nargs,"nargs" ); + SHOW_FIELD(unsigned long, ip, FIELD_STRING_IP); +SHOW_FIELD (int, nargs,FIELD_STRING_NARGS );/* Show fields */ for (i =0 ; i < tp->nr_args; i++) SHOW_FIELD(unsigned long, args[i], tp->args[i].name);trace_seq_puts (s,"\n" ); -return __probe_event_show_format (s, tp,"(%lx)" ,"REC->ip" ); +return __probe_event_show_format (s, tp,"(%lx)" , +"REC->" FIELD_STRING_IP ); } static int kretprobe_event_show_format(struct ftrace_event_call *call,
@@ -1141,9 +1180,9 @@ static int kretprobe_event_show_format(struct ftrace_event_call *call,int ret, i;struct trace_probe *tp = (struct trace_probe *)call->data; - SHOW_FIELD(unsigned long, func, "func"); - SHOW_FIELD(unsigned long, ret_ip, "ret_ip"); -SHOW_FIELD (int, nargs,"nargs" ); + SHOW_FIELD(unsigned long, func, FIELD_STRING_FUNC); + SHOW_FIELD(unsigned long, ret_ip, FIELD_STRING_RETIP); +SHOW_FIELD (int, nargs,FIELD_STRING_NARGS );/* Show fields */ for (i =0 ; i < tp->nr_args; i++)
@@ -1151,7 +1190,8 @@ static int kretprobe_event_show_format(struct ftrace_event_call *call,trace_seq_puts (s,"\n" );return __probe_event_show_format (s, tp,"(%lx <- %lx)" , -"REC->func, REC->ret_ip" ); +"REC->" FIELD_STRING_FUNC +", REC->" FIELD_STRING_RETIP ); }#ifdef CONFIG_EVENT_PROFILE
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Re: [RFC PATCH tracing/kprobes 2/5] tracing/kprobes: Avoid field name confliction
kernel/trace/trace_kprobe.c line 52
Quoted 12 lines
kernel/trace/trace_kprobe.c +12
-0+/* Reserved field names */ +#define FIELD_STRING_IP "ip" +#define FIELD_STRING_NARGS "nargs" +#define FIELD_STRING_RETIP "ret_ip" +#define FIELD_STRING_FUNC "func" + +const char *reserved_field_names[] = { +"common_type" , +"common_flags" , +"common_preempt_count" , +"common_pid" , +"common_tgid" ,
There is a new common field "common_lock_depth"
Quoted 5 lines
kernel/trace/trace_kprobe.c +5
-0+FIELD_STRING_IP , +FIELD_STRING_NARGS , +FIELD_STRING_RETIP , + FIELD_STRING_FUNC, +};
Re: [RFC PATCH tracing/kprobes 2/5] tracing/kprobes: Avoid field name confliction
Quoted 6 lines · Li Zefan
Quoted 6 lines
kernel/trace/trace_kprobe.c +6
-0+/* Reserved field names */ +#define FIELD_STRING_IP "ip" +#define FIELD_STRING_NARGS "nargs" +#define FIELD_STRING_RETIP "ret_ip" +#define FIELD_STRING_FUNC "func" +
Quoted 8 lines
kernel/trace/trace_kprobe.c line 52
Quoted 6 lines
kernel/trace/trace_kprobe.c +6
-0+const char *reserved_field_names[] = { +"common_type" , +"common_flags" , +"common_preempt_count" , +"common_pid" , +"common_tgid" ,There is a new common field "
common_lock_depth"
Thanks, I'll add it.
Perhaps, I might need to have more generic check.
(check in define_field?)
Thank you!
Quoted 6 lines
Quoted 6 lines
kernel/trace/trace_kprobe.c +5
-0+FIELD_STRING_IP , +FIELD_STRING_NARGS , +FIELD_STRING_RETIP , + FIELD_STRING_FUNC, +};
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
RFC PATCH 3/5 tracing/kprobes: Rename fixed field name
In reply to Masami HiramatsuRename probe-common fixed field name to the name harder conflictable, because current 'ip', 'func', and other probe field names are easy to conflict with user-specified variable names.
---
kernel/trace/trace_kprobe.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
kernel/trace/trace_kprobe.c +4 -4
@@ -39,10 +39,10 @@#define KPROBE_EVENT_SYSTEM "kprobes"/* Reserved field names */ -#define FIELD_STRING_IP "ip" -#define FIELD_STRING_NARGS "nargs" -#define FIELD_STRING_RETIP "ret_ip" -#define FIELD_STRING_FUNC "func" +#define FIELD_STRING_IP "__probe_ip" +#define FIELD_STRING_NARGS "__probe_nargs" +#define FIELD_STRING_RETIP "__probe_ret_ip" +#define FIELD_STRING_FUNC "__probe_func"const char *reserved_field_names[] = {"common_type" ,
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
RFC PATCH 4/5 perf: Support perf kprobe command for kprobe-event setup helper
In reply to Masami HiramatsuSupport perf kprobe command for kprobe-event setup helper. This allows user to define kprobe events by C expressions (C line numbers, C function names, and C local variables).
Usage
-----
perf kprobe [<options>] -P PROBEDEF [-P PROBEDEF ...]
-k, --vmlinux <file> vmlinux/module pathname
-r, --release <rel> kernel release
-P, --probe <p|r:[GRP/]NAME,FUNC[+OFFS][@SRC]|@SRC:LINE,ARG[,ARG,...]>
probe point definition, where
p: kprobe probe
r: kretprobe probe
GRP: Group name (optional)
NAME: Event name
FUNC: Function name
OFFS: Offset from function entry (in byte)
SRC: Source code path
LINE: Line number
ARG: Probe argument (local variable name or
kprobe-tracer argument format is supported.)
---
tools/perf/Makefile | 10 + tools/perf/builtin-kprobe.c | 312 ++++++++++++++++++ tools/perf/builtin.h | 1 tools/perf/perf.c | 3 tools/perf/util/probe-finder.c | 684 ++++++++++++++++++++++++++++++++++++++++ tools/perf/util/probe-finder.h | 68 ++++ 6 files changed, 1078 insertions(+), 0 deletions(-) create mode 100644 tools/perf/builtin-kprobe.c create mode 100644 tools/perf/util/probe-finder.c create mode 100644 tools/perf/util/probe-finder.h
tools/perf/Makefile +10 -0
@@ -419,6 +419,16 @@ ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel); endif +ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) + msg := $(warning No libdwarf.h found, disables kprobe support. Please install libdwarf-dev/libdwarf-devel); +else + EXTLIBS += -lelf -ldwarf + LIB_H += util/probe-finder.h + LIB_OBJS += util/probe-finder.o + BUILTIN_OBJS += builtin-kprobe.o + BASIC_CFLAGS += -DSUPPORT_DWARF +endif + ifdef NO_DEMANGLE BASIC_CFLAGS += -DNO_DEMANGLE else
tools/perf/builtin-kprobe.c new file +312 -0
312 lines not on this page · raw message
tools/perf/builtin.h +1 -0
@@ -25,5 +25,6 @@ extern int cmd_timechart(int argc, const char **argv, const char *prefix);extern int cmd_top (int argc,const char **argv,const char *prefix);extern int cmd_trace (int argc,const char **argv,const char *prefix);extern int cmd_version (int argc,const char **argv,const char *prefix); +extern int cmd_kprobe (int argc,const char **argv,const char *prefix);#endif
tools/perf/perf.c +3 -0
@@ -295,6 +295,9 @@ static void handle_internal_command(int argc, const char **argv) { "version", cmd_version, 0 }, { "trace", cmd_trace, 0 }, { "sched", cmd_sched, 0 }, +#ifdef SUPPORT_DWARF + { "kprobe", cmd_kprobe, 0 }, +#endif };unsigned int i;static const char ext[] =STRIP_EXTENSION ;
tools/perf/util/probe-finder.c new file +684 -0
684 lines not on this page · raw message
tools/perf/util/probe-finder.h new file +68 -0
68 lines not on this page · raw message
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Steven Rostedt
maintainerRe: [RFC PATCH tracing/kprobes 4/5] perf: Support perf kprobe command for kprobe-event setup helper
tools/perf/builtin-kprobe.c line 225
Quoted 9 lines · Masami Hiramatsu
tools/perf/builtin-kprobe.c new file +9
-0+ +#define MAX_CMDLEN 256 + +static int synthesize_probepoint (struct probe_point *pp) +{ +char *buf; +int i, len, ret; + pp->probes[0 ] = buf = (char *)calloc (MAX_CMDLEN ,sizeof (char )); + len =snprintf (buf,MAX_CMDLEN ,"%s+%d" , pp->function, pp->offset);
What happens if func and offset is too big for MAX_CMDLEN?
Review
Quoted 1 line
(quoted diff) +1
-0+ for (i = 0; i < pp->nr_args; i++) {
Can you have a case where pp->nr_args == 0?
Quoted 21 lines
tools/perf/builtin-kprobe.c new file +21
-0+ ret =snprintf (&buf[len],MAX_CMDLEN - len," %s" , + pp->args[i]); +if (ret <=0 || ret >=MAX_CMDLEN - len) { +free (pp->probes[0 ]); +return -E2BIG ; + } + len += ret; + } +return pp->found =1 ; +} + +int cmd_kprobe (int argc,const char **argv,const char *prefix__used ) +{ +int i, j, fd, ret, need_dwarf =0 ; +struct probe_point *pp; +char buf[MAX_CMDLEN ]; + + argc =parse_options (argc, argv, options, kprobe_usage, +PARSE_OPT_STOP_AT_NON_OPTION ); +if (argc || session.nr_probe ==0 ) +usage_with_options (kprobe_usage, options);
tools/perf/builtin-kprobe.c line 257
Quoted 10 lines
tools/perf/builtin-kprobe.c new file +10
-0+ +/* Synthesize return probes */ +for (j =0 ; j < session.nr_probe; j++) { +if (session.events[j][0 ] !='r' ) { + need_dwarf =1 ; +continue ; + } + ret =synthesize_probepoint (&session.probes[j]); +if (ret <0 ) +semantic_error ("probe point is too long." );
If we have no args but the func and offset is too big, then this does not catch it. But this depends on if we can have no args.
-- Steve
Quoted 3 lines
(quoted diff) +2
-0+ } +
Re: [RFC PATCH tracing/kprobes 4/5] perf: Support perf kprobe command for kprobe-event setup helper
Quoted 13 lines · Steven Rostedt
tools/perf/builtin-kprobe.c line 225
Quoted 9 lines · Masami Hiramatsu
tools/perf/builtin-kprobe.c new file +9
-0+ +#define MAX_CMDLEN 256 + +static int synthesize_probepoint (struct probe_point *pp) +{ +char *buf; +int i, len, ret; + pp->probes[0 ] = buf = (char *)calloc (MAX_CMDLEN ,sizeof (char )); + len =snprintf (buf,MAX_CMDLEN ,"%s+%d" , pp->function, pp->offset);What happens if func and offset is too big for
MAX_CMDLEN?
Oops, it must be checked.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-0+ for (i = 0; i< pp->nr_args; i++) {Can you have a case where
pp->nr_args== 0?
Sure, I'll check that.
Thank you!
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
RFC PATCH 5/5 perf: kprobe command supports without libdwarf
In reply to Masami HiramatsuEnables perf-kprobe even if libdwarf is installed. If libdwarf is not found, perf-kprobe just disables dwarf support. Users can use perf-kprobe to set up new events by using kprobe_events format.
---
tools/perf/Makefile | 6 +++--- tools/perf/builtin-kprobe.c | 42 +++++++++++++++++++++++++++++++++------- tools/perf/perf.c | 2 -- tools/perf/util/probe-finder.h | 2 ++ 4 files changed, 40 insertions(+), 12 deletions(-)
tools/perf/Makefile +3 -3
@@ -385,6 +385,7 @@ BUILTIN_OBJS += builtin-stat.o BUILTIN_OBJS += builtin-timechart.o BUILTIN_OBJS += builtin-top.o BUILTIN_OBJS += builtin-trace.o +BUILTIN_OBJS += builtin-kprobe.o PERFLIBS = $(LIB_FILE)
@@ -420,13 +421,12 @@ ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * endif ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y) - msg := $(warning No libdwarf.h found, disables kprobe support. Please install libdwarf-dev/libdwarf-devel); + msg := $(warning No libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel); + BASIC_CFLAGS += -DNO_LIBDWARF else EXTLIBS += -lelf -ldwarf LIB_H += util/probe-finder.h LIB_OBJS += util/probe-finder.o - BUILTIN_OBJS += builtin-kprobe.o - BASIC_CFLAGS += -DSUPPORT_DWARF endif ifdef NO_DEMANGLE
tools/perf/builtin-kprobe.c +35 -7
119 lines not on this page · raw message
tools/perf/perf.c +0 -2
@@ -295,9 +295,7 @@ static void handle_internal_command(int argc, const char **argv) { "version", cmd_version, 0 }, { "trace", cmd_trace, 0 }, { "sched", cmd_sched, 0 }, -#ifdef SUPPORT_DWARF { "kprobe", cmd_kprobe, 0 }, -#endif };unsigned int i;static const char ext[] =STRIP_EXTENSION ;
tools/perf/util/probe-finder.h +2 -0
@@ -44,6 +44,7 @@ struct probe_point {char *probes[MAX_PROBES ];/* Output buffers (will be allocated)*/ }; +#ifndef NO_LIBDWARF extern int find_probepoint (int fd,struct probe_point *pp);#include <libdwarf/dwarf.h>
@@ -64,5 +65,6 @@ struct probe_finder {char *buf;/* Current output buffer */ int len;/* Length of output buffer */ }; +#endif /* NO_LIBDWARF */ #endif /*_PROBE_FINDER_H */
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Quoted 6 lines · Masami Hiramatsu
Hi,
These patches introduce perf kprobe command and update kprobe-tracer. perf kprobe command allows you to add new probe points by C line number and local variable names.
Last week, Arnaldo and I talked about this command, and he suggested that the command would be better 'perf probe', because it would be able to cover both of kernel space (by kprobes) and user space (by uprobes).
Basically, I agree with his idea. But I think we may need to consider more flexible syntax for that purpose before we support uprobes. In this area, SystemTap has done big advance, we can see how many varieties of syntax it has by 'man stapprobes'.
And also, it's hard to decide it without real uprobe-tracer (and uprobes too!) implementation on ftrace. So, I think it is better to continue using 'perf kprobe' in this time.
But it's worth to add to todo list. :)
Thank you,
Signature · 7 lines
Masami Hiramatsu Software Engineer Hitachi Computer Products (America), Inc. Software Solutions Division e-mail: [email protected]
Quoted 4 lines · Masami Hiramatsu
Quoted 3 lines · Masami Hiramatsu
Hi,
Quoted 8 lines
Quoted 3 lines
These patches introduce perf kprobe command and update kprobe-tracer. perf kprobe command allows you to add new probe points by C line number and local variable names.
Last week, Arnaldo and I talked about this command, and he suggested that the command would be better 'perf probe', because it would be able to cover both of kernel space (by kprobes) and user space (by uprobes).
Agreed.
Quoted 10 lines
Basically, I agree with his idea. But I think we may need to consider more flexible syntax for that purpose before we support uprobes. In this area, SystemTap has done big advance, we can see how many varieties of syntax it has by 'man stapprobes'.
And also, it's hard to decide it without real uprobe-tracer (and uprobes too!) implementation on ftrace. So, I think it is better to continue using 'perf kprobe' in this time.
But it's worth to add to todo list. :)
I'd still name it 'perf probe', even if initially it supports kprobes.
Ingo
Em Wed, Sep 30, 2009 at 02:04:18PM +0200, Ingo Molnar escreveu:
Quoted 23 lines · Masami Hiramatsu
Quoted 5 lines
Quoted 3 lines · Masami Hiramatsu
Hi,
Quoted 8 lines
Quoted 3 lines
These patches introduce perf kprobe command and update kprobe-tracer. perf kprobe command allows you to add new probe points by C line number and local variable names.
Last week, Arnaldo and I talked about this command, and he suggested that the command would be better 'perf probe', because it would be able to cover both of kernel space (by kprobes) and user space (by uprobes).
Agreed.
Quoted 5 lines
Basically, I agree with his idea. But I think we may need to consider more flexible syntax for that purpose before we support uprobes. In this area, SystemTap has done big advance, we can see how many varieties of syntax it has by 'man stapprobes'.
Quoted 7 lines
Quoted 5 lines
And also, it's hard to decide it without real uprobe-tracer (and uprobes too!) implementation on ftrace. So, I think it is better to continue using 'perf kprobe' in this time.
But it's worth to add to todo list. :)
I'd still name it 'perf probe', even if initially it supports kprobes.
Agreed.
- Arnaldo