public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Willgerodt, Felix" <felix.willgerodt@intel.com>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>,
	Simon Marchi <simon.marchi@polymtl.ca>,
	Pedro Alves <pedro@palves.net>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v3 07/12] btrace, gdbserver: Add ptwrite to btrace_config_pt.
Date: Fri, 6 May 2022 11:26:28 +0000	[thread overview]
Message-ID: <MN2PR11MB4566C96A518841972CAD28558EC59@MN2PR11MB4566.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DM8PR11MB57497B5F52F5CE622A5FBE41DEF99@DM8PR11MB5749.namprd11.prod.outlook.com>

> -----Original Message-----
> From: Metzger, Markus T <markus.t.metzger@intel.com>
> Sent: Donnerstag, 12. August 2021 13:08
> To: Willgerodt, Felix <felix.willgerodt@intel.com>; Simon Marchi
> <simon.marchi@polymtl.ca>; Pedro Alves <pedro@palves.net>
> Cc: gdb-patches@sourceware.org
> Subject: RE: [PATCH v3 07/12] btrace, gdbserver: Add ptwrite to
> btrace_config_pt.
> 
> Thanks, Felix,
> 
> This patch looks good to me but I have a question about XML schema and a
> small nit.
> 
> >diff --git a/gdb/features/btrace-conf.dtd b/gdb/features/btrace-conf.dtd
> >index 4b060bb408c..339ce4a4966 100644
> >--- a/gdb/features/btrace-conf.dtd
> >+++ b/gdb/features/btrace-conf.dtd
> >@@ -12,3 +12,4 @@
> >
> > <!ELEMENT pt	EMPTY>
> > <!ATTLIST pt	size	CDATA	#IMPLIED>
> >+<!ATTLIST pt	ptwrite	CDATA	#IMPLIED>
> 
> I don't know if we can simply add new attributes.  Would we at least need to
> bump the version number?  Looking at git log, others have added new
> attributes in the past.  And they didn't bump the version.

I also looked at git and didn't bump it because of those. I don't know what
impact the version numbers have. I was hoping for some feedback on
the mailing list in case it is needed.

> 
> 
> >@@ -7096,6 +7096,7 @@ linux_process_target::read_btrace_conf (const
> >btrace_target_info *tinfo,
> > 	case BTRACE_FORMAT_PT:
> > 	  buffer_xml_printf (buffer, "<pt");
> > 	  buffer_xml_printf (buffer, " size=\"0x%x\"", conf->pt.size);
> >+	  buffer_xml_printf (buffer, " ptwrite=\"%d\"", conf->pt.ptwrite);
> 
> Would we need to guard that with a check whether GDB supports this new
> attribute?
> Have you tried mixing an old GDB and a new gdbserver?

I don't see how we could guard here.
If I use master for GDB and master + ptwrite for gdbserver,
recording and the history commands work without error message.
That might just mean that there is no length check on GDB side.
But that won't be added to old GDBs anyway.

> 
> >diff --git a/gdbserver/server.cc b/gdbserver/server.cc
> >index 32dcc05924e..b899f50db35 100644
> >--- a/gdbserver/server.cc
> >+++ b/gdbserver/server.cc
> >@@ -546,6 +546,21 @@ handle_btrace_conf_general_set (char *own_buf)
> >
> >       current_btrace_conf.pt.size = (unsigned int) size;
> >     }
> >+  else if (strncmp (op, "pt:ptwrite=", strlen ("pt:ptwrite=")) == 0)
> >+    {
> >+      int ptwrite;
> 
> Please declare below where it is initialized.

Done.

> >+      char *endp = NULL;
> >+
> >+      errno = 0;
> >+      ptwrite = strtoul (op + strlen ("pt:ptwrite="), &endp, 16);
> 
> 
> 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

  reply	other threads:[~2022-05-06 11:26 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  7:41 [PATCH v3 00/12] Extensions for PTWRITE Felix Willgerodt
2021-06-16  7:41 ` [PATCH v3 01/12] btrace: Introduce auxiliary instructions Felix Willgerodt
2021-08-12 11:06   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2021-06-16  7:41 ` [PATCH v3 02/12] btrace: Enable auxiliary instructions in record instruction-history Felix Willgerodt
2021-08-12 11:06   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2021-06-16  7:41 ` [PATCH v3 03/12] btrace: Enable auxiliary instructions in record function-call-history Felix Willgerodt
2021-08-12 11:14   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2021-06-16  7:41 ` [PATCH v3 04/12] btrace: Handle stepping and goto for auxiliary instructions Felix Willgerodt
2021-08-12 11:07   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2021-06-16  7:41 ` [PATCH v3 05/12] python: Introduce gdb.RecordAuxiliary class Felix Willgerodt
2021-08-12 11:07   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2021-06-16  7:41 ` [PATCH v3 06/12] python: Add clear() to gdb.Record Felix Willgerodt
2021-08-12 11:07   ` Metzger, Markus T
2021-06-16  7:42 ` [PATCH v3 07/12] btrace, gdbserver: Add ptwrite to btrace_config_pt Felix Willgerodt
2021-08-12 11:07   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix [this message]
2022-05-10 13:59       ` Metzger, Markus T
2022-06-24  6:57         ` Willgerodt, Felix
2021-06-16  7:42 ` [PATCH v3 08/12] btrace, linux: Enable ptwrite packets Felix Willgerodt
2021-08-12 11:07   ` Metzger, Markus T
2021-06-16  7:42 ` [PATCH v3 09/12] btrace, python: Enable ptwrite listener registration Felix Willgerodt
2021-08-13 10:36   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2022-05-30 14:55       ` Metzger, Markus T
2022-05-31 11:26         ` Willgerodt, Felix
2022-05-31 11:50           ` Eli Zaretskii
2021-06-16  7:42 ` [PATCH v3 10/12] btrace, python: Enable calling the ptwrite listener Felix Willgerodt
2021-08-13 10:36   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix
2022-05-30 15:01       ` Metzger, Markus T
2021-06-16  7:42 ` [PATCH v3 11/12] gdb, testsuite, lib: Add libipt version check Felix Willgerodt
2021-08-13 10:36   ` Metzger, Markus T
2022-05-02  9:55     ` Willgerodt, Felix
2021-06-16  7:42 ` [PATCH v3 12/12] btrace: Extend ptwrite event decoding Felix Willgerodt
2021-06-17  7:00   ` Eli Zaretskii
2021-06-17 11:51     ` Willgerodt, Felix
2021-08-13 13:36   ` Metzger, Markus T
2022-05-06 11:26     ` Willgerodt, Felix

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=MN2PR11MB4566C96A518841972CAD28558EC59@MN2PR11MB4566.namprd11.prod.outlook.com \
    --to=felix.willgerodt@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    --cc=pedro@palves.net \
    --cc=simon.marchi@polymtl.ca \
    /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).