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>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 03/10] btrace: Enable auxiliary instructions in record function-call-history.
Date: Mon, 14 Jun 2021 14:53:02 +0000	[thread overview]
Message-ID: <310c3547149c4b9bac48ab528179c96a@intel.com> (raw)
In-Reply-To: <A78C989F6D9628469189715575E55B236B43FCC6@IRSMSX104.ger.corp.intel.com>

On 6/4/19 2:35 PM, Metzger, Markus T wrote:
>Hello Felix,
>
>> Print the auxiliary data when a btrace_insn of type BTRACE_INSN_AUX is 
>> encountered in the function-call-history.  Printing is active by 
>> default, it can be silenced with the /s modifier.

Markus> The /s modifier is used in 'record instruction-history' to mean 'interleave sources'.  I guess we'd want this behavior there, as well.  And we'd also want the same modifier for both commands.

Done

>> +static void
>> +btrace_print_aux_insn (struct ui_out *uiout,
>> +		       const struct btrace_function *bfun,
>> +		       const struct btrace_thread_info *btinfo) {
>> +  for (const auto &i : bfun->insn)
> >+    {
> >+      if (i.iclass == BTRACE_INSN_AUX)
> >+	{
> >+	  uiout->text ("\t\t[");

Markus> We print the number and a single tab for gaps.  I'd do the same here.

I don't think we want that. I had that in an earlier revision, but we decided against it back then.
AUX insns are not function segments like gaps. There could be plenty of AUX insns in one function,
increasing the number by a lot. We would need to manipulate the bfun->number, as the aux
insn is a insn inside bfun, but a gap is an empty bfun.

Currently it looks like this:

record function-call-history 1,4
1       main
2       ptwrite64
                [payload: 0x42]
3       main
4       ptwrite32
               [payload: 0x43]
               [payload: 0x33]
5       main

This makes it consistent with the silenced version:

record function-call-history /a 1,4
1       main
2       ptwrite64
3       main
4       ptwrite32
5       main

>
>> +	  uiout->field_fmt ("aux-insn", "%s",
>
>Should this be spelled "aux-data" to align with the naming of the field?
>>
>>+			    btinfo->aux_data[i.aux_data_index].c_str ());
>>+	  uiout->text ("]\n");
>>+	}
>>+    }
>>+}
>>+
>> /* Disassemble a section of the recorded function trace.  */
>>
>> static void
>> @@ -1214,6 +1231,10 @@ btrace_call_history (struct ui_out *uiout,
>> 	}
>> 
>>        uiout->text ("\n");
>> +
>> +      if (((flags & RECORD_DONT_PRINT_AUX) == 0)
>> +	  && ((bfun->flags & BFUN_AUX_DECODED) != 0))
>> +	btrace_print_aux_insn(uiout, bfun, btinfo);

Markus> This ignores the 'record function-call-history-size' setting.


Isn't the size handled by the loop? The current behaviour looks fine to me:

(gdb) set record function-call-history-size 2
(gdb) record function-call-history 1
1    	main
2    	ptwrite64
		[payload: 0x42]
(gdb) set record function-call-history-size 3
(gdb) record function-call-history 1         
1	main
2	ptwrite64
		[payload: 0x42]
3	main

I don't think we want to start cutting the auxiliary data from a function.

Thanks,
Felix
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:[~2021-06-14 14:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  8:48 [PATCH 00/10] Extensions for PTWRITE felix.willgerodt
2019-05-29  8:48 ` [PATCH 04/10] btrace: Handle stepping and goto for auxiliary instructions felix.willgerodt
2019-06-04 12:35   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 01/10] btrace: Introduce " felix.willgerodt
2019-05-29 14:39   ` Eli Zaretskii
2019-06-04 12:35   ` Metzger, Markus T
2019-05-29  8:48 ` [PATCH 05/10] python: Introduce gdb.RecordAuxiliary class felix.willgerodt
2019-05-29 14:42   ` Eli Zaretskii
2019-06-04 12:36   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 10/10] btrace: Extend event decoding for ptwrite felix.willgerodt
2019-05-29 14:53   ` Eli Zaretskii
2019-06-04 12:37   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 02/10] btrace: Enable auxiliary instructions in record instruction-history felix.willgerodt
2019-06-04 12:35   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 03/10] btrace: Enable auxiliary instructions in record function-call-history felix.willgerodt
2019-05-29 14:40   ` Eli Zaretskii
2019-06-04 12:35   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix [this message]
2021-06-16  9:13       ` Metzger, Markus T
2021-06-16 10:03         ` Willgerodt, Felix
2021-06-16 10:16           ` Metzger, Markus T
2019-05-29  8:48 ` [PATCH 09/10] btrace, python: Enable calling the ptwrite listener felix.willgerodt
2019-06-04 12:37   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 08/10] btrace, python: Enable ptwrite listener registration felix.willgerodt
2019-06-04 12:36   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 07/10] btrace, linux: Enable ptwrite packets felix.willgerodt
2019-06-04 12:36   ` Metzger, Markus T
2021-06-14 14:53     ` Willgerodt, Felix
2019-05-29  8:48 ` [PATCH 06/10] python: Add clear_trace() to gdb.Record felix.willgerodt
2019-05-29 14:41   ` Eli Zaretskii
2019-06-04 12:36   ` Metzger, Markus T
2021-06-14 14:53     ` 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=310c3547149c4b9bac48ab528179c96a@intel.com \
    --to=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).