[rtems-tools commit] record: Add data size to client

Sebastian Huber sebh at rtems.org
Tue Aug 27 06:52:37 UTC 2019


Module:    rtems-tools
Branch:    master
Commit:    3f45f38fc88abc9c6a662176cb46191145204a46
Changeset: http://git.rtems.org/rtems-tools/commit/?id=3f45f38fc88abc9c6a662176cb46191145204a46

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Aug 27 08:30:43 2019 +0200

record: Add data size to client

This is necessary to get the thread names properly on 32-bit and 64-bit
targets.

Update #3665.

---

 trace/record/record-client.c      | 8 ++++++++
 trace/record/rtems/recordclient.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/trace/record/record-client.c b/trace/record/record-client.c
index c26893e..e1365fe 100644
--- a/trace/record/record-client.c
+++ b/trace/record/record-client.c
@@ -615,22 +615,26 @@ static rtems_record_client_status consume_init(
           ctx->todo = sizeof( ctx->item.format_32 );
           ctx->pos = &ctx->item.format_32;
           ctx->consume = consume_32;
+          ctx->data_size = 4;
           break;
         case RTEMS_RECORD_FORMAT_LE_64:
           ctx->todo = sizeof( ctx->item.format_64 );
           ctx->pos = &ctx->item.format_64;
           ctx->consume = consume_64;
+          ctx->data_size = 8;
           break;
         case RTEMS_RECORD_FORMAT_BE_32:
           ctx->todo = sizeof( ctx->item.format_32 );
           ctx->pos = &ctx->item.format_32;
           ctx->consume = consume_swap_32;
+          ctx->data_size = 4;
           magic = __builtin_bswap32( magic );
           break;
         case RTEMS_RECORD_FORMAT_BE_64:
           ctx->todo = sizeof( ctx->item.format_64 );
           ctx->pos = &ctx->item.format_64;
           ctx->consume = consume_swap_64;
+          ctx->data_size = 8;
           magic = __builtin_bswap32( magic );
           break;
 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
@@ -638,23 +642,27 @@ static rtems_record_client_status consume_init(
           ctx->todo = sizeof( ctx->item.format_32 );
           ctx->pos = &ctx->item.format_32;
           ctx->consume = consume_swap_32;
+          ctx->data_size = 4;
           magic = __builtin_bswap32( magic );
           break;
         case RTEMS_RECORD_FORMAT_LE_64:
           ctx->todo = sizeof( ctx->item.format_64 );
           ctx->pos = &ctx->item.format_64;
           ctx->consume = consume_swap_64;
+          ctx->data_size = 8;
           magic = __builtin_bswap32( magic );
           break;
         case RTEMS_RECORD_FORMAT_BE_32:
           ctx->todo = sizeof( ctx->item.format_32 );
           ctx->pos = &ctx->item.format_32;
           ctx->consume = consume_32;
+          ctx->data_size = 4;
           break;
         case RTEMS_RECORD_FORMAT_BE_64:
           ctx->todo = sizeof( ctx->item.format_64 );
           ctx->pos = &ctx->item.format_64;
           ctx->consume = consume_64;
+          ctx->data_size = 8;
           break;
 #else
 #error "unexpected __BYTE_ORDER__"
diff --git a/trace/record/rtems/recordclient.h b/trace/record/rtems/recordclient.h
index 7f21d90..cb1e704 100644
--- a/trace/record/rtems/recordclient.h
+++ b/trace/record/rtems/recordclient.h
@@ -155,6 +155,7 @@ typedef struct rtems_record_client_context {
   );
   rtems_record_client_handler handler;
   void *handler_arg;
+  size_t data_size;
   uint32_t header[ 2 ];
   rtems_record_client_status status;
 } rtems_record_client_context;



More information about the vc mailing list