From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9179 invoked by alias); 27 Oct 2007 08:12:37 -0000 Received: (qmail 9171 invoked by uid 22791); 27 Oct 2007 08:12:36 -0000 X-Spam-Check-By: sourceware.org Received: from 216-129-118-140.cust.layer42.net (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 27 Oct 2007 08:12:33 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 737FE3B8D5; Sat, 27 Oct 2007 00:58:01 -0700 (PDT) Subject: Re: RFC: tracepoints: Use constant-size trace opcodes where possible From: Michael Snyder To: Jim Blandy Cc: gdb-patches@sourceware.org In-Reply-To: References: Content-Type: text/plain Date: Sat, 27 Oct 2007 08:17:00 -0000 Message-Id: <1193472438.16917.102.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2007-10/txt/msg00737.txt.bz2 On Fri, 2007-10-26 at 16:10 -0700, Jim Blandy wrote: > The comments should explain what's going on here. The Linux > tracepoint agent was much simplified by restricting it to expressions > whose data size could be estimated in advance. This should have no > effect on other agents. > > Okay to commit? Looks fine. > > gdb/ChangeLog: > 2007-10-25 Jim Blandy > > * ax-gdb.c (gen_traced_pop): Generate trace_quick or trace16 > bytecodes whenever possible. > > diff -r cdc626576c72 -r 84b7570f26f4 gdb/ax-gdb.c > --- a/gdb/ax-gdb.c Thu Oct 25 12:43:14 2007 -0700 > +++ b/gdb/ax-gdb.c Thu Oct 25 12:47:24 2007 -0700 > @@ -321,13 +321,22 @@ gen_traced_pop (struct agent_expr *ax, s > { > int length = TYPE_LENGTH (check_typedef (value->type)); > > - /* There's no point in trying to use a trace_quick bytecode > - here, since "trace_quick SIZE pop" is three bytes, whereas > - "const8 SIZE trace" is also three bytes, does the same > - thing, and the simplest code which generates that will also > - work correctly for objects with large sizes. */ > - ax_const_l (ax, length); > - ax_simple (ax, aop_trace); > + /* Try to generate a trace_quick here if we can. The > + bytecode stream generated isn't any shorter ('quick > + pop' and 'const8 trace' are both three bytes long), > + but this simplifies agent expression evaluators that want > + to be able to easily put an upper bound on the memory > + that will be collected by an expression. */ > + if (length < 1 << 16) > + { > + ax_trace_quick (ax, length); > + ax_simple (ax, aop_pop); > + } > + else > + { > + ax_const_l (ax, length); > + ax_simple (ax, aop_trace); > + } > } > break; >