aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/probe-finder.c4
-rw-r--r--tools/perf/util/probe-finder.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 562b1443e785..93583eb19cd6 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -668,6 +668,7 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
668 ret = dwarf_getlocation_addr(&fb_attr, pf->addr, &pf->fb_ops, &nops, 1); 668 ret = dwarf_getlocation_addr(&fb_attr, pf->addr, &pf->fb_ops, &nops, 1);
669 if (ret <= 0 || nops == 0) { 669 if (ret <= 0 || nops == 0) {
670 pf->fb_ops = NULL; 670 pf->fb_ops = NULL;
671#if _ELFUTILS_PREREQ(0, 142)
671 } else if (nops == 1 && pf->fb_ops[0].atom == DW_OP_call_frame_cfa && 672 } else if (nops == 1 && pf->fb_ops[0].atom == DW_OP_call_frame_cfa &&
672 pf->cfi != NULL) { 673 pf->cfi != NULL) {
673 Dwarf_Frame *frame; 674 Dwarf_Frame *frame;
@@ -677,6 +678,7 @@ static int convert_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
677 (uintmax_t)pf->addr); 678 (uintmax_t)pf->addr);
678 return -ENOENT; 679 return -ENOENT;
679 } 680 }
681#endif
680 } 682 }
681 683
682 /* Find each argument */ 684 /* Find each argument */
@@ -956,8 +958,10 @@ int find_kprobe_trace_events(int fd, struct perf_probe_event *pev,
956 return -EBADF; 958 return -EBADF;
957 } 959 }
958 960
961#if _ELFUTILS_PREREQ(0, 142)
959 /* Get the call frame information from this dwarf */ 962 /* Get the call frame information from this dwarf */
960 pf.cfi = dwarf_getcfi(dbg); 963 pf.cfi = dwarf_getcfi(dbg);
964#endif
961 965
962 off = 0; 966 off = 0;
963 line_list__init(&pf.lcache); 967 line_list__init(&pf.lcache);
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index 66f1980e3855..e1f61dcd18ff 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -29,6 +29,7 @@ extern int find_line_range(int fd, struct line_range *lr);
29 29
30#include <dwarf.h> 30#include <dwarf.h>
31#include <libdw.h> 31#include <libdw.h>
32#include <version.h>
32 33
33struct probe_finder { 34struct probe_finder {
34 struct perf_probe_event *pev; /* Target probe event */ 35 struct perf_probe_event *pev; /* Target probe event */
@@ -44,7 +45,9 @@ struct probe_finder {
44 struct list_head lcache; /* Line cache for lazy match */ 45 struct list_head lcache; /* Line cache for lazy match */
45 46
46 /* For variable searching */ 47 /* For variable searching */
48#if _ELFUTILS_PREREQ(0, 142)
47 Dwarf_CFI *cfi; /* Call Frame Information */ 49 Dwarf_CFI *cfi; /* Call Frame Information */
50#endif
48 Dwarf_Op *fb_ops; /* Frame base attribute */ 51 Dwarf_Op *fb_ops; /* Frame base attribute */
49 struct perf_probe_arg *pvar; /* Current target variable */ 52 struct perf_probe_arg *pvar; /* Current target variable */
50 struct kprobe_trace_arg *tvar; /* Current result variable */ 53 struct kprobe_trace_arg *tvar; /* Current result variable */