From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: "Wiederhake, Tim" <tim.wiederhake@intel.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "simon.marchi@polymtl.ca" <simon.marchi@polymtl.ca>
Subject: RE: [PATCH v4 07/12] btrace: Remove struct btrace_thread_info::{begin,end}.
Date: Thu, 11 May 2017 10:02:00 -0000 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B234008871A@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <1494416867-19612-8-git-send-email-tim.wiederhake@intel.com>
Hello Tim,
> - /* The last function segment contains the current instruction, which is not
> - really part of the trace. If it contains just this one instruction, we
> - stop when we reach it; otherwise, we let the below loop run to the end. */
> - end = btinfo->end;
> - if (VEC_length (btrace_insn_s, end->insn) > 1)
> - end = NULL;
> -
> level = INT_MAX;
> - for (; bfun != end; bfun = bfun->flow.next)
> - level = std::min (level, bfun->level);
> + length = btinfo->functions.size ();
> + for (const auto &bfun: btinfo->functions)
> + {
> + /* The last function segment contains the current instruction, which is
> + not really part of the trace. If it contains just this one
> + instruction, we ignore the segment. */
> + if (bfun->number == length && VEC_length (btrace_insn_s, bfun->insn) == 1)
> + continue;
> +
> + level = std::min (level, bfun->level);
> + }
This adds an additional bfun->number == length check to the loop that could be
avoided by iterating over indices.
Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2017-05-11 10:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 11:47 [PATCH v4 00/12] btrace: Turn linked list of function call segments into vector Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 02/12] btrace: Transfer ownership of pointers Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 03/12] btrace: Add btinfo to instruction interator Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 10/12] btrace: Replace struct btrace_function::segment Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 06/12] btrace: Remove constant arguments Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 12/12] btrace: Store function segments as objects Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 08/12] btrace: Replace struct btrace_function::up Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 01/12] btrace: Use std::vector in struct btrace_thread_information Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 09/12] btrace: Remove struct btrace_function::flow Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 11/12] btrace: Remove bfun_s vector Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 05/12] btrace: Use function segment index in insn iterator Tim Wiederhake
2017-05-10 11:48 ` [PATCH v4 04/12] btrace: Use function segment index in call iterator Tim Wiederhake
2017-05-11 10:02 ` Metzger, Markus T
2017-05-17 7:56 ` Wiederhake, Tim
2017-05-10 11:48 ` [PATCH v4 07/12] btrace: Remove struct btrace_thread_info::{begin,end} Tim Wiederhake
2017-05-11 10:02 ` Metzger, Markus T [this message]
2017-05-10 14:46 ` [PATCH v4 00/12] btrace: Turn linked list of function call segments into vector Simon Marchi
2017-05-11 7:20 ` Wiederhake, Tim
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=A78C989F6D9628469189715575E55B234008871A@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=tim.wiederhake@intel.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