aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2010-07-29 10:13:51 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-30 11:01:38 -0400
commit0e60836bbd392300198c5c2d918c18845428a1fe (patch)
tree80a2882bbae70e6f0679933bb44472fbcfb88993 /tools/perf/util/probe-finder.c
parent73ae8f85fda49410a59d7b532ce69a0b811ef6d5 (diff)
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: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r--tools/perf/util/probe-finder.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index f88070ea5b90..840f1aabbb74 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -366,10 +366,10 @@ static Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name,
366 * Probe finder related functions 366 * Probe finder related functions
367 */ 367 */
368 368
369static struct kprobe_trace_arg_ref *alloc_trace_arg_ref(long offs) 369static struct probe_trace_arg_ref *alloc_trace_arg_ref(long offs)
370{ 370{
371 struct kprobe_trace_arg_ref *ref; 371 struct probe_trace_arg_ref *ref;
372 ref = zalloc(sizeof(struct kprobe_trace_arg_ref)); 372 ref = zalloc(sizeof(struct probe_trace_arg_ref));
373 if (ref != NULL) 373 if (ref != NULL)
374 ref->offset = offs; 374 ref->offset = offs;
375 return ref; 375 return ref;
@@ -385,7 +385,7 @@ static int convert_variable_location(Dwarf_Die *vr_die, struct probe_finder *pf)
385 Dwarf_Word offs = 0; 385 Dwarf_Word offs = 0;
386 bool ref = false; 386 bool ref = false;
387 const char *regs; 387 const char *regs;
388 struct kprobe_trace_arg *tvar = pf->tvar; 388 struct probe_trace_arg *tvar = pf->tvar;
389 int ret; 389 int ret;
390 390
391 /* TODO: handle more than 1 exprs */ 391 /* TODO: handle more than 1 exprs */
@@ -459,10 +459,10 @@ static int convert_variable_location(Dwarf_Die *vr_die, struct probe_finder *pf)
459} 459}
460 460
461static int convert_variable_type(Dwarf_Die *vr_die, 461static int convert_variable_type(Dwarf_Die *vr_die,
462 struct kprobe_trace_arg *tvar, 462 struct probe_trace_arg *tvar,
463 const char *cast) 463 const char *cast)
464{ 464{
465 struct kprobe_trace_arg_ref **ref_ptr = &tvar->ref; 465 struct probe_trace_arg_ref **ref_ptr = &tvar->ref;
466 Dwarf_Die type; 466 Dwarf_Die type;
467 char buf[16]; 467 char buf[16];
468 int ret; 468 int ret;
@@ -500,7 +500,7 @@ static int convert_variable_type(Dwarf_Die *vr_die,
500 while (*ref_ptr) 500 while (*ref_ptr)
501 ref_ptr = &(*ref_ptr)->next; 501 ref_ptr = &(*ref_ptr)->next;
502 /* Add new reference with offset +0 */ 502 /* Add new reference with offset +0 */
503 *ref_ptr = zalloc(sizeof(struct kprobe_trace_arg_ref)); 503 *ref_ptr = zalloc(sizeof(struct probe_trace_arg_ref));
504 if (*ref_ptr == NULL) { 504 if (*ref_ptr == NULL) {
505 pr_warning("Out of memory error\n"); 505 pr_warning("Out of memory error\n");
506 return -ENOMEM; 506 return -ENOMEM;
@@ -545,10 +545,10 @@ static int convert_variable_type(Dwarf_Die *vr_die,
545 545
546static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname, 546static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
547 struct perf_probe_arg_field *field, 547 struct perf_probe_arg_field *field,
548 struct kprobe_trace_arg_ref **ref_ptr, 548 struct probe_trace_arg_ref **ref_ptr,
549 Dwarf_Die *die_mem) 549 Dwarf_Die *die_mem)
550{ 550{
551 struct kprobe_trace_arg_ref *ref = *ref_ptr; 551 struct probe_trace_arg_ref *ref = *ref_ptr;
552 Dwarf_Die type; 552 Dwarf_Die type;
553 Dwarf_Word offs; 553 Dwarf_Word offs;
554 int ret, tag; 554 int ret, tag;
@@ -574,7 +574,7 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
574 pr_debug2("Array real type: (%x)\n", 574 pr_debug2("Array real type: (%x)\n",
575 (unsigned)dwarf_dieoffset(&type)); 575 (unsigned)dwarf_dieoffset(&type));
576 if (tag == DW_TAG_pointer_type) { 576 if (tag == DW_TAG_pointer_type) {
577 ref = zalloc(sizeof(struct kprobe_trace_arg_ref)); 577 ref = zalloc(sizeof(struct probe_trace_arg_ref));
578 if (ref == NULL) 578 if (ref == NULL)
579 return -ENOMEM; 579 return -ENOMEM;
580 if (*ref_ptr) 580 if (*ref_ptr)
@@ -605,7 +605,7 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
605 return -EINVAL; 605 return -EINVAL;
606 } 606 }
607 607
608 ref = zalloc(sizeof(struct kprobe_trace_arg_ref)); 608 ref = zalloc(sizeof(struct probe_trace_arg_ref));
609 if (ref == NULL) 609 if (ref == NULL)
610 return -ENOMEM; 610 return -ENOMEM;
611 if (*ref_ptr) 611 if (*ref_ptr)
@@ -738,7 +738,7 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf)
738/* Show a probe point to output buffer */ 738/* Show a probe point to output buffer */
739static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf) 739static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
740{ 740{
741 struct kprobe_trace_event *tev; 741 struct probe_trace_event *tev;
742 Dwarf_Addr eaddr; 742 Dwarf_Addr eaddr;
743 Dwarf_Die die_mem; 743 Dwarf_Die die_mem;
744 const char *name; 744 const char *name;
@@ -803,7 +803,7 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
803 803
804 /* Find each argument */ 804 /* Find each argument */
805 tev->nargs = pf->pev->nargs; 805 tev->nargs = pf->pev->nargs;
806 tev->args = zalloc(sizeof(struct kprobe_trace_arg) * tev->nargs); 806 tev->args = zalloc(sizeof(struct probe_trace_arg) * tev->nargs);
807 if (tev->args == NULL) 807 if (tev->args == NULL)
808 return -ENOMEM; 808 return -ENOMEM;
809 for (i = 0; i < pf->pev->nargs; i++) { 809 for (i = 0; i < pf->pev->nargs; i++) {
@@ -1060,9 +1060,9 @@ static int find_probe_point_by_func(struct probe_finder *pf)
1060 return _param.retval; 1060 return _param.retval;
1061} 1061}
1062 1062
1063/* Find kprobe_trace_events specified by perf_probe_event from debuginfo */ 1063/* Find probe_trace_events specified by perf_probe_event from debuginfo */
1064int find_kprobe_trace_events(int fd, struct perf_probe_event *pev, 1064int find_probe_trace_events(int fd, struct perf_probe_event *pev,
1065 struct kprobe_trace_event **tevs, int max_tevs) 1065 struct probe_trace_event **tevs, int max_tevs)
1066{ 1066{
1067 struct probe_finder pf = {.pev = pev, .max_tevs = max_tevs}; 1067 struct probe_finder pf = {.pev = pev, .max_tevs = max_tevs};
1068 struct perf_probe_point *pp = &pev->point; 1068 struct perf_probe_point *pp = &pev->point;
@@ -1072,7 +1072,7 @@ int find_kprobe_trace_events(int fd, struct perf_probe_event *pev,
1072 Dwarf *dbg; 1072 Dwarf *dbg;
1073 int ret = 0; 1073 int ret = 0;
1074 1074
1075 pf.tevs = zalloc(sizeof(struct kprobe_trace_event) * max_tevs); 1075 pf.tevs = zalloc(sizeof(struct probe_trace_event) * max_tevs);
1076 if (pf.tevs == NULL) 1076 if (pf.tevs == NULL)
1077 return -ENOMEM; 1077 return -ENOMEM;
1078 *tevs = pf.tevs; 1078 *tevs = pf.tevs;