From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IwYzDSOUyGCnZQAAWB0awg (envelope-from ) for ; Tue, 15 Jun 2021 07:50:59 -0400 Received: by simark.ca (Postfix, from userid 112) id 271B21F163; Tue, 15 Jun 2021 07:50:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 515921E939 for ; Tue, 15 Jun 2021 07:50:58 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DAAED3857420 for ; Tue, 15 Jun 2021 11:50:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAAED3857420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623757857; bh=Hnq8Nathtf3Vw+n8r/1nlFcHM/X2KwoabEd1nX9x0N0=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Owlg3C+k2aXJo530EsvbR7sjhBYTlMwZ6tqgVfEmoAYiSnCiQkJvTZ6Q4jdXnjoRb eXiKQJ1M7WofWoMCwKU97dW1D/3YEHmzv7Jd8e/eSFsO81/MHnhCujP+WsMiOJzrRJ NqNxd+GSP1lxybwpZYe6X90QirG20RhNZG1taMAE= 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> To: Felix Willgerodt 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-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: , From: Eli Zaretskii via Gdb-patches Reply-To: Eli Zaretskii Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > 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.