diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-09-09 14:40:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-09 14:40:08 -0400 |
commit | 2aa61274efb9f532deaebc9812675a27af1994cb (patch) | |
tree | c2f70525dc152e0ddce60f1a3021473cc6a3f298 /tools | |
parent | 359d5106a2ff4ffa2ba129ec8f54743c341dabfc (diff) | |
parent | 5e11637e2c929e34dcc0fbbfb48bdb638937701a (diff) |
Merge branch 'perf/urgent' into perf/core
Merge reason: Pick up pending fixes before applying dependent new changes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/probe-event.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.c | 42 |
2 files changed, 30 insertions, 13 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index e72f05c3bef0..fcc16e4349df 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -1539,6 +1539,7 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev, | |||
1539 | goto error; | 1539 | goto error; |
1540 | } | 1540 | } |
1541 | tev->point.offset = pev->point.offset; | 1541 | tev->point.offset = pev->point.offset; |
1542 | tev->point.retprobe = pev->point.retprobe; | ||
1542 | tev->nargs = pev->nargs; | 1543 | tev->nargs = pev->nargs; |
1543 | if (tev->nargs) { | 1544 | if (tev->nargs) { |
1544 | tev->args = zalloc(sizeof(struct probe_trace_arg) | 1545 | tev->args = zalloc(sizeof(struct probe_trace_arg) |
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 525136684d4e..32b81f707ff5 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -686,6 +686,25 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
686 | char buf[32], *ptr; | 686 | char buf[32], *ptr; |
687 | int ret, nscopes; | 687 | int ret, nscopes; |
688 | 688 | ||
689 | if (!is_c_varname(pf->pvar->var)) { | ||
690 | /* Copy raw parameters */ | ||
691 | pf->tvar->value = strdup(pf->pvar->var); | ||
692 | if (pf->tvar->value == NULL) | ||
693 | return -ENOMEM; | ||
694 | if (pf->pvar->type) { | ||
695 | pf->tvar->type = strdup(pf->pvar->type); | ||
696 | if (pf->tvar->type == NULL) | ||
697 | return -ENOMEM; | ||
698 | } | ||
699 | if (pf->pvar->name) { | ||
700 | pf->tvar->name = strdup(pf->pvar->name); | ||
701 | if (pf->tvar->name == NULL) | ||
702 | return -ENOMEM; | ||
703 | } else | ||
704 | pf->tvar->name = NULL; | ||
705 | return 0; | ||
706 | } | ||
707 | |||
689 | if (pf->pvar->name) | 708 | if (pf->pvar->name) |
690 | pf->tvar->name = strdup(pf->pvar->name); | 709 | pf->tvar->name = strdup(pf->pvar->name); |
691 | else { | 710 | else { |
@@ -700,19 +719,6 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
700 | if (pf->tvar->name == NULL) | 719 | if (pf->tvar->name == NULL) |
701 | return -ENOMEM; | 720 | return -ENOMEM; |
702 | 721 | ||
703 | if (!is_c_varname(pf->pvar->var)) { | ||
704 | /* Copy raw parameters */ | ||
705 | pf->tvar->value = strdup(pf->pvar->var); | ||
706 | if (pf->tvar->value == NULL) | ||
707 | return -ENOMEM; | ||
708 | if (pf->pvar->type) { | ||
709 | pf->tvar->type = strdup(pf->pvar->type); | ||
710 | if (pf->tvar->type == NULL) | ||
711 | return -ENOMEM; | ||
712 | } | ||
713 | return 0; | ||
714 | } | ||
715 | |||
716 | pr_debug("Searching '%s' variable in context.\n", | 722 | pr_debug("Searching '%s' variable in context.\n", |
717 | pf->pvar->var); | 723 | pf->pvar->var); |
718 | /* Search child die for local variables and parameters. */ | 724 | /* Search child die for local variables and parameters. */ |
@@ -783,6 +789,16 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
783 | /* This function has no name. */ | 789 | /* This function has no name. */ |
784 | tev->point.offset = (unsigned long)pf->addr; | 790 | tev->point.offset = (unsigned long)pf->addr; |
785 | 791 | ||
792 | /* Return probe must be on the head of a subprogram */ | ||
793 | if (pf->pev->point.retprobe) { | ||
794 | if (tev->point.offset != 0) { | ||
795 | pr_warning("Return probe must be on the head of" | ||
796 | " a real function\n"); | ||
797 | return -EINVAL; | ||
798 | } | ||
799 | tev->point.retprobe = true; | ||
800 | } | ||
801 | |||
786 | pr_debug("Probe point found: %s+%lu\n", tev->point.symbol, | 802 | pr_debug("Probe point found: %s+%lu\n", tev->point.symbol, |
787 | tev->point.offset); | 803 | tev->point.offset); |
788 | 804 | ||