Commit 0e60836b authored by Srikar Dronamraju's avatar Srikar Dronamraju Committed by Arnaldo Carvalho de Melo

perf probe: Rename common fields/functions from kprobe to probe.

As a precursor for perf to support uprobes, rename fields/functions
that had kprobe in their name but can be shared across perf-kprobes
and perf-uprobes to probe.

Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Wielaard <mjw@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Naren A Devaiah <naren.devaiah@in.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20100729141351.GG21723@linux.vnet.ibm.com>
Signed-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 73ae8f85
...@@ -267,4 +267,3 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) ...@@ -267,4 +267,3 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
} }
return 0; return 0;
} }
This diff is collapsed.
...@@ -7,33 +7,33 @@ ...@@ -7,33 +7,33 @@
extern bool probe_event_dry_run; extern bool probe_event_dry_run;
/* kprobe-tracer tracing point */ /* kprobe-tracer tracing point */
struct kprobe_trace_point { struct probe_trace_point {
char *symbol; /* Base symbol */ char *symbol; /* Base symbol */
unsigned long offset; /* Offset from symbol */ unsigned long offset; /* Offset from symbol */
bool retprobe; /* Return probe flag */ bool retprobe; /* Return probe flag */
}; };
/* kprobe-tracer tracing argument referencing offset */ /* probe-tracer tracing argument referencing offset */
struct kprobe_trace_arg_ref { struct probe_trace_arg_ref {
struct kprobe_trace_arg_ref *next; /* Next reference */ struct probe_trace_arg_ref *next; /* Next reference */
long offset; /* Offset value */ long offset; /* Offset value */
}; };
/* kprobe-tracer tracing argument */ /* kprobe-tracer tracing argument */
struct kprobe_trace_arg { struct probe_trace_arg {
char *name; /* Argument name */ char *name; /* Argument name */
char *value; /* Base value */ char *value; /* Base value */
char *type; /* Type name */ char *type; /* Type name */
struct kprobe_trace_arg_ref *ref; /* Referencing offset */ struct probe_trace_arg_ref *ref; /* Referencing offset */
}; };
/* kprobe-tracer tracing event (point + arg) */ /* kprobe-tracer tracing event (point + arg) */
struct kprobe_trace_event { struct probe_trace_event {
char *event; /* Event name */ char *event; /* Event name */
char *group; /* Group name */ char *group; /* Group name */
struct kprobe_trace_point point; /* Trace point */ struct probe_trace_point point; /* Trace point */
int nargs; /* Number of args */ int nargs; /* Number of args */
struct kprobe_trace_arg *args; /* Arguments */ struct probe_trace_arg *args; /* Arguments */
}; };
/* Perf probe probing point */ /* Perf probe probing point */
...@@ -93,25 +93,18 @@ struct line_range { ...@@ -93,25 +93,18 @@ struct line_range {
/* Command string to events */ /* Command string to events */
extern int parse_perf_probe_command(const char *cmd, extern int parse_perf_probe_command(const char *cmd,
struct perf_probe_event *pev); struct perf_probe_event *pev);
extern int parse_kprobe_trace_command(const char *cmd,
struct kprobe_trace_event *tev);
/* Events to command string */ /* Events to command string */
extern char *synthesize_perf_probe_command(struct perf_probe_event *pev); extern char *synthesize_perf_probe_command(struct perf_probe_event *pev);
extern char *synthesize_kprobe_trace_command(struct kprobe_trace_event *tev); extern char *synthesize_probe_trace_command(struct probe_trace_event *tev);
extern int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf, extern int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf,
size_t len); size_t len);
/* Check the perf_probe_event needs debuginfo */ /* Check the perf_probe_event needs debuginfo */
extern bool perf_probe_event_need_dwarf(struct perf_probe_event *pev); extern bool perf_probe_event_need_dwarf(struct perf_probe_event *pev);
/* Convert from kprobe_trace_event to perf_probe_event */
extern int convert_to_perf_probe_event(struct kprobe_trace_event *tev,
struct perf_probe_event *pev);
/* Release event contents */ /* Release event contents */
extern void clear_perf_probe_event(struct perf_probe_event *pev); extern void clear_perf_probe_event(struct perf_probe_event *pev);
extern void clear_kprobe_trace_event(struct kprobe_trace_event *tev);
/* Command string to line-range */ /* Command string to line-range */
extern int parse_line_range_desc(const char *cmd, struct line_range *lr); extern int parse_line_range_desc(const char *cmd, struct line_range *lr);
......
...@@ -366,10 +366,10 @@ static Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name, ...@@ -366,10 +366,10 @@ static Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name,
* Probe finder related functions * Probe finder related functions
*/ */
static struct kprobe_trace_arg_ref *alloc_trace_arg_ref(long offs) static struct probe_trace_arg_ref *alloc_trace_arg_ref(long offs)
{ {
struct kprobe_trace_arg_ref *ref; struct probe_trace_arg_ref *ref;
ref = zalloc(sizeof(struct kprobe_trace_arg_ref)); ref = zalloc(sizeof(struct probe_trace_arg_ref));
if (ref != NULL) if (ref != NULL)
ref->offset = offs; ref->offset = offs;
return ref; return ref;
...@@ -385,7 +385,7 @@ static int convert_variable_location(Dwarf_Die *vr_die, struct probe_finder *pf) ...@@ -385,7 +385,7 @@ static int convert_variable_location(Dwarf_Die *vr_die, struct probe_finder *pf)
Dwarf_Word offs = 0; Dwarf_Word offs = 0;
bool ref = false; bool ref = false;
const char *regs; const char *regs;
struct kprobe_trace_arg *tvar = pf->tvar; struct probe_trace_arg *tvar = pf->tvar;
int ret; int ret;
/* TODO: handle more than 1 exprs */ /* TODO: handle more than 1 exprs */
...@@ -459,10 +459,10 @@ static int convert_variable_location(Dwarf_Die *vr_die, struct probe_finder *pf) ...@@ -459,10 +459,10 @@ static int convert_variable_location(Dwarf_Die *vr_die, struct probe_finder *pf)
} }
static int convert_variable_type(Dwarf_Die *vr_die, static int convert_variable_type(Dwarf_Die *vr_die,
struct kprobe_trace_arg *tvar, struct probe_trace_arg *tvar,
const char *cast) const char *cast)
{ {
struct kprobe_trace_arg_ref **ref_ptr = &tvar->ref; struct probe_trace_arg_ref **ref_ptr = &tvar->ref;
Dwarf_Die type; Dwarf_Die type;
char buf[16]; char buf[16];
int ret; int ret;
...@@ -500,7 +500,7 @@ static int convert_variable_type(Dwarf_Die *vr_die, ...@@ -500,7 +500,7 @@ static int convert_variable_type(Dwarf_Die *vr_die,
while (*ref_ptr) while (*ref_ptr)
ref_ptr = &(*ref_ptr)->next; ref_ptr = &(*ref_ptr)->next;
/* Add new reference with offset +0 */ /* Add new reference with offset +0 */
*ref_ptr = zalloc(sizeof(struct kprobe_trace_arg_ref)); *ref_ptr = zalloc(sizeof(struct probe_trace_arg_ref));
if (*ref_ptr == NULL) { if (*ref_ptr == NULL) {
pr_warning("Out of memory error\n"); pr_warning("Out of memory error\n");
return -ENOMEM; return -ENOMEM;
...@@ -545,10 +545,10 @@ static int convert_variable_type(Dwarf_Die *vr_die, ...@@ -545,10 +545,10 @@ static int convert_variable_type(Dwarf_Die *vr_die,
static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname, static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
struct perf_probe_arg_field *field, struct perf_probe_arg_field *field,
struct kprobe_trace_arg_ref **ref_ptr, struct probe_trace_arg_ref **ref_ptr,
Dwarf_Die *die_mem) Dwarf_Die *die_mem)
{ {
struct kprobe_trace_arg_ref *ref = *ref_ptr; struct probe_trace_arg_ref *ref = *ref_ptr;
Dwarf_Die type; Dwarf_Die type;
Dwarf_Word offs; Dwarf_Word offs;
int ret, tag; int ret, tag;
...@@ -574,7 +574,7 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname, ...@@ -574,7 +574,7 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
pr_debug2("Array real type: (%x)\n", pr_debug2("Array real type: (%x)\n",
(unsigned)dwarf_dieoffset(&type)); (unsigned)dwarf_dieoffset(&type));
if (tag == DW_TAG_pointer_type) { if (tag == DW_TAG_pointer_type) {
ref = zalloc(sizeof(struct kprobe_trace_arg_ref)); ref = zalloc(sizeof(struct probe_trace_arg_ref));
if (ref == NULL) if (ref == NULL)
return -ENOMEM; return -ENOMEM;
if (*ref_ptr) if (*ref_ptr)
...@@ -605,7 +605,7 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname, ...@@ -605,7 +605,7 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
return -EINVAL; return -EINVAL;
} }
ref = zalloc(sizeof(struct kprobe_trace_arg_ref)); ref = zalloc(sizeof(struct probe_trace_arg_ref));
if (ref == NULL) if (ref == NULL)
return -ENOMEM; return -ENOMEM;
if (*ref_ptr) if (*ref_ptr)
...@@ -738,7 +738,7 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) ...@@ -738,7 +738,7 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf)
/* Show a probe point to output buffer */ /* Show a probe point to output buffer */
static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf) static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
{ {
struct kprobe_trace_event *tev; struct probe_trace_event *tev;
Dwarf_Addr eaddr; Dwarf_Addr eaddr;
Dwarf_Die die_mem; Dwarf_Die die_mem;
const char *name; const char *name;
...@@ -803,7 +803,7 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf) ...@@ -803,7 +803,7 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
/* Find each argument */ /* Find each argument */
tev->nargs = pf->pev->nargs; tev->nargs = pf->pev->nargs;
tev->args = zalloc(sizeof(struct kprobe_trace_arg) * tev->nargs); tev->args = zalloc(sizeof(struct probe_trace_arg) * tev->nargs);
if (tev->args == NULL) if (tev->args == NULL)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < pf->pev->nargs; i++) { for (i = 0; i < pf->pev->nargs; i++) {
...@@ -1060,9 +1060,9 @@ static int find_probe_point_by_func(struct probe_finder *pf) ...@@ -1060,9 +1060,9 @@ static int find_probe_point_by_func(struct probe_finder *pf)
return _param.retval; return _param.retval;
} }
/* Find kprobe_trace_events specified by perf_probe_event from debuginfo */ /* Find probe_trace_events specified by perf_probe_event from debuginfo */
int find_kprobe_trace_events(int fd, struct perf_probe_event *pev, int find_probe_trace_events(int fd, struct perf_probe_event *pev,
struct kprobe_trace_event **tevs, int max_tevs) struct probe_trace_event **tevs, int max_tevs)
{ {
struct probe_finder pf = {.pev = pev, .max_tevs = max_tevs}; struct probe_finder pf = {.pev = pev, .max_tevs = max_tevs};
struct perf_probe_point *pp = &pev->point; struct perf_probe_point *pp = &pev->point;
...@@ -1072,7 +1072,7 @@ int find_kprobe_trace_events(int fd, struct perf_probe_event *pev, ...@@ -1072,7 +1072,7 @@ int find_kprobe_trace_events(int fd, struct perf_probe_event *pev,
Dwarf *dbg; Dwarf *dbg;
int ret = 0; int ret = 0;
pf.tevs = zalloc(sizeof(struct kprobe_trace_event) * max_tevs); pf.tevs = zalloc(sizeof(struct probe_trace_event) * max_tevs);
if (pf.tevs == NULL) if (pf.tevs == NULL)
return -ENOMEM; return -ENOMEM;
*tevs = pf.tevs; *tevs = pf.tevs;
......
...@@ -16,9 +16,9 @@ static inline int is_c_varname(const char *name) ...@@ -16,9 +16,9 @@ static inline int is_c_varname(const char *name)
} }
#ifdef DWARF_SUPPORT #ifdef DWARF_SUPPORT
/* Find kprobe_trace_events specified by perf_probe_event from debuginfo */ /* Find probe_trace_events specified by perf_probe_event from debuginfo */
extern int find_kprobe_trace_events(int fd, struct perf_probe_event *pev, extern int find_probe_trace_events(int fd, struct perf_probe_event *pev,
struct kprobe_trace_event **tevs, struct probe_trace_event **tevs,
int max_tevs); int max_tevs);
/* Find a perf_probe_point from debuginfo */ /* Find a perf_probe_point from debuginfo */
...@@ -33,7 +33,7 @@ extern int find_line_range(int fd, struct line_range *lr); ...@@ -33,7 +33,7 @@ extern int find_line_range(int fd, struct line_range *lr);
struct probe_finder { struct probe_finder {
struct perf_probe_event *pev; /* Target probe event */ struct perf_probe_event *pev; /* Target probe event */
struct kprobe_trace_event *tevs; /* Result trace events */ struct probe_trace_event *tevs; /* Result trace events */
int ntevs; /* Number of trace events */ int ntevs; /* Number of trace events */
int max_tevs; /* Max number of trace events */ int max_tevs; /* Max number of trace events */
...@@ -50,7 +50,7 @@ struct probe_finder { ...@@ -50,7 +50,7 @@ struct probe_finder {
#endif #endif
Dwarf_Op *fb_ops; /* Frame base attribute */ Dwarf_Op *fb_ops; /* Frame base attribute */
struct perf_probe_arg *pvar; /* Current target variable */ struct perf_probe_arg *pvar; /* Current target variable */
struct kprobe_trace_arg *tvar; /* Current result variable */ struct probe_trace_arg *tvar; /* Current result variable */
}; };
struct line_finder { struct line_finder {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment