5 #include <linux/errno.h>
9 #include "LinuxEvents.h"
11 #define TRACE_HEARTBEAT_ID 19
12 #define PROCESS_FORK_ID 20
13 #define PROCESS_EXIT_ID 21
16 #define OVERFLOW_FIGURE 4294967296
18 typedef struct _new_process
20 uint32_t event_data1
; /* Data associated with event */
22 } LTT_PACKED_STRUCT new_process
;
24 #define write_to_buffer(DEST, SRC, SIZE) \
27 memcpy(DEST, SRC, SIZE);\
31 int readFile(int fd
, void * buf
, size_t size
, char * mesg
)
34 nbBytes
= read(fd
, buf
, size
);
42 void getDataEndianType(char * size
, char * endian
)
46 int sizeInt
=sizeof(int), sizeLong
=sizeof(long), sizePointer
=sizeof(void *);
48 if(c
== 1) strcpy(endian
,"LITTLE_ENDIAN");
49 else strcpy(endian
, "BIG_ENDIAN");
51 if(sizeInt
== 2 && sizeLong
== 4 && sizePointer
== 4)
53 else if(sizeInt
== 4 && sizeLong
== 4 && sizePointer
== 4)
55 else if(sizeInt
== 4 && sizeLong
== 8 && sizePointer
== 8)
57 else if(sizeInt
== 8 && sizeLong
== 8 && sizePointer
== 8)
59 else strcpy(size
,"UNKNOWN");
62 #define BUFFER_SIZE 80
64 typedef struct _buffer_start
{
69 } __attribute__ ((packed
)) buffer_start
;
71 typedef struct _heartbeat
{
75 } __attribute__ ((packed
)) heartbeat
;
78 int main(int argc
, char ** argv
){
82 int fdFac
, fdIntr
, fdProc
;
83 char arch_size
[BUFFER_SIZE
];
84 char endian
[BUFFER_SIZE
];
85 char node_name
[BUFFER_SIZE
];
86 char domainname
[BUFFER_SIZE
];
87 char kernel_name
[BUFFER_SIZE
];
88 char kernel_release
[BUFFER_SIZE
];
89 char kernel_version
[BUFFER_SIZE
];
90 char machine
[BUFFER_SIZE
];
91 char processor
[BUFFER_SIZE
];
92 char hardware_platform
[BUFFER_SIZE
];
93 char operating_system
[BUFFER_SIZE
];
96 int ltt_major_version
;
97 int ltt_minor_version
;
99 char buf
[BUFFER_SIZE
];
104 char foo
[4*BUFFER_SIZE
];
105 char foo_eventdefs
[4*BUFFER_SIZE
];
106 char foo_control
[4*BUFFER_SIZE
];
107 char foo_cpu
[4*BUFFER_SIZE
];
108 char foo_info
[4*BUFFER_SIZE
];
110 char foo_control_facilities
[4*BUFFER_SIZE
];
111 char foo_control_processes
[4*BUFFER_SIZE
];
112 char foo_control_interrupts
[4*BUFFER_SIZE
];
113 char foo_info_system
[4*BUFFER_SIZE
];
115 struct stat lTDFStat
;
117 int block_number
, block_size
;
118 char * buffer
, *buf_out
, cpuStr
[4*BUFFER_SIZE
];
119 char * buf_fac
, * buf_intr
, * buf_proc
;
120 void * write_pos
, *write_pos_fac
, * write_pos_intr
, *write_pos_proc
;
122 trace_buffer_start
*tBufStart
;
123 trace_buffer_end
*tBufEnd
;
124 trace_file_system
* tFileSys
;
125 uint16_t newId
, startId
, tmpId
;
127 uint32_t time_delta
, startTimeDelta
, previous_time_delta
;
128 void * cur_pos
, *end_pos
;
129 buffer_start start
, start_proc
, start_intr
;
130 buffer_start end
, end_proc
, end_intr
;
134 int reserve_size
= sizeof(buffer_start
) + sizeof(uint16_t) + 2*sizeof(uint32_t);//lost_size and buffer_end event
140 printf("Not enough parameters\n");
145 printf("cpu number = %d\n", cpu
);
148 if(argc
!= nb_para
&& argc
!= nb_para
+1){
149 printf("need trace files and cpu number or root directory for the new tracefile\n");
155 strcpy(foo_eventdefs
, "foo/eventdefs");
156 strcpy(foo_control
, "foo/control");
157 strcpy(foo_cpu
, "foo/cpu");
158 strcpy(foo_info
, "foo/info");
160 strcpy(foo
, argv
[nb_para
]);
161 strcpy(foo_eventdefs
, argv
[nb_para
]);
162 strcat(foo_eventdefs
,"/eventdefs");
163 strcpy(foo_control
, argv
[nb_para
]);
164 strcat(foo_control
,"/control");
165 strcpy(foo_cpu
, argv
[nb_para
]);
166 strcat(foo_cpu
,"/cpu");
167 strcpy(foo_info
, argv
[nb_para
]);
168 strcat(foo_info
,"/info");
170 strcpy(foo_control_facilities
, foo_control
);
171 strcat(foo_control_facilities
,"/facilities");
172 strcpy(foo_control_processes
, foo_control
);
173 strcat(foo_control_processes
, "/processes");
174 strcpy(foo_control_interrupts
, foo_control
);
175 strcat(foo_control_interrupts
, "/interrupts");
176 strcpy(foo_info_system
, foo_info
);
177 strcat(foo_info_system
, "/system.xml");
180 getDataEndianType(arch_size
, endian
);
181 printf("Arch_size: %s, Endian: %s\n", arch_size
, endian
);
183 fp
= fopen("sysInfo.out","r");
185 g_error("Unable to open file sysInfo.out\n");
188 for(i
=0;i
<INFO_ENTRY
;i
++){
189 if(!fgets(buf
,BUFFER_SIZE
-1,fp
))
190 g_error("The format of sysInfo.out is not right\n");
191 if(strncmp(buf
,"node_name=",10)==0){
192 strcpy(node_name
,&buf
[10]);
193 node_name
[strlen(node_name
)-1] = '\0';
194 }else if(strncmp(buf
,"domainname=",11)==0){
195 strcpy(domainname
,&buf
[11]);
196 domainname
[strlen(domainname
)-1] = '\0';
197 }else if(strncmp(buf
,"kernel_name=",12)==0){
198 strcpy(kernel_name
,&buf
[12]);
199 kernel_name
[strlen(kernel_name
)-1] = '\0';
200 }else if(strncmp(buf
,"kernel_release=",15)==0){
201 strcpy(kernel_release
,&buf
[15]);
202 kernel_release
[strlen(kernel_release
)-1] = '\0';
203 }else if(strncmp(buf
,"kernel_version=",15)==0){
204 strcpy(kernel_version
,&buf
[15]);
205 kernel_version
[strlen(kernel_version
)-1] = '\0';
206 }else if(strncmp(buf
,"machine=",8)==0){
207 strcpy(machine
,&buf
[8]);
208 machine
[strlen(machine
)-1] = '\0';
209 }else if(strncmp(buf
,"processor=",10)==0){
210 strcpy(processor
,&buf
[10]);
211 processor
[strlen(processor
)-1] = '\0';
212 }else if(strncmp(buf
,"hardware_platform=",18)==0){
213 strcpy(hardware_platform
,&buf
[18]);
214 hardware_platform
[strlen(hardware_platform
)-1] = '\0';
215 }else if(strncmp(buf
,"operating_system=",17)==0){
216 strcpy(operating_system
,&buf
[17]);
217 operating_system
[strlen(operating_system
)-1] = '\0';
222 if(mkdir(foo
, S_IFDIR
| S_IRWXU
| S_IRGRP
| S_IROTH
))
223 g_error("can not make %s directory", foo
);
224 if(mkdir(foo_info
, S_IFDIR
| S_IRWXU
| S_IRGRP
| S_IROTH
))
225 g_error("can not make %s directory", foo_info
);
226 if(mkdir(foo_cpu
, S_IFDIR
| S_IRWXU
| S_IRGRP
| S_IROTH
))
227 g_error("can not make %s directory", foo_cpu
);
228 if(mkdir(foo_control
, S_IFDIR
| S_IRWXU
| S_IRGRP
| S_IROTH
))
229 g_error("can not make %s directory", foo_control
);
230 if(mkdir(foo_eventdefs
, S_IFDIR
| S_IRWXU
| S_IRGRP
| S_IROTH
))
231 g_error("can not make %s directory", foo_eventdefs
);
233 fp
= fopen(foo_info_system
,"w");
235 g_error("Unable to open file system.xml\n");
238 fdFac
= open(foo_control_facilities
,O_CREAT
| O_RDWR
| O_TRUNC
,S_IRUSR
|S_IWUSR
| S_IRGRP
| S_IROTH
);
240 g_error("Unable to open file facilities\n");
242 fdIntr
= open(foo_control_interrupts
,O_CREAT
| O_RDWR
| O_TRUNC
,S_IRUSR
|S_IWUSR
| S_IRGRP
| S_IROTH
);
244 g_error("Unable to open file interrupts\n");
246 fdProc
= open(foo_control_processes
,O_CREAT
| O_RDWR
| O_TRUNC
,S_IRUSR
|S_IWUSR
| S_IRGRP
| S_IROTH
);
248 g_error("Unable to open file process\n");
253 fd
= open(argv
[nb_para
-cpu
+k
], O_RDONLY
, 0);
255 g_error("Unable to open input data file %s\n", argv
[nb_para
-cpu
+k
]);
258 if(fstat(fd
, &lTDFStat
) < 0){
259 g_error("Unable to get the status of the input data file\n");
261 file_size
= lTDFStat
.st_size
;
263 buffer
= g_new(char, 4000);
264 readFile(fd
,(void*)buffer
, 3500, "Unable to read block header");
267 evId
= *(uint8_t *)cur_pos
;
268 cur_pos
+= sizeof(uint8_t);
270 time_delta
= *(uint32_t*)cur_pos
;
271 cur_pos
+= sizeof(uint32_t);
272 tBufStart
= (trace_buffer_start
*)cur_pos
;
273 cur_pos
+= sizeof(trace_buffer_start
);
274 cur_pos
+= sizeof(uint16_t); //Skip event size
276 evId
= *(uint8_t *)cur_pos
;
277 cur_pos
+= sizeof(uint8_t);
278 cur_pos
+= sizeof(uint32_t);
279 tStart
= (trace_start
*)cur_pos
;
282 startTimeDelta
= time_delta
;
283 start
.seconds
= tBufStart
->Time
.tv_sec
;
284 start
.nanoseconds
= tBufStart
->Time
.tv_usec
;
285 start
.cycle_count
= tBufStart
->TSC
;
286 start
.block_id
= tBufStart
->ID
;
287 end
.block_id
= start
.block_id
;
289 ltt_major_version
= tStart
->MajorVersion
;
290 ltt_minor_version
= tStart
->MinorVersion
;
291 ltt_block_size
= tStart
->BufferSize
;
292 ltt_log_cpu
= tStart
->LogCPUID
;
294 block_size
= ltt_block_size
;
295 block_number
= file_size
/block_size
;
298 buffer
= g_new(char, block_size
);
299 buf_fac
= g_new(char, block_size
);
300 write_pos_fac
= buf_fac
;
301 buf_intr
= g_new(char, block_size
);
302 write_pos_intr
= buf_intr
;
303 buf_proc
= g_new(char, block_size
);
304 write_pos_proc
= buf_proc
;
306 buf_out
= g_new(char, block_size
);
308 sprintf(cpuStr
,"%s/%d\0",foo_cpu
,k
);
309 fdCpu
= open(cpuStr
, O_CREAT
| O_RDWR
| O_TRUNC
,S_IRUSR
|S_IWUSR
| S_IRGRP
| S_IROTH
); //for cpu k
310 if(fdCpu
< 0) g_error("Unable to open cpu file %d\n", k
);
311 lseek(fd
,0,SEEK_SET
);
313 for(i
=0;i
<block_number
;i
++){
317 memset((void*)buf_out
, 0, block_size
);
319 memset((void*)buf_intr
, 0, block_size
);
320 memset((void*)buf_fac
, 0, block_size
);
321 memset((void*)buf_proc
, 0, block_size
);
322 write_pos_intr
= buf_intr
;
323 write_pos_fac
= buf_fac
;
324 write_pos_proc
= buf_proc
;
326 memset((void*)buffer
,0,block_size
);
327 readFile(fd
,(void*)buffer
, block_size
, "Unable to read block header");
330 evId
= *(uint8_t *)cur_pos
;
331 cur_pos
+= sizeof(uint8_t);
333 time_delta
= *(uint32_t*)cur_pos
;
334 cur_pos
+= sizeof(uint32_t);
335 tBufStart
= (trace_buffer_start
*)cur_pos
;
336 cur_pos
+= sizeof(trace_buffer_start
);
337 cur_pos
+= sizeof(uint16_t); //Skip event size
340 startTimeDelta
= time_delta
;
341 previous_time_delta
= time_delta
;
342 start
.seconds
= tBufStart
->Time
.tv_sec
;
343 start
.nanoseconds
= tBufStart
->Time
.tv_usec
;
344 start
.cycle_count
= tBufStart
->TSC
;
345 start
.block_id
= tBufStart
->ID
;
346 end
.block_id
= start
.block_id
;
348 end_pos
= buffer
+ block_size
; //end of the buffer
349 size_lost
= *(uint32_t*)(end_pos
- sizeof(uint32_t));
351 end_pos
= buffer
+ block_size
- size_lost
; //buffer_end event
353 tBufEnd
= (trace_buffer_end
*)(end_pos
+ 2 * sizeof(uint8_t)+sizeof(uint32_t));
355 tBufEnd
= (trace_buffer_end
*)(end_pos
+sizeof(uint8_t)+sizeof(uint32_t));
357 end
.seconds
= tBufEnd
->Time
.tv_sec
;
358 end
.nanoseconds
= tBufEnd
->Time
.tv_usec
;
359 end
.cycle_count
= tBufEnd
->TSC
;
361 //skip buffer start and trace start events
362 if(i
==0) //the first block
363 cur_pos
= buffer
+ sizeof(trace_buffer_start
) + sizeof(trace_start
) + 2*(sizeof(uint8_t)+sizeof(uint16_t)+sizeof(uint32_t));
365 cur_pos
= buffer
+ sizeof(trace_buffer_start
) + sizeof(uint8_t)+sizeof(uint16_t)+sizeof(uint32_t);
367 //write start block event
368 write_to_buffer(write_pos
,(void*)&startId
, sizeof(uint16_t));
369 write_to_buffer(write_pos
,(void*)&startTimeDelta
, sizeof(uint32_t));
370 write_to_buffer(write_pos
,(void*)&start
, sizeof(buffer_start
));
372 //write start block event into processes and interrupts files
373 write_to_buffer(write_pos_intr
,(void*)&startId
, sizeof(uint16_t));
374 write_to_buffer(write_pos_intr
,(void*)&startTimeDelta
, sizeof(uint32_t));
376 start_intr
.nanoseconds
-= 20;
377 write_to_buffer(write_pos_intr
,(void*)&start_intr
, sizeof(buffer_start
));
379 write_to_buffer(write_pos_proc
,(void*)&startId
, sizeof(uint16_t));
380 write_to_buffer(write_pos_proc
,(void*)&startTimeDelta
, sizeof(uint32_t));
382 start_proc
.nanoseconds
-= 40;
383 write_to_buffer(write_pos_proc
,(void*)&start_proc
, sizeof(buffer_start
));
385 //parse *.proc file to get process and irq info
387 int lIntID
; /* Interrupt ID */
388 int lPID
, lPPID
; /* Process PID and Parent PID */
389 char lName
[256]; /* Process name */
394 fProc
= fopen(argv
[1],"r");
396 g_error("Unable to open file %s\n", argv
[1]);
399 while(fscanf(fProc
, "PID: %d; PPID: %d; NAME: %s\n", &lPID
, &lPPID
, lName
) > 0){
400 defaultId
= PROCESS_FORK_ID
;
401 process
.event_data1
= lPID
;
402 process
.event_data2
= lPPID
;
403 write_to_buffer(write_pos_proc
,(void*)&defaultId
, sizeof(uint16_t));
404 write_to_buffer(write_pos_proc
,(void*)&startTimeDelta
, sizeof(uint32_t));
405 write_to_buffer(write_pos_proc
,(void*)&process
, sizeof(new_process
));
408 while(fscanf(fProc
, "IRQ: %d; NAME: ", &lIntID
) > 0){
409 /* Read 'til the end of the line */
410 fgets(lName
, 200, fProc
);
412 defaultId
= TRACE_IRQ_ENTRY
;
415 write_to_buffer(write_pos_intr
,(void*)&defaultId
, sizeof(uint16_t));
416 write_to_buffer(write_pos_intr
,(void*)&startTimeDelta
, sizeof(uint32_t));
417 write_to_buffer(write_pos_intr
,(void*)&irq
, sizeof(trace_irq_entry
));
428 cpu_id
= *(uint8_t*)cur_pos
;
429 cur_pos
+= sizeof(uint8_t);
431 evId
= *(uint8_t *)cur_pos
;
433 if(evId
== TRACE_HEARTBEAT
) {
434 newId
= TRACE_HEARTBEAT_ID
;
436 cur_pos
+= sizeof(uint8_t);
437 time_delta
= *(uint32_t*)cur_pos
;
438 cur_pos
+= sizeof(uint32_t);
440 if(time_delta
< previous_time_delta
){
441 end
.cycle_count
+= OVERFLOW_FIGURE
;
443 previous_time_delta
= time_delta
;
445 //write event_id and time_delta
446 write_to_buffer(write_pos
,(void*)&newId
,sizeof(uint16_t));
447 write_to_buffer(write_pos
,(void*)&time_delta
, sizeof(uint32_t));
449 if(evId
== TRACE_BUFFER_END
){
450 int size
= block_size
+ ((void*)buf_out
- write_pos
)+ sizeof(uint16_t) + sizeof(uint32_t);
451 write_to_buffer(write_pos
,(void*)&end
,sizeof(buffer_start
));
452 write_pos
= buf_out
+ block_size
- sizeof(uint32_t);
453 write_to_buffer(write_pos
,(void*)&size
, sizeof(uint32_t));
454 write(fdCpu
,(void*)buf_out
, block_size
);
456 //write out processes and intrrupts files
458 int size_intr
= block_size
- (write_pos_intr
- (void*)buf_intr
);
459 int size_proc
= block_size
- (write_pos_proc
- (void*)buf_proc
);
460 write_to_buffer(write_pos_intr
,(void*)&newId
,sizeof(uint16_t));
461 write_to_buffer(write_pos_intr
,(void*)&time_delta
, sizeof(uint32_t));
463 end_intr
.nanoseconds
-= 20;
464 write_to_buffer(write_pos_intr
,(void*)&end_intr
,sizeof(buffer_start
));
466 write_to_buffer(write_pos_proc
,(void*)&newId
,sizeof(uint16_t));
467 write_to_buffer(write_pos_proc
,(void*)&time_delta
, sizeof(uint32_t));
469 end_proc
.nanoseconds
-= 40;
470 write_to_buffer(write_pos_proc
,(void*)&end_proc
,sizeof(buffer_start
));
472 write_pos_intr
= buf_intr
+ block_size
- sizeof(uint32_t);
473 write_pos_proc
= buf_proc
+ block_size
- sizeof(uint32_t);
474 write_to_buffer(write_pos_intr
,(void*)&size_intr
, sizeof(uint32_t));
475 write_to_buffer(write_pos_proc
,(void*)&size_proc
, sizeof(uint32_t));
476 //for now don't output processes and interrupt information
477 // write(fdIntr,(void*)buf_intr,block_size);
478 // write(fdProc,(void*)buf_proc,block_size);
485 case TRACE_SYSCALL_ENTRY
:
486 event_size
= sizeof(trace_syscall_entry
);
488 case TRACE_SYSCALL_EXIT
:
491 case TRACE_TRAP_ENTRY
:
492 event_size
= sizeof(trace_trap_entry
);
494 case TRACE_TRAP_EXIT
:
497 case TRACE_IRQ_ENTRY
:
498 event_size
= sizeof(trace_irq_entry
);
499 timeDelta
= time_delta
;
500 write_to_buffer(write_pos_intr
,(void*)&newId
, sizeof(uint16_t));
501 write_to_buffer(write_pos_intr
,(void*)&timeDelta
, sizeof(uint32_t));
502 write_to_buffer(write_pos_intr
,cur_pos
, event_size
);
506 timeDelta
= time_delta
;
507 write_to_buffer(write_pos_intr
,(void*)&newId
, sizeof(uint16_t));
508 write_to_buffer(write_pos_intr
,(void*)&timeDelta
, sizeof(uint32_t));
510 case TRACE_SCHEDCHANGE
:
511 event_size
= sizeof(trace_schedchange
);
513 case TRACE_KERNEL_TIMER
:
517 event_size
= sizeof(trace_soft_irq
);
518 // timeDelta = time_delta;
519 // write_to_buffer(write_pos_intr,(void*)&newId, sizeof(uint16_t));
520 // write_to_buffer(write_pos_intr,(void*)&timeDelta, sizeof(uint32_t));
521 // write_to_buffer(write_pos_intr,cur_pos, event_size);
524 event_size
= sizeof(trace_process
);
525 timeDelta
= time_delta
;
526 subId
= *(uint8_t*)cur_pos
;
527 if(subId
== TRACE_PROCESS_FORK
|| subId
==TRACE_PROCESS_EXIT
){
528 if( subId
== TRACE_PROCESS_FORK
)tmpId
= PROCESS_FORK_ID
;
529 else tmpId
= PROCESS_EXIT_ID
;
530 write_to_buffer(write_pos_proc
,(void*)&tmpId
, sizeof(uint16_t));
531 write_to_buffer(write_pos_proc
,(void*)&timeDelta
, sizeof(uint32_t));
533 process
= *(new_process
*)(cur_pos
+ sizeof(uint8_t));
534 write_to_buffer(write_pos_proc
,(void*)&process
, sizeof(new_process
));
537 case TRACE_FILE_SYSTEM
:
538 event_size
= sizeof(trace_file_system
)- sizeof(char*);
541 event_size
= sizeof(trace_timer
);
544 event_size
= sizeof(trace_memory
);
547 event_size
= sizeof(trace_socket
);
550 event_size
= sizeof(trace_ipc
);
553 event_size
= sizeof(trace_network
);
555 case TRACE_HEARTBEAT
:
558 beat
.nanoseconds
= 0;
559 beat
.cycle_count
= start
.cycle_count
+ beat_count
* OVERFLOW_FIGURE
;
562 // end.cycle_count += OVERFLOW_FIGURE;
564 write_to_buffer(write_pos_intr
,(void*)&newId
, sizeof(uint16_t));
565 write_to_buffer(write_pos_intr
,(void*)&timeDelta
, sizeof(uint32_t));
566 write_to_buffer(write_pos_intr
,(void*)&beat
, sizeof(heartbeat
));
567 write_to_buffer(write_pos_proc
,(void*)&newId
, sizeof(uint16_t));
568 write_to_buffer(write_pos_proc
,(void*)&timeDelta
, sizeof(uint32_t));
569 write_to_buffer(write_pos_proc
,(void*)&beat
, sizeof(heartbeat
));
575 if(evId
!= TRACE_FILE_SYSTEM
&& event_size
>=0){
576 write_to_buffer(write_pos
, cur_pos
, event_size
);
578 if(evId
== TRACE_HEARTBEAT
){
579 write_to_buffer(write_pos
, (void*)&beat
, sizeof(heartbeat
));
582 cur_pos
+= event_size
+ sizeof(uint16_t); //skip data_size
583 }else if(evId
== TRACE_FILE_SYSTEM
){
586 tFileSys
= (trace_file_system
*)cur_pos
;
587 subId
= tFileSys
->event_sub_id
;
588 if(subId
== TRACE_FILE_SYSTEM_OPEN
|| subId
== TRACE_FILE_SYSTEM_EXEC
){
589 nbBytes
= tFileSys
->event_data2
+1;
592 write_to_buffer(write_pos
, cur_pos
, event_size
);
593 cur_pos
+= event_size
+ sizeof(char*);
595 write_to_buffer(write_pos
, cur_pos
, nbBytes
);
597 write_to_buffer(write_pos
, (void*)&c
, 1);
599 cur_pos
+= nbBytes
+ sizeof(uint16_t); //skip data_size
600 }else if(event_size
== -1){
601 printf("Unknown event: evId=%d, i=%d, event_count=%d\n", newId
, i
, event_count
);
620 //write to system.xml
621 fprintf(fp
,"<system \n");
622 fprintf(fp
,"node_name=\"%s\" \n", node_name
);
623 fprintf(fp
,"domainname=\"%s\" \n", domainname
);
624 fprintf(fp
,"cpu=\"%d\" \n", cpu
);
625 fprintf(fp
,"arch_size=\"%s\" \n", arch_size
);
626 fprintf(fp
,"endian=\"%s\" \n",endian
);
627 fprintf(fp
,"kernel_name=\"%s\" \n",kernel_name
);
628 fprintf(fp
,"kernel_release=\"%s\" \n",kernel_release
);
629 fprintf(fp
,"kernel_version=\"%s\" \n",kernel_version
);
630 fprintf(fp
,"machine=\"%s\" \n",machine
);
631 fprintf(fp
,"processor=\"%s\" \n",processor
);
632 fprintf(fp
,"hardware_platform=\"%s\" \n",hardware_platform
);
633 fprintf(fp
,"operating_system=\"%s\" \n",operating_system
);
634 fprintf(fp
,"ltt_major_version=\"%d\" \n",ltt_major_version
);
635 fprintf(fp
,"ltt_minor_version=\"%d\" \n",ltt_minor_version
);
636 fprintf(fp
,"ltt_block_size=\"%d\" \n",ltt_block_size
);
638 fprintf(fp
,"This is just a test\n");
639 fprintf(fp
,"</system>\n");