Re: [PATCH] Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.

2013-12-12 Thread Jan Kratochvil
On Thu, 12 Dec 2013 11:51:37 +0100, Mark Wielaard wrote: > +/* Fetch one entry from the module's symbol table and the associated > + address value. On errors, returns NULL. If successful, fills in > + *SYM, *ADDR and returns the string for st_name. This works like > + gelf_getsym. *ADDR is

[PATCH v2 2/3] libdw: Simplify and inline get_uleb128 and get_sleb128

2013-12-12 Thread Josh Stone
This removes the IS_LIBDW distinction so LEB128 operations are now always inlined, and the implementations are simplified, more direct. Signed-off-by: Josh Stone --- libdw/ChangeLog | 15 +++ libdw/Makefile.am | 3 +- libdw/dwarf_getlocation.c | 3 +- libdw/memory-acce

[PATCH v2 1/3] libdw: Add an inlined fast path for __libdw_form_val_len

2013-12-12 Thread Josh Stone
Quite a few DW_FORMs have a fixed length for their data, and we can easily represent these in a small lookup table. The rest of the forms are left in the old function to compute as needed. Combined with inlining, this takes care of many forms with fewer branches and without any call. (It's conce

[PATCH v2 3/3] lib: Avoid the hash-lookup division if possible

2013-12-12 Thread Josh Stone
For Dwarf_Abbrev codes, the most common case is that they're packed at the low end, saving uleb128 encoding size. Since the hash table is always resized to be no more than 90% full, those codes are always less than the table size, and dividing for the remainder is unnecessary. Dwarf_Dies are freq

[PATCH v2 0/3] Performance tweaks for libdw

2013-12-12 Thread Josh Stone
Thanks to Petr for the reviews - I made these changes: Patch 1: Use 0x80 to represent flag_present's 0 in the table. Patch 2: Added a comment for the manually unrolled step 0 of uleb128, and made both get_?leb128 macros into simple expressions. Fixed the one caller who was getting a set-but-unu

Re: [PATCH 3/3] Add a simple array for CU abbreviations with low codes

2013-12-12 Thread Josh Stone
On 12/12/2013 11:16 AM, Josh Stone wrote: > On 12/12/2013 09:07 AM, Petr Machata wrote: >> Josh Stone writes: >> >>> struct Dwarf_CU >>> { >>> @@ -283,7 +285,9 @@ struct Dwarf_CU >>>size_t type_offset; >>>uint64_t type_sig8; >>> >>> - /* Hash table for the abbreviations. */ >>> + /*

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2013-12-12 Thread Petr Machata
Josh Stone writes: > On 12/12/2013 04:13 AM, Petr Machata wrote: >> Josh Stone writes: >>> +static inline uint64_t >>> +__libdw_get_uleb128 (const unsigned char **addrp) >>> +{ >>> + uint64_t acc = 0; >>> + get_uleb128_step (acc, *addrp, 0); >>> + for (unsigned int i = 1; i < len_leb128(acc);

Re: [patchv4 4/4] Provide virtual symbols for ppc64 function descriptors

2013-12-12 Thread Jan Kratochvil
On Thu, 12 Dec 2013 16:07:30 +0100, Mark Wielaard wrote: > Then the only feature you seem to want that is missing is a real search > on name or identifier. Where the identifier might have some modifier(s) > that have a possible arch specific meaning that matches it to some > address and/or some oth

Re: [PATCH] Introduce dwfl_module_getsym_info and dwfl_module_addrinfo.

2013-12-12 Thread Jan Kratochvil
On Thu, 12 Dec 2013 11:51:37 +0100, Mark Wielaard wrote: > --- /dev/null > +++ b/backends/ppc64_resolve_sym.c > @@ -0,0 +1,63 @@ > +/* Resolve symbol values through .opd function descriptors. > + Copyright (C) 2013 Red Hat, Inc. > + This file is part of elfutils. > + > + This file is free sof

Re: [PATCH 3/3] Add a simple array for CU abbreviations with low codes

2013-12-12 Thread Josh Stone
On 12/12/2013 09:07 AM, Petr Machata wrote: > Josh Stone writes: > >> struct Dwarf_CU >> { >> @@ -283,7 +285,9 @@ struct Dwarf_CU >>size_t type_offset; >>uint64_t type_sig8; >> >> - /* Hash table for the abbreviations. */ >> + /* Simple array for the abbreviations with low codes.

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2013-12-12 Thread Josh Stone
On 12/12/2013 04:13 AM, Petr Machata wrote: > Josh Stone writes: >> +static inline uint64_t >> +__libdw_get_uleb128 (const unsigned char **addrp) >> +{ >> + uint64_t acc = 0; >> + get_uleb128_step (acc, *addrp, 0); >> + for (unsigned int i = 1; i < len_leb128(acc); ++i) >> +get_uleb128_step

Re: [PATCH 1/3] Add an inlined fast path for __libdw_form_val_len

2013-12-12 Thread Josh Stone
On 12/12/2013 02:47 AM, Petr Machata wrote: > Josh Stone writes: >> + /* Note that form_lengths[flag_present] is 0, like every other absent >> index. >> + * But since flag_present's length truly is 0, check for it explicitly. >> */ >> + if (form == DW_FORM_flag_present) >> +return 0; >

Re: [PATCH 3/3] Add a simple array for CU abbreviations with low codes

2013-12-12 Thread Petr Machata
Josh Stone writes: > struct Dwarf_CU > { > @@ -283,7 +285,9 @@ struct Dwarf_CU >size_t type_offset; >uint64_t type_sig8; > > - /* Hash table for the abbreviations. */ > + /* Simple array for the abbreviations with low codes. */ > + Dwarf_Abbrev *abbrev_array[CU_ABBREV_ARRAY_SIZE]

Re: [patchv4 4/4] Provide virtual symbols for ppc64 function descriptors

2013-12-12 Thread Mark Wielaard
On Thu, 2013-12-12 at 11:49 +0100, Mark Wielaard wrote: > But now that we do have to provide a new API anyway, we could make a > lookup for an address match against either or both of the values or > addresses. Currently I haven't done that, but we could make > dwfl_module_addrinfo (mod, addr, off,

Re: [PATCH] Add config/ar-lib to .gitignore

2013-12-12 Thread Mark Wielaard
On Tue, 2013-12-10 at 16:54 -0800, Josh Stone wrote: > +2013-12-09 Josh Stone > + > + * .gitignore: Add config/ar-lib, installed due to AM_PROG_AR. Yes, that seems right. It got introduced with automake 1.12. Still running 1.11 here. Thanks, Mark

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128

2013-12-12 Thread Petr Machata
Josh Stone writes: > diff --git a/libdw/ChangeLog b/libdw/ChangeLog > index a2e4b142a107..93396e404d97 100644 > --- a/libdw/ChangeLog > +++ b/libdw/ChangeLog > @@ -1,3 +1,17 @@ > +2013-12-10 Josh Stone > + > + * memory-access.h (get_uleb128_rest_return): Removed. > + (get_sleb128_rest_

Re: [patchv4 4/4] Provide virtual symbols for ppc64 function descriptors

2013-12-12 Thread Mark Wielaard
Hi Jan, On Mon, 2013-12-09 at 20:20 +0100, Jan Kratochvil wrote: > On Wed, 04 Dec 2013 20:02:33 +0100, Mark Wielaard wrote: > > No, I suggest just NOT adding extra names, dot mangled, or not. But just > > keep the function symbol names as is. Just resolve the values (which we > > already adjust an

Re: [PATCH 1/3] Add an inlined fast path for __libdw_form_val_len

2013-12-12 Thread Petr Machata
Josh Stone writes: > + /* Small lookup table of forms with fixed lengths. */ > + static const uint8_t form_lengths[] = > +{ > + [DW_FORM_data1] = 1, [DW_FORM_ref1] = 1, [DW_FORM_flag] = 1, > + [DW_FORM_data2] = 2, [DW_FORM_ref2] = 2, > + [DW_FORM_data4] = 4, [DW_FORM_ref4] =

Re: [patchv4 4/4] Provide virtual symbols for ppc64 function descriptors

2013-12-12 Thread Mark Wielaard
On Wed, 2013-12-04 at 21:26 +0100, Jan Kratochvil wrote: > As I see you mean it seriously I would find correct to at least wait with this > patch check-in until IBM ABI authority will comment it. I understand you > think it is unrelated to ABI - but this is the subject of our disagreement. Of co