From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128528 invoked by alias); 13 Feb 2017 03:58:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 128313 invoked by uid 89); 13 Feb 2017 03:57:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_40,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=sk:btrace_, btraceh, btrace.h, UD:btrace.h X-HELO: mail-pg0-f65.google.com Received: from mail-pg0-f65.google.com (HELO mail-pg0-f65.google.com) (74.125.83.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Feb 2017 03:57:57 +0000 Received: by mail-pg0-f65.google.com with SMTP id 75so8609623pgf.3 for ; Sun, 12 Feb 2017 19:57:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=EyHHtGu3+lEJ+oBjhho3nuNA3LY++UC2sZUmokGkGsA=; b=VLG0VgVZG1gYUBVRQ3WVg1rvVeb+jDsrsKmtYoASaBrWnXttVa8f6J6+c8tk4dMUN+ HqvJ9JAaQtodxrpo+JQzsD4LbJCnQABcMC9wq/hbmq8IR8E7/Wku0OmuriIiWQj5wJxU QYQviHS1hYLCPC51r8bYjCacvp+Mc5lMBqXav7Id3w7DirVm7Ywlk25Os1j7KOf8ctiY 4ypd/DpXAw8lBwvJ4UsI6oboqmaF2KSioRtjD4xTba9AuQ3RE7Xt98GzMlLuTr4zw8O/ gy6aZRNleCMc6UlRFJWciTgtL4iHnw2ZLom08hshcvvtW6hBhb/0PNjNHONsIPppKjMC Mj1A== X-Gm-Message-State: AMke39kOcqEptR4PmLsrMQGoBxRgMQaiLrqBt0IN92BttCnSefbfegqTyyv7cXMYeoiTAA== X-Received: by 10.98.73.74 with SMTP id w71mr24051388pfa.52.1486958276209; Sun, 12 Feb 2017 19:57:56 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by smtp.gmail.com with ESMTPSA id s21sm11087913pgg.65.2017.02.12.19.57.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Feb 2017 19:57:55 -0800 (PST) From: Doug Evans To: Tim Wiederhake Cc: gdb-patches@sourceware.org, markus.t.metzger@intel.com, palves@redhat.com Subject: Re: [PATCH v5 3/9] btrace: Use binary search to find instruction. References: <1485527996-32506-1-git-send-email-tim.wiederhake@intel.com> <1485527996-32506-4-git-send-email-tim.wiederhake@intel.com> Date: Mon, 13 Feb 2017 03:58:00 -0000 In-Reply-To: <1485527996-32506-4-git-send-email-tim.wiederhake@intel.com> (Tim Wiederhake's message of "Fri, 27 Jan 2017 15:39:50 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00314.txt.bz2 Tim Wiederhake writes: > Currently, btrace_find_insn_by_number will iterate over all function call > segments to find the one that contains the needed instruction. This linear > search is too slow for the upcoming Python bindings that will use this > function to access instructions. This patch introduces a vector in struct > btrace_thread_info that holds pointers to all recorded function segments and > allows to use binary search. > > The proper solution is to turn the underlying tree into a vector of objects > and use indices for access. This requires more work. A patch set is > currently being worked on and will be published later. > > 2017-01-27 Tim Wiederhake > > gdb/ChangeLog: > * btrace.c (btrace_fetch): Copy function call segments pointer > into a vector. > (btrace_clear): Clear the vector. > (btrace_find_insn_by_number): Use binary search to find the correct > function call segment. > * btrace.h (brace_fun_p): New typedef. > (struct btrace_thread_info) : New field. LGTM