public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Felix Willgerodt <felix.willgerodt@intel.com>
Cc: markus.t.metzger@intel.com, gdb-patches@sourceware.org
Subject: Re: [PATCH v4 10/10] btrace: Extend ptwrite event decoding.
Date: Fri, 06 May 2022 15:04:25 +0300	[thread overview]
Message-ID: <837d6y27g6.fsf@gnu.org> (raw)
In-Reply-To: <20220506114010.134106-10-felix.willgerodt@intel.com> (message from Felix Willgerodt via Gdb-patches on Fri, 6 May 2022 13:40:10 +0200)

> Date: Fri,  6 May 2022 13:40:10 +0200
> From: Felix Willgerodt via Gdb-patches <gdb-patches@sourceware.org>
> 
> diff --git a/gdb/NEWS b/gdb/NEWS
> index a72fee81550..cf807d6209e 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -331,6 +331,12 @@ GNU/Linux/OpenRISC		or1k*-*-linux*
>  
>  *** Changes in GDB 11
>  
> +* GDB now supports printing of ptwrite payloads from the Intel Processor
> +  Trace during 'record instruction-history', 'record function-call-history',
> +  all stepping commands and in  Python.  Printing is customizable via a
> +  ptwrite listener function in  Python.  By default, the raw ptwrite
> +  payload is printed for each ptwrite that is encountered.
> +

This part is OK.

> +@exdent @value{GDBN} output after recording the sample program in pt format:
> +@smallexample
> +@group
> +(gdb) record instruction-history 12,14
> +12         0x000000000040074c <ptwrite64+16>:	ptwrite %rbx
> +13         [42]
> +14         0x0000000000400751 <ptwrite64+21>:	mov    -0x8(%rbp),%rbx

The last line is too long, and will cause overfull hbox errors when
producing the printed manual.  Please make it shorter, or break into 2
lines.

> +@findex gdb.ptwrite.register_listener
> +@defun register_listener (@var{listener})

@defun automatically inserts the function into the index, so no need
for a separate @findex (here and elsewhere in the patch).

> +Used to register the ptwrite listener.  The listener can be any callable
> +object that accepts two arguments.

I think we should describe those 2 arguments, at least shortly.

> +@defun default_listener (@var{payload}, @var{ip})
> +The listener function active by default.

Which does what?  If we don't say anything about the default behavior,
how can a user decide whether to provide his/her specialized listener?

> +@smallexample
> +@group
> +(gdb) python-interactive
> +>>> class my_listener(object):
> +...    def __init__(self):
> +...        self.var = 0
> +...    def __call__(self, payload, ip):
> +...        if gdb.selected_thread().global_num == 1:
> +...            self.var += 1
> +...            return "counter: @{@}, ip: @{:#x@}".format(self.var, ip)

This last line is too long.

(And I wonder whether this example really adds something of value to
what you already described above.)

> +@group
> +(gdb) info threads 
> +* 1    Thread 0x7ffff7fd8740 (LWP 25796) "ptwrite_threads" task (arg=0x0)
> +    at bin/ptwrite/ptwrite_threads.c:45
> +  2    Thread 0x7ffff6eb8700 (LWP 25797) "ptwrite_threads" task (arg=0x0)
> +    at bin/ptwrite/ptwrite_threads.c:45

These lines are also too long.

> +This @value{GDBN} feature is dependent on hardware and operating system
> +support and requires the Intel Processor Trace decoder library in version
> +2.0.0 or newer.

You say "hardware and operating system support", but say nothing about
the OSes on which this can be supported.

Thanks.

  reply	other threads:[~2022-05-06 12:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 11:40 [PATCH v4 01/10] btrace: Introduce auxiliary instructions Felix Willgerodt
2022-05-06 11:40 ` [PATCH v4 02/10] btrace: Enable auxiliary instructions in record instruction-history Felix Willgerodt
2022-05-06 11:46   ` Eli Zaretskii
2022-05-06 11:40 ` [PATCH v4 03/10] btrace: Enable auxiliary instructions in record function-call-history Felix Willgerodt
2022-05-06 11:48   ` Eli Zaretskii
2022-05-06 11:40 ` [PATCH v4 04/10] btrace: Handle stepping and goto for auxiliary instructions Felix Willgerodt
2022-05-06 11:40 ` [PATCH v4 05/10] python: Introduce gdb.RecordAuxiliary class Felix Willgerodt
2022-05-06 11:49   ` Eli Zaretskii
2022-05-06 11:40 ` [PATCH v4 06/10] python: Add clear() to gdb.Record Felix Willgerodt
2022-05-06 11:50   ` Eli Zaretskii
2022-05-10 13:42     ` Willgerodt, Felix
2022-05-10 14:04       ` Eli Zaretskii
2022-05-11  8:22         ` Willgerodt, Felix
2022-05-11 11:43           ` Eli Zaretskii
2022-05-06 11:40 ` [PATCH v4 07/10] btrace, gdbserver: Add ptwrite to btrace_config_pt Felix Willgerodt
2022-05-06 11:53   ` Eli Zaretskii
2022-05-10 13:42     ` Willgerodt, Felix
2022-05-06 11:40 ` [PATCH v4 08/10] btrace, linux: Enable ptwrite packets Felix Willgerodt
2022-05-06 11:40 ` [PATCH v4 09/10] btrace, python: Enable ptwrite listener registration Felix Willgerodt
2022-05-06 11:40 ` [PATCH v4 10/10] btrace: Extend ptwrite event decoding Felix Willgerodt
2022-05-06 12:04   ` Eli Zaretskii [this message]
2022-05-10 13:43     ` Willgerodt, Felix
2022-05-10 14:11       ` Eli Zaretskii
2022-05-11  8:19         ` Willgerodt, Felix
2022-05-06 11:47 ` [PATCH v4 01/10] btrace: Introduce auxiliary instructions Eli Zaretskii
2022-05-10 13:42   ` 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=837d6y27g6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=felix.willgerodt@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@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).