From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 06713385781B for ; Tue, 15 Jun 2021 11:50:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 06713385781B Received: from fencepost.gnu.org ([2001:470:142:3::e]:50422) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lt7aM-0001ss-Po; Tue, 15 Jun 2021 07:50:28 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1948 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lt7aJ-000429-Oa; Tue, 15 Jun 2021 07:50:26 -0400 Date: Tue, 15 Jun 2021 14:50:16 +0300 Message-Id: <83wnqv4a9z.fsf@gnu.org> From: Eli Zaretskii To: Felix Willgerodt Cc: markus.t.metzger@intel.com, gdb-patches@sourceware.org In-Reply-To: <20210614145411.689277-8-felix.willgerodt@intel.com> (message from Felix Willgerodt via Gdb-patches on Mon, 14 Jun 2021 16:54:11 +0200) Subject: Re: [PATCH v2 12/12] btrace: Extend ptwrite event decoding. References: <20210614145411.689277-1-felix.willgerodt@intel.com> <20210614145411.689277-8-felix.willgerodt@intel.com> X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2021 11:50:39 -0000 > Date: Mon, 14 Jun 2021 16:54:11 +0200 > From: Felix Willgerodt via Gdb-patches > > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -3,6 +3,12 @@ > > *** Changes since GDB 10 > > +* 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. > + > * The 'set disassembler-options' command now supports specifying options > for the ARC target. This part is OK. > +This module provides additional functionality for recording programs that make > +use of the PTWRITE instruction. PTWRITE is a x86 instruction that allows to > +write values into the Intel Processor Trace (@pxref{Process Record and Replay}). Should PTWRITE be in @code or in @sc? > +The @code{gdb.ptwrite} module allows customizing the default output of ptwrite > +auxiliary information. A custom Python function can be registered via > +@code{gdb.ptwrite.register_listener()} as the ptwrite listener function. ^^ Please remove the parentheses there. Otherwise, this looks like a call to the function with no arguments, which is not what you want. > +@smallexample > +@group > +(gdb) python-interactive > +>>> class my_listener(object): > +... def __init__(self): > +... self.variable = 0 > +... def __call__(self, payload, ip): > +... if gdb.selected_thread().global_num == 1: > +... self.variable += 1 > +... return "payload: @{@}, ip: @{:#x@}".format(self.variable, ip) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This line is too long for @smallexample, it will cause overful hbox in the printed version of the manual. > +This GDB feature is dependent on hardware and operating system support and ^^^ @value{GDBN} Thanks.