From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11059 invoked by alias); 17 Dec 2012 09:21:20 -0000 Received: (qmail 11046 invoked by uid 22791); 17 Dec 2012 09:21:19 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Dec 2012 09:20:59 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TkWsd-0003tq-3a from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Mon, 17 Dec 2012 01:20:59 -0800 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 17 Dec 2012 01:20:52 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Mon, 17 Dec 2012 01:20:51 -0800 Message-ID: <50CEE3CF.8070904@codesourcery.com> Date: Mon, 17 Dec 2012 09:21:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Subject: Re: [PATCH 2/2] Compute traceframe usuage per tracepoint on demand. References: <1355276266-23163-1-git-send-email-yao@codesourcery.com> <1355276266-23163-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1355276266-23163-3-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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: 2012-12/txt/msg00540.txt.bz2 On 12/12/2012 09:37 AM, Yao Qi wrote: > + /* Compute the traceframe usage of tracepoint whose number is > + NUM. */ > + for (tframe = FIRST_TRACEFRAME (); > + tframe->tpnum != 0; > + tframe = NEXT_TRACEFRAME (tframe)) > + if (tframe->tpnum == num) > + traceframe_usage += tframe->data_size; > + > sprintf (own_buf, "V%" PRIu64 ":%" PRIu64 "", tpoint->hit_count, > - tpoint->traceframe_usage); > + traceframe_usage); It is incorrect for tracepoint with multiple locations, because multiple tracepoints in GDBserver have the same tracepoint number, and each tracepoint has its own traceframe usage. On 12/12/2012 09:37 AM, Yao Qi wrote: > Then, I thought that we may use pointer to > 'struct tracepoint' instead of tracepoint num in 'struct traceframe', > but comments of 'struct traceframe' tell me that I shouldn't do this, > "This object should be as small as possible". If we don't mind > increasing 2 bytes (on 32-bit target) for each 'struct traceframe', Looks we have to go this way, in order to get the correct traceframe usage of each tracepoint in GDBserver. I'll post a new patch again. -- Yao (齐尧)