GSoC Project | Basic Support for Trace Compass

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Aug 8 05:46:34 UTC 2019



On 08/08/2019 06:10, Ravindra Kumar Meena wrote:
>     Could you please move the const metadata content to as few as possible
> 
>     static const metadata_xyz[] = "...
>     ...
>     ...";
> 
>     variables and write them with fwrite().
> 
> Sorry. I didn't get which part of the metadata you want to move. Are you 
> talking about typedef?

No, not a typedef. Something like this:

diff --git a/misc/record/record-main.c b/misc/record/record-main.c
index 314bb78..b5d1a66 100644
--- a/misc/record/record-main.c
+++ b/misc/record/record-main.c
@@ -422,19 +422,28 @@ static rtems_record_client_status handler(
    return RTEMS_RECORD_CLIENT_SUCCESS;
  }

+static const char metadata[] =
+"/* CTF 1.8 */\n"
+"\n"
+"typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n"
+"typealias integer { size = 8; align = 8; signed = false; } := uint8_t;\n"
+"typealias integer { size = 32; align = 8; signed = false; } := 
uint32_t;\n"
+"typealias integer { size = 64; align = 8; signed = false; } := 
uint64_t;\n"
+"typealias integer { size = 64; align = 8; signed = false; } := 
unsigned long;\n";
+
  void generate_metadata(){
-  FILE *metadata = fopen("metadata","w");
+  FILE *file = fopen("metadata","w");
    assert( metadata !=  NULL );

-  fprintf(metadata, "/* CTF 1.8 */\n\n");
-  fprintf(metadata, "typealias integer { size = 5; align = 1; signed = 
false; } := uint5_t;\
+  fwrite( metadata, sizeof( metadata ), 1, file );

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list