diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2010-05-10 13:12:07 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-05-17 21:13:51 -0400 |
commit | 7752f1b096e13991f20b59fd11ba73da3809d93c (patch) | |
tree | 9a30ef1d2a8f665bc0d1d00d2011e5036b21ef73 /tools/perf/util/probe-finder.c | |
parent | 94f3ca95787ada3d64339a4ecb2754236ab563f6 (diff) |
perf probe: Don't compile CFI related code if elfutils is old
Check elfutils version, and if it is old don't compile CFI analysis code. This
allows to compile perf with old elfutils.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Tested-by: Stephane Eranian <eranian@google.com>
Reported-by: Robert Richter <robert.richter@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <20100510171207.26029.97604.stgit@localhost6.localdomain6>
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.c | 4 |
1 files changed, 4 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); |