public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: "Wiederhake, Tim" <tim.wiederhake@intel.com>,
	"gdb-patches@sourceware.org"	<gdb-patches@sourceware.org>
Subject: RE: [PATCH 08/11] [SQUASH] btrace: Adjust struct btrace_function::{flow,segment}.
Date: Fri, 24 Feb 2017 09:33:00 -0000	[thread overview]
Message-ID: <A78C989F6D9628469189715575E55B234004E90E@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <1487337989-6367-9-git-send-email-tim.wiederhake@intel.com>

> -----Original Message-----
> From: Wiederhake, Tim
> Sent: Friday, February 17, 2017 2:26 PM
> To: gdb-patches@sourceware.org
> Cc: Metzger, Markus T <markus.t.metzger@intel.com>
> Subject: [PATCH 08/11] [SQUASH] btrace: Adjust struct
> btrace_function::{flow,segment}.

Hello Tim,


> -  /* The previous and next segment belonging to the same function.
> -     If a function calls another function, the former will have at least
> -     two segments: one before the call and another after the return.  */
> -  struct btrace_func_link segment;
> -
> -  /* The previous and next function in control flow order.  */
> -  struct btrace_func_link flow;
> +  /* The function segment numbers of the previous and next segment belonging
> to
> +     the same function.  If a function calls another function, the former will
> +     have at least two segments: one before the call and another after the
> +     return.  Will be zero if there is no such function segment.  */
> +  unsigned int prev_segment;
> +  unsigned int next_segment;

Since we don't need FLOW.PREV/NEXT anymore, I'd omit _SEGMENT in the name
and just call it PREV and NEXT.  The comment will describe what they mean.

If we manage to not needing to squash the patches, I'd keep the two parts separate.

 
> -  for (; bfun != NULL; bfun = bfun->flow.next)
> -    bfun->level += adjustment;
> +  while (bfun != NULL)
> +    {
> +      bfun->level += adjustment;
> +      bfun = ftrace_find_call_by_number (btinfo, bfun->number + 1);
> +    }

Could we do a VEC_iterate instead?


>    level = INT_MAX;
> -  for (; bfun != end; bfun = bfun->flow.next)
> -    level = std::min (level, bfun->level);
> +  while (bfun != end)
> +    {
> +      level = std::min (level, bfun->level);
> +      bfun = ftrace_find_call_by_number (btinfo, bfun->number + 1);
> +    }

Same here.

Thanks,
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

  reply	other threads:[~2017-02-24  9:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 13:27 [PATCH 00/11] btrace: Turn linked list of function call segments into vector Tim Wiederhake
2017-02-17 13:27 ` [PATCH 03/11] btrace: Add btinfo to instruction interator Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 04/11] btrace: Use function segment index in call iterator Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 10/11] [SQUASH] btrace: Remove bfun_s vector Tim Wiederhake
2017-02-17 13:27 ` [PATCH 07/11] [SQUASH] btrace: Adjust struct btrace_function::up Tim Wiederhake
2017-02-24  9:33   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 02/11] btrace: Change parameters to use btrace_thread_info Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 09/11] [SQUASH] btrace: Remove struct btrace_thread_info::{begin,end} Tim Wiederhake
2017-02-17 13:27 ` [PATCH 06/11] [SQUASH] btrace: Save function calls in a vector Tim Wiederhake
2017-02-24  9:33   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 08/11] [SQUASH] btrace: Adjust struct btrace_function::{flow,segment} Tim Wiederhake
2017-02-24  9:33   ` Metzger, Markus T [this message]
2017-02-17 13:27 ` [PATCH 01/11] btrace: Use struct btrace_thread_info fields directly Tim Wiederhake
2017-02-17 13:27 ` [PATCH 05/11] btrace: Use function segment index in insn iterator Tim Wiederhake
2017-02-24  9:32   ` Metzger, Markus T
2017-02-17 13:27 ` [PATCH 11/11] [SQUASH] btrace: Cleanup Tim Wiederhake
2017-02-24  9:32 ` [PATCH 00/11] btrace: Turn linked list of function call segments into vector Metzger, Markus T

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=A78C989F6D9628469189715575E55B234004E90E@IRSMSX104.ger.corp.intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).