This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Compute traceframe usuage per tracepoint on demand.


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]