Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1655105
| From | Jiri Slaby <jslaby@suse.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder |
| Date | 2017-06-01 14:50 +0200 |
| Message-ID | <tNxI5-2Aw-7@gated-at.bofh.it> (permalink) |
| References | <tNr9D-6Ua-3@gated-at.bofh.it> <tNr9E-6Ua-23@gated-at.bofh.it> <tNw9k-1Oq-31@gated-at.bofh.it> <tNxoJ-2tN-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 06/01/2017, 02:26 PM, Josh Poimboeuf wrote:
> On Thu, Jun 01, 2017 at 01:05:39PM +0200, Peter Zijlstra wrote:
>> On Thu, Jun 01, 2017 at 12:44:16AM -0500, Josh Poimboeuf wrote:
>>
>>> +static struct undwarf *__undwarf_lookup(struct undwarf *undwarf,
>>> + unsigned int num, unsigned long ip)
>>> +{
>>> + struct undwarf *first = undwarf;
>>> + struct undwarf *last = undwarf + num - 1;
>>> + struct undwarf *mid;
>>> + unsigned long u_ip;
>>> +
>>> + while (first <= last) {
>>> + mid = first + ((last - first) / 2);
>>> + u_ip = undwarf_ip(mid);
>>> +
>>> + if (ip >= u_ip) {
>>> + if (ip < u_ip + mid->len)
>>> + return mid;
>>> + first = mid + 1;
>>> + } else
>>> + last = mid - 1;
>>> + }
>>> +
>>> + return NULL;
>>> +}
>>
>> That's a bog standard binary search thing, don't we have a helper for
>> that someplace?
>
> I wasn't able to find one...
There is bsearch, but that doesn't support searching for a value in
between of 2 keys. I.e. what we typically have is these keys:
some_function1 at 0x1000
some_function2 at 0x2000
and we look for IP which can be e.g. 0x1010. The bsearch's cmp function
currently has no option to say, yes, the last one you asked me was the
right one, this one is after it already.
thanks,
--
js
suse labs
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 00/10] x86: undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
[RFC PATCH 06/10] x86/entry: add CFI hint undwarf annotations Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
Re: [RFC PATCH 06/10] x86/entry: add CFI hint undwarf annotations Andy Lutomirski <luto@kernel.org> - 2017-06-01 16:10 +0200
Re: [RFC PATCH 06/10] x86/entry: add CFI hint undwarf annotations Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 16:30 +0200
Re: [RFC PATCH 06/10] x86/entry: add CFI hint undwarf annotations Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 16:30 +0200
Re: [RFC PATCH 06/10] x86/entry: add CFI hint undwarf annotations Andy Lutomirski <luto@kernel.org> - 2017-06-01 16:50 +0200
Re: [RFC PATCH 06/10] x86/entry: add CFI hint undwarf annotations Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 17:10 +0200
[RFC PATCH 09/10] extable: add undwarf table sorting ability to sorttable script Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
[RFC PATCH 08/10] extable: rename 'sortextable' script to 'sorttable' Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
[RFC PATCH 05/10] objtool, x86: add facility for asm code to provide CFI hints Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
Re: [RFC PATCH 05/10] objtool, x86: add facility for asm code to provide CFI hints Andy Lutomirski <luto@kernel.org> - 2017-06-01 16:00 +0200
Re: [RFC PATCH 05/10] objtool, x86: add facility for asm code to provide CFI hints Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 16:20 +0200
Re: [RFC PATCH 05/10] objtool, x86: add facility for asm code to provide CFI hints Andy Lutomirski <luto@kernel.org> - 2017-06-01 16:50 +0200
Re: [RFC PATCH 05/10] objtool, x86: add facility for asm code to provide CFI hints Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 17:10 +0200
[RFC PATCH 01/10] objtool: move checking code to check.c Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
[RFC PATCH 07/10] x86/asm: add CFI hint annotations to sync_core() Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
[RFC PATCH 04/10] objtool: add undwarf debuginfo generation Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
[RFC PATCH 10/10] x86/unwind: add undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 13:10 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 14:30 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Jiri Slaby <jslaby@suse.cz> - 2017-06-01 14:50 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 15:10 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 15:50 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 15:20 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 14:20 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 14:40 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 15:20 +0200
Re: [RFC PATCH 10/10] x86/unwind: add undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 17:10 +0200
[RFC PATCH 02/10] objtool, x86: add several functions and files to the objtool whitelist Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 07:50 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Ingo Molnar <mingo@kernel.org> - 2017-06-01 08:10 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 14:00 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 14:20 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Jiri Slaby <jslaby@suse.cz> - 2017-06-01 14:40 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Jiri Slaby <jslaby@suse.cz> - 2017-06-01 15:00 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 15:00 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 14:50 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Peter Zijlstra <peterz@infradead.org> - 2017-06-01 15:30 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-06-06 16:20 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Andy Lutomirski <luto@kernel.org> - 2017-06-01 16:00 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Ingo Molnar <mingo@kernel.org> - 2017-06-01 16:00 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Jiri Slaby <jslaby@suse.cz> - 2017-06-01 16:00 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Jiri Slaby <jslaby@suse.cz> - 2017-06-02 10:40 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2017-06-01 16:10 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Jiri Slaby <jslaby@suse.cz> - 2017-06-01 16:10 +0200
Re: [RFC PATCH 00/10] x86: undwarf unwinder Mel Gorman <mgorman@suse.de> - 2017-06-02 12:50 +0200
csiph-web