summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-08-06 07:47:57 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-08-06 07:51:42 +0200
commitcc91fae43a71ccb5f47fa7ed179dd86c53e290ae (patch)
tree55a3f3ed414af6e818d6e3f3e7e4223ebacfea65
parent8c66acc8dcb4d459c1f61f2d5f62a23d14e3af46 (diff)
downloadrtems-cc91fae43a71ccb5f47fa7ed179dd86c53e290ae.tar.bz2
record: Change thread name encoding
This scheme is easier to decode.
-rw-r--r--cpukit/libtrace/record/record-server.c2
-rw-r--r--cpukit/libtrace/record/record-userext.c2
-rw-r--r--testsuites/libtests/record01/init.c8
3 files changed, 6 insertions, 6 deletions
diff --git a/cpukit/libtrace/record/record-server.c b/cpukit/libtrace/record/record-server.c
index b8519cc6cb..0a65b904df 100644
--- a/cpukit/libtrace/record/record-server.c
+++ b/cpukit/libtrace/record/record-server.c
@@ -211,7 +211,7 @@ static bool thread_names_visitor( rtems_tcb *tcb, void *arg )
data = 0;
for ( j = 0; i < n && j < sizeof( data ); ++j ) {
- data = ( data << 8 ) | name[ i ];
+ data |= name[ i ] << ( j * 8 );
++i;
}
diff --git a/cpukit/libtrace/record/record-userext.c b/cpukit/libtrace/record/record-userext.c
index ff448e5573..8e1f041da0 100644
--- a/cpukit/libtrace/record/record-userext.c
+++ b/cpukit/libtrace/record/record-userext.c
@@ -57,7 +57,7 @@ bool _Record_Thread_create(
data = 0;
for ( k = 0; j < n && k < sizeof( data ); ++k ) {
- data = ( data << 8 ) | name[ j ];
+ data |= name[ i ] << ( k * 8 );
++j;
}
diff --git a/testsuites/libtests/record01/init.c b/testsuites/libtests/record01/init.c
index fdc2a859a8..86255437f3 100644
--- a/testsuites/libtests/record01/init.c
+++ b/testsuites/libtests/record01/init.c
@@ -156,22 +156,22 @@ static const rtems_record_item expected_items_13[] = {
{ .event = TE(0, RTEMS_RECORD_THREAD_ID), .data = 0x9010001 },
{
.event = TE(0, RTEMS_RECORD_THREAD_NAME),
- .data = rtems_build_name('I', 'D', 'L', 'E')
+ .data = rtems_build_name('E', 'L', 'D', 'I')
},
{ .event = TE(0, RTEMS_RECORD_THREAD_ID), .data = 0xa010001 },
{
.event = TE(0, RTEMS_RECORD_THREAD_NAME),
- .data = rtems_build_name('U', 'I', '1', ' ')
+ .data = rtems_build_name(' ', '1', 'I', 'U')
},
{ .event = TE(0, RTEMS_RECORD_THREAD_ID), .data = 0xa010002 },
{
.event = TE(0, RTEMS_RECORD_THREAD_NAME),
- .data = rtems_build_name('n', 't', 'w', 'k')
+ .data = rtems_build_name('k', 'w', 't', 'n')
},
{ .event = TE(0, RTEMS_RECORD_THREAD_ID), .data = 0xa010003 },
{
.event = TE(0, RTEMS_RECORD_THREAD_NAME),
- .data = rtems_build_name('R', 'C', 'R', 'D')
+ .data = rtems_build_name('D', 'R', 'C', 'R')
}
};
#endif