From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4303 invoked by alias); 12 Dec 2012 01:37:54 -0000 Received: (qmail 4290 invoked by uid 22791); 12 Dec 2012 01:37:52 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,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; Wed, 12 Dec 2012 01:37:47 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TibGc-0007GJ-Pq from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 11 Dec 2012 17:37:46 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 11 Dec 2012 17:37:46 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Tue, 11 Dec 2012 17:37:45 -0800 From: Yao Qi To: Subject: [RFC 0/2 gdbserver] Compute 'traceframe usage' per tracepoint Date: Wed, 12 Dec 2012 01:37:00 -0000 Message-ID: <1355276266-23163-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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/msg00368.txt.bz2 Hi, I happen to see that field 'traceframe_usage' in tracepoint in GDB is always zero, because its value is from GDBserver and GDBserver doesn't get a correct one of 'traceframe_usage'. The 'traceframe usage' is always zero when 'traceframe_usage' was added in this patch, [PATCH v2] Tracing notes and metadata http://sourceware.org/ml/gdb-patches/2011-11/msg00484.html The patch 2/2 fixes this problem by computing the traceframe usage when replying to packet 'qTP'. The other approach of fixing this problem is to continue to use field 'traceframe_usage' of 'struct tracepoint' and accumulate it when adding a block to a traceframe (in add_traceframe_block). Each 'traceframe' has the number of tracepoint, but it is not a good way to iterate the tracepoint list to find the right tracepoint and increment its field 'traceframe_usuage' inside add_traceframe_block, which should be done as fast it could be. 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', I am OK to replace 'tpnum' with a pointer to 'struct tracepoint', and post the patches in the other approach. If we follow the approach of this patch, that means we don't need the field 'traceframe_usage' in 'struct tracepoint' in GDBserver, and we can remove it. What do you think? Test case: check traceframe_usage. Compute traceframe usuage per tracepoint on demand. gdb/gdbserver/tracepoint.c | 12 ++++++++- gdb/testsuite/gdb.trace/disconnected-tracing.c | 8 ++++++ gdb/testsuite/gdb.trace/disconnected-tracing.exp | 29 ++++++++++++++++++---- gdb/testsuite/gdb.trace/infotrace.exp | 27 ++++++++++++++++++++ 4 files changed, 70 insertions(+), 6 deletions(-) -- 1.7.7.6