From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14848 invoked by alias); 5 Nov 2014 20:46:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14838 invoked by uid 89); 5 Nov 2014 20:46:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 05 Nov 2014 20:46:06 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA5Kk4ww005599 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Nov 2014 15:46:04 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA5Kk1p4017396; Wed, 5 Nov 2014 15:46:02 -0500 Message-ID: <545A8C89.1090901@redhat.com> Date: Wed, 05 Nov 2014 20:46:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Markus Metzger CC: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: [PATCH 05/12] record-btrace: add bts buffer size configuration option References: <1405346196-1804-1-git-send-email-markus.t.metzger@intel.com> <1405346196-1804-6-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1405346196-1804-6-git-send-email-markus.t.metzger@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-11/txt/msg00106.txt.bz2 On 07/14/2014 02:56 PM, Markus Metzger wrote: > --- a/gdb/features/btrace-conf.dtd > +++ b/gdb/features/btrace-conf.dtd > @@ -5,6 +5,7 @@ > notice and this notice are preserved. --> > > > - > + I don't see why we need to bump the version. GDB that know about attribute cope with it being missing. And GDBs that aren't expecting the attribute just ignore it. > > > + > supported_btrace_packets (char *buf) > { > if (target_supports_btrace (BTRACE_FORMAT_BTS)) > - strcat (buf, ";Qbtrace:bts+"); > + { > + strcat (buf, ";Qbtrace:bts+"); > + strcat (own_buf, ";Qbtrace-conf:bts:size+"); > + } 'buf' or 'own_buf' ? > + if (pages == 0) { Misplaced { > + errno = EINVAL; > + goto err; > + } > + > +/* Adjusts the size and returns a human readable size suffix. */ > + > +static const char * > +record_btrace_adjust_size (unsigned int *size) > +{ > + unsigned int sz; > + > + sz = *size; > + > + if ((sz & ((1u << 30) - 1)) == 0) > + { > + *size = sz >> 30; > + return "GB"; > + } > + else if ((sz & ((1u << 20) - 1)) == 0) > + { > + *size = sz >> 20; > + return "MB"; > + } > + else if ((sz & ((1u << 10) - 1)) == 0) > + { > + *size = sz >> 10; > + return "KB"; Pedantically, this should be "kB". > + add_setshow_uinteger_cmd ("buffer-size", no_class, > + &record_btrace_conf.bts.size, > + _("Set the record/replay bts buffer size."), > + _("Show the record/replay bts buffer size."), _("\ > +Bigger buffers allow longer recording but also take more time to process \ > +the recorded execution.\n\ > +The actual buffer size may differ from the requested size. Use \"info record\" \ > +to see the actual buffer size."), NULL, NULL, > + &set_record_btrace_bts_cmdlist, > + &show_record_btrace_bts_cmdlist); I think the documentation of these knobs should mention that the setting takes effect the next time btrace is enabled, not immediately. > +gdb_test_no_output "set record btrace bts buffer-size 1" > +gdb_test "show record btrace bts buffer-size" "The record/replay bts buffer size is 1\.\r" > + > +gdb_test_no_output "record btrace bts" > +gdb_test "show record btrace bts buffer-size" "The record/replay bts buffer size is 1\.\r" See: https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_messages_are_unique Thanks, Pedro Alves