rtems-record-lttng: Corrupted timestamps after translating to CTF
Jan.Sommer at dlr.de
Jan.Sommer at dlr.de
Thu Mar 18 22:06:38 UTC 2021
> -----Original Message-----
> From: Sebastian Huber <sebastian.huber at embedded-brains.de>
> Sent: Friday, March 5, 2021 5:46 PM
> To: Sommer, Jan <Jan.Sommer at dlr.de>; users at rtems.org
> Subject: Re: rtems-record-lttng: Corrupted timestamps after translating to
> On 05/03/2021 16:11, Jan.Sommer at dlr.de wrote:
> > Some of the resulting CTF events have a very large timestamp. This only
> occurs for events of which are created by CPUs other than CPU0, but not all
> of them.
> > I ran rtems-record-lttng in gdb and could track it to record-client.c:176
> > There the (delta * ctx->to_bt_scaler ) causes an overflow and sets
> per_cpu->uptime.bt to a very large negative number which then later
> becomes a very large (positive) timestamp.
> > I have some trouble figuring out what is going wrong here. The timestamps
> which are read from the rtems record events looks quite reasonable to me.
> > The to_bt_scaler is quite a large value and I don't fully get what it scales.
> Does someone have some hints?
> It could be related to ring buffer overflows. Do you get
> RTEMS_RECORD_PER_CPU_OVERFLOW items? There could be also some
> bugs in record-client.c. More unit tests for it would be helpful.
I had some more time to look at this.
It turns out that the RTEMS_RECORD_UPTIME_* events are always assigned to cpu 0.
I checked the watchdog and indeed the _Record_Watchdog (https://git.rtems.org/rtems/tree/cpukit/libtrace/record/record-sysinit.c#n64) is executed twice, but always on cpu 0.
I tested with the rv32imac bsp with 2 cores, each with its own RTEMS_SCHEDULER_PRIORITY_SMP and with the following defines:
#define CONFIGURE_RECORD_PER_PROCESSOR_ITEMS 2048
Do I need to configure something else? I am not familiar with the watchdog part. The initialization looks good as far as I can tell.
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax: +49-89-18 94 741 - 08
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
More information about the users