record: Add data size to client

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

Update #3665.
This commit is contained in:
Sebastian Huber
2019-08-27 08:30:43 +02:00
parent a8af7a14ec
commit e273e7a9a8
2 changed files with 9 additions and 0 deletions

View File

@@ -155,6 +155,7 @@ typedef struct rtems_record_client_context {
); );
rtems_record_client_handler handler; rtems_record_client_handler handler;
void *handler_arg; void *handler_arg;
size_t data_size;
uint32_t header[ 2 ]; uint32_t header[ 2 ];
rtems_record_client_status status; rtems_record_client_status status;
} rtems_record_client_context; } rtems_record_client_context;

View File

@@ -615,22 +615,26 @@ static rtems_record_client_status consume_init(
ctx->todo = sizeof( ctx->item.format_32 ); ctx->todo = sizeof( ctx->item.format_32 );
ctx->pos = &ctx->item.format_32; ctx->pos = &ctx->item.format_32;
ctx->consume = consume_32; ctx->consume = consume_32;
ctx->data_size = 4;
break; break;
case RTEMS_RECORD_FORMAT_LE_64: case RTEMS_RECORD_FORMAT_LE_64:
ctx->todo = sizeof( ctx->item.format_64 ); ctx->todo = sizeof( ctx->item.format_64 );
ctx->pos = &ctx->item.format_64; ctx->pos = &ctx->item.format_64;
ctx->consume = consume_64; ctx->consume = consume_64;
ctx->data_size = 8;
break; break;
case RTEMS_RECORD_FORMAT_BE_32: case RTEMS_RECORD_FORMAT_BE_32:
ctx->todo = sizeof( ctx->item.format_32 ); ctx->todo = sizeof( ctx->item.format_32 );
ctx->pos = &ctx->item.format_32; ctx->pos = &ctx->item.format_32;
ctx->consume = consume_swap_32; ctx->consume = consume_swap_32;
ctx->data_size = 4;
magic = __builtin_bswap32( magic ); magic = __builtin_bswap32( magic );
break; break;
case RTEMS_RECORD_FORMAT_BE_64: case RTEMS_RECORD_FORMAT_BE_64:
ctx->todo = sizeof( ctx->item.format_64 ); ctx->todo = sizeof( ctx->item.format_64 );
ctx->pos = &ctx->item.format_64; ctx->pos = &ctx->item.format_64;
ctx->consume = consume_swap_64; ctx->consume = consume_swap_64;
ctx->data_size = 8;
magic = __builtin_bswap32( magic ); magic = __builtin_bswap32( magic );
break; break;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #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->todo = sizeof( ctx->item.format_32 );
ctx->pos = &ctx->item.format_32; ctx->pos = &ctx->item.format_32;
ctx->consume = consume_swap_32; ctx->consume = consume_swap_32;
ctx->data_size = 4;
magic = __builtin_bswap32( magic ); magic = __builtin_bswap32( magic );
break; break;
case RTEMS_RECORD_FORMAT_LE_64: case RTEMS_RECORD_FORMAT_LE_64:
ctx->todo = sizeof( ctx->item.format_64 ); ctx->todo = sizeof( ctx->item.format_64 );
ctx->pos = &ctx->item.format_64; ctx->pos = &ctx->item.format_64;
ctx->consume = consume_swap_64; ctx->consume = consume_swap_64;
ctx->data_size = 8;
magic = __builtin_bswap32( magic ); magic = __builtin_bswap32( magic );
break; break;
case RTEMS_RECORD_FORMAT_BE_32: case RTEMS_RECORD_FORMAT_BE_32:
ctx->todo = sizeof( ctx->item.format_32 ); ctx->todo = sizeof( ctx->item.format_32 );
ctx->pos = &ctx->item.format_32; ctx->pos = &ctx->item.format_32;
ctx->consume = consume_32; ctx->consume = consume_32;
ctx->data_size = 4;
break; break;
case RTEMS_RECORD_FORMAT_BE_64: case RTEMS_RECORD_FORMAT_BE_64:
ctx->todo = sizeof( ctx->item.format_64 ); ctx->todo = sizeof( ctx->item.format_64 );
ctx->pos = &ctx->item.format_64; ctx->pos = &ctx->item.format_64;
ctx->consume = consume_64; ctx->consume = consume_64;
ctx->data_size = 8;
break; break;
#else #else
#error "unexpected __BYTE_ORDER__" #error "unexpected __BYTE_ORDER__"