From: Jiri Olsa <jolsa@redhat.com>
To: Jean Pihet <jean.pihet@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH 3/3] perf: parse the .debug_frame section in case .eh_frame is not present
Date: Fri, 6 Sep 2013 12:17:10 +0200 [thread overview]
Message-ID: <20130906101710.GA2749@krava.brq.redhat.com> (raw)
In-Reply-To: <CAFrcx1nYS1J5zZjAQMgXrrkz9C332-EJQgj=2vcoidSvLe_JeQ@mail.gmail.com>
On Thu, Sep 05, 2013 at 06:49:13PM +0200, Jean Pihet wrote:
> Hi Jiri,
>
> On 5 September 2013 18:30, Jiri Olsa <jolsa@redhat.com> wrote:
> > On Wed, Sep 04, 2013 at 08:04:14PM +0200, Jean Pihet wrote:
> >> On ARM the debug info is not present in the .eh_frame sections but
> >> instead in .debug_frame.
> >> Use libunwind to load and parse the debug info.
> >
> > hum, cannot make final link:
> >
> > $ make LIBUNWIND_DIR=/opt/libunwind/
> > CHK -fstack-protector-all
> > CHK -Wstack-protector
> > CHK -Wvolatile-register-var
> > CHK -D_FORTIFY_SOURCE=2
> > CHK bionic
> > CHK libelf
> > CHK libdw
> > CHK -DLIBELF_MMAP
> > CHK -DLIBELF_MMAP
> > CHK libunwind
> > CHK libaudit
> >
> > ...
> >
> > make[1]: `liblk.a' is up to date.
> > SUBDIR /home/jolsa/linux-perf/tools/lib/traceevent/
> > LINK perf
> > libperf.a(unwind.o): In function `find_proc_info':
> > /home/jolsa/linux-perf/tools/perf/util/unwind.c:339: undefined reference to `_Ux86_64_dwarf_find_debug_frame'
> > collect2: ld returned 1 exit status
> > make: *** [perf] Error 1
> >
> >
> > I'm using the latest code from git://git.sv.gnu.org/libunwind.git
> >
> > Looks like dwarf_find_debug_frame is not exported, although
> > it looks like it is based on what I see in libunwind sources ;-)
> >
> > What did I miss?
> Weird, I do not have the error on x86_64. I am investigating this and
> will come back to you asap.
>
> >
> > Also few typo comments below..
> >
> > thanks,
> > jirka
> >
> >>
> >> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
> >> ---
> >> tools/perf/util/unwind.c | 70 +++++++++++++++++++++++++++++++++++++-----------
> >> 1 file changed, 54 insertions(+), 16 deletions(-)
> >>
> >> diff --git a/tools/perf/util/unwind.c b/tools/perf/util/unwind.c
> >> index 958723b..5353b32 100644
> >> --- a/tools/perf/util/unwind.c
> >> +++ b/tools/perf/util/unwind.c
> >> @@ -39,6 +39,14 @@ UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
> >>
> >> #define dwarf_search_unwind_table UNW_OBJ(dwarf_search_unwind_table)
> >>
> >> +extern int
> >> +UNW_OBJ(dwarf_find_debug_frame) (int found, unw_dyn_info_t *di_debug,
> >> + unw_word_t ip, unw_word_t segbase,
> >> + const char *obj_name, unw_word_t start,
> >> + unw_word_t end);
> >> +
> >> +#define dwarf_find_debug_frame UNW_OBJ(dwarf_find_debug_frame)
> >> +
> >> #define DW_EH_PE_FORMAT_MASK 0x0f /* format of the encoded value */
> >> #define DW_EH_PE_APPL_MASK 0x70 /* how the value is to be applied */
> >>
> >> @@ -245,8 +253,9 @@ static int unwind_spec_ehframe(struct dso *dso, struct machine *machine,
> >> return 0;
> >> }
> >>
> >> -static int read_unwind_spec(struct dso *dso, struct machine *machine,
> >> - u64 *table_data, u64 *segbase, u64 *fde_count)
> >> +static int read_unwind_spec_eh_frame(struct dso *dso, struct machine *machine,
> >> + u64 *table_data, u64 *segbase,
> >> + u64 *fde_count)
> >> {
> >> int ret = -EINVAL, fd;
> >> u64 offset;
> >> @@ -255,6 +264,7 @@ static int read_unwind_spec(struct dso *dso, struct machine *machine,
> >> if (fd < 0)
> >> return -EINVAL;
> >>
> >> + /* Check the .eh_frame section for unwinding info */
> >> offset = elf_section_offset(fd, ".eh_frame_hdr");
> >> close(fd);
> >>
> >> @@ -263,10 +273,27 @@ static int read_unwind_spec(struct dso *dso, struct machine *machine,
> >> table_data, segbase,
> >> fde_count);
> >>
> >> - /* TODO .debug_frame check if eh_frame_hdr fails */
> >> return ret;
> >> }
> >>
> >> +static int read_unwind_spec_debug_frame(struct dso *dso,
> >> + struct machine *machine, u64 *offset)
> >> +{
> >
> > some strange formatting issue ^^^ ;-)
> I am using 4-spaces tabs. scripts/checkpatch.pl reported it to me in
> the form of too long lines.
> Should I change the code to 8-spaces tabs?
>
right, if I set tabs to 4 space then it's ok
so I guess 8 is globally agreed ;-)
jirka
next prev parent reply other threads:[~2013-09-06 10:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-04 18:04 [PATCH 0/3] perf: parse the dwarf backtrace info from .debug_frame section Jean Pihet
2013-09-04 18:04 ` [PATCH 1/3] ARM: perf: add support for perf regs API Jean Pihet
2013-09-05 13:21 ` Ard Biesheuvel
2013-09-04 18:04 ` [PATCH 2/3] ARM: perf: wire up perf_regs and unwind support for ARM Jean Pihet
2013-09-04 18:04 ` [PATCH 3/3] perf: parse the .debug_frame section in case .eh_frame is not present Jean Pihet
2013-09-05 12:45 ` Will Deacon
2013-09-05 13:05 ` Jean Pihet
2013-09-05 13:17 ` Ard Biesheuvel
2013-09-05 13:19 ` Will Deacon
2013-09-05 13:33 ` Jean Pihet
2013-09-05 15:29 ` Jean Pihet
2013-09-05 15:45 ` Ard Biesheuvel
2013-09-05 13:10 ` Ard Biesheuvel
2013-09-05 16:30 ` Jiri Olsa
2013-09-05 16:49 ` Jean Pihet
2013-09-06 10:17 ` Jiri Olsa [this message]
2013-09-06 9:31 ` Jean Pihet
2013-09-06 10:17 ` Jiri Olsa
2013-09-06 14:10 ` Jean Pihet
2013-09-09 10:00 [PATCH 0/3] perf: parse the dwarf backtrace info from .debug_frame section Jean Pihet
2013-09-09 10:00 ` [PATCH 3/3] perf: parse the .debug_frame section in case .eh_frame is not present Jean Pihet
2013-09-10 19:14 ` David Ahern
2013-09-10 19:38 ` Jean Pihet
2013-09-12 12:38 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130906101710.GA2749@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=jean.pihet@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@linaro.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®