public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Zied Guermazi <zied.guermazi@trande.de>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v5 2/7] add btrace coresight related commands
Date: Tue, 27 Apr 2021 17:31:14 +0000	[thread overview]
Message-ID: <DM5PR11MB1690EDF33DE3274FDD504093DE419@DM5PR11MB1690.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210422140921.175221-3-zied.guermazi@trande.de>

Hello Zied,

>This patch extends the commands needed for using branch tracing
>with ARM CoreSight traces.
>Those commands are:
>set record btrace etm sink
>set record btrace etm buffer-size
>record btrace etm

This patch looks good to me.  I'll skip it in future reviews.  Please point
out updates explicitly.

See a few nits below.


>diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
>index d13cbda2c11..48627d5d71a 100644
>--- a/gdb/doc/gdb.texinfo
>+++ b/gdb/doc/gdb.texinfo
>@@ -7796,6 +7816,29 @@ also need longer to process the branch trace data
>before it can be used.
> Show the current setting of the requested ring buffer size for branch
> tracing in Intel Processor Trace format.
>
>+@kindex set record btrace etm
>+@item set record btrace etm buffer-size @var{size}
>+@itemx set record btrace etm buffer-size unlimited
>+Set the requested ring buffer size for branch tracing in ARM
>+CoreSight ETM Trace format.  Default is 16KB.
>+
>+If @var{size} is a positive number, then @value{GDBN} will try to
>+allocate a buffer of at least @var{size} bytes for each new thread
>+that uses the btrace recording method and the ARM CoreSight ETM
>+format.  The actually obtained buffer size may differ from the
>+requested @var{size}.  Use the @code{info record} command to see the
>+actual buffer size for each thread.
>+
>+If @var{limit} is @code{unlimited} or zero, @value{GDBN} will try to
>+allocate a buffer of 4MB.

Is this 4MB or rather 4GB?


>diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
>index b7b3c91f85d..83768694193 100644
>--- a/gdb/record-btrace.c
>+++ b/gdb/record-btrace.c
>@@ -2675,7 +2699,7 @@ record_btrace_target::stop (ptid_t ptid)
> 	  tp->btrace.flags |= BTHR_STOP;
> 	}
>     }
>- }
>+}

That looks odd.  What changed?


>@@ -3233,4 +3342,6 @@ to see the actual buffer size."), NULL,
>show_record_pt_buffer_size_value,
>
>   record_btrace_conf.bts.size = 64 * 1024;
>   record_btrace_conf.pt.size = 16 * 1024;
>+#define DEFAULT_ETM_BUFFER_SIZE (8 * 1024)
>+  record_btrace_conf.etm.size = DEFAULT_ETM_BUFFER_SIZE;
> }

Doesn't look like this macro is used anywhere else so I don't quite see the
point of it.


>diff --git a/gdbsupport/btrace-common.h b/gdbsupport/btrace-common.h
>index 26d26ec957f..153b977723a 100644
>--- a/gdbsupport/btrace-common.h
>+++ b/gdbsupport/btrace-common.h
>@@ -119,6 +122,20 @@ struct btrace_config_pt
>   unsigned int size;
> };
>
>+/* An ARM CoreSight ETM Trace configuration.  */
>+
>+struct btrace_config_etm
>+{
>+  /* The size of the branch trace buffer in bytes.
>+
>+     This is unsigned int and not size_t since it is registered as
>+     control variable for "set record btrace etm buffer-size".  */
>+  unsigned int size;
>+
>+  /* The sink used to collect the traces.  */
>+  char *sink;

Should this be const char *?  Who would free the memory used to
store those sink names?

Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


  parent reply	other threads:[~2021-04-27 17:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 14:09 [PATCH v5 0/7] extend branch tracing to use ARM CoreSight traces Zied Guermazi
2021-04-22 14:09 ` [PATCH v5 1/7] configure gdb build system for supporting btrace on arm processors Zied Guermazi
2021-04-27 17:31   ` Metzger, Markus T
2021-04-30 19:54   ` Tom Tromey
2021-05-01 11:53     ` Zied Guermazi
2021-04-22 14:09 ` [PATCH v5 2/7] add btrace coresight related commands Zied Guermazi
2021-04-22 14:16   ` Eli Zaretskii
2021-04-27 17:31   ` Metzger, Markus T [this message]
2021-04-30  1:42     ` Zied Guermazi
2021-04-22 14:09 ` [PATCH v5 3/7] start/stop btrace with coresight etm and parse etm buffer. nat independant Zied Guermazi
2021-04-27 17:31   ` Metzger, Markus T
2021-04-30  1:42     ` Zied Guermazi
2021-04-30  8:33       ` Metzger, Markus T
2021-05-07  1:52         ` Zied Guermazi
2021-04-22 14:09 ` [PATCH v5 4/7] start/stop btrace with coresight etm and collect etm buffer on linux os Zied Guermazi
2021-04-27 17:31   ` Metzger, Markus T
2021-04-30  1:43     ` Zied Guermazi
2021-04-30  9:01       ` Metzger, Markus T
2021-05-07  1:54         ` Zied Guermazi
2021-04-22 14:09 ` [PATCH v5 5/7] fix issue: gdb hangs in the command following a commad returning with TARGET_WAITKIND_NO_HISTORY Zied Guermazi
2021-04-27 17:32   ` Metzger, Markus T
2021-04-30  1:43     ` Zied Guermazi
2021-04-30  9:04       ` Metzger, Markus T
2021-04-22 14:09 ` [PATCH v5 6/7] add support for coresight btrace via remote protocol Zied Guermazi
2021-04-22 14:09 ` [PATCH v5 7/7] adapt btrace testcases for arm target Zied Guermazi

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=DM5PR11MB1690EDF33DE3274FDD504093DE419@DM5PR11MB1690.namprd11.prod.outlook.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=zied.guermazi@trande.de \
    /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).