1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 #define _ISOC99_SOURCE
25 #include <linux/if_ether.h>
27 #include <netinet/in.h>
33 #include "sync_chain.h"
34 #include "event_processing_lttng_common.h"
36 #include "event_processing_lttng_standard.h"
39 // Functions common to all processing modules
40 static void initProcessingLTTVStandard(SyncState
* const syncState
, ...);
41 static void destroyProcessingLTTVStandard(SyncState
* const syncState
);
43 static void finalizeProcessingLTTVStandard(SyncState
* const syncState
);
44 static void printProcessingStatsLTTVStandard(SyncState
* const syncState
);
45 static void writeProcessingGraphVariablesLTTVStandard(SyncState
* const
46 syncState
, const unsigned int i
);
47 static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState
* const
48 syncState
, const unsigned int i
, const unsigned int j
);
49 static void writeProcessingTraceTimeOptionsLTTVStandard(SyncState
* const
50 syncState
, const unsigned int i
, const unsigned int j
);
52 // Functions specific to this module
53 static void registerProcessingLTTVStandard() __attribute__((constructor (102)));
54 static gboolean
processEventLTTVStandard(void* hookData
, void* callData
);
55 static void partialDestroyProcessingLTTVStandard(SyncState
* const syncState
);
58 static ProcessingModule processingModuleLTTVStandard
= {
59 .name
= "LTTV-standard",
60 .initProcessing
= &initProcessingLTTVStandard
,
61 .destroyProcessing
= &destroyProcessingLTTVStandard
,
62 .finalizeProcessing
= &finalizeProcessingLTTVStandard
,
63 .printProcessingStats
= &printProcessingStatsLTTVStandard
,
65 .writeVariables
= &writeProcessingGraphVariablesLTTVStandard
,
66 .writeTraceTraceOptions
= &writeProcessingTraceTraceOptionsLTTVStandard
,
67 .writeTraceTimeOptions
= &writeProcessingTraceTimeOptionsLTTVStandard
,
73 * Processing Module registering function
75 static void registerProcessingLTTVStandard()
77 g_queue_push_tail(&processingModules
, &processingModuleLTTVStandard
);
84 * Allocate and initialize data structures for synchronizing a traceset.
85 * Register event hooks.
88 * syncState: container for synchronization data.
89 * This function allocates these processingData members:
94 * traceSetContext: LttvTracesetContext*, set of LTTV traces
96 static void initProcessingLTTVStandard(SyncState
* const syncState
, ...)
99 ProcessingDataLTTVStandard
* processingData
;
102 processingData
= malloc(sizeof(ProcessingDataLTTVStandard
));
103 syncState
->processingData
= processingData
;
104 va_start(ap
, syncState
);
105 processingData
->traceSetContext
= va_arg(ap
, LttvTracesetContext
*);
108 lttv_traceset_number(processingData
->traceSetContext
->ts
);
109 processingData
->hookListList
= g_array_sized_new(FALSE
, FALSE
,
110 sizeof(GArray
*), syncState
->traceNb
);
112 processingData
->traceNumTable
= g_hash_table_new(&g_direct_hash
, NULL
);
113 for(i
= 0; i
< syncState
->traceNb
; i
++)
115 g_hash_table_insert(processingData
->traceNumTable
,
116 processingData
->traceSetContext
->traces
[i
]->t
,
117 GUINT_TO_POINTER(i
));
120 processingData
->pendingRecv
= malloc(sizeof(GHashTable
*) *
122 for(i
= 0; i
< syncState
->traceNb
; i
++)
124 processingData
->pendingRecv
[i
]= g_hash_table_new_full(&g_direct_hash
,
125 NULL
, NULL
, &gdnDestroyEvent
);
128 if (syncState
->stats
)
130 processingData
->stats
= calloc(1, sizeof(ProcessingStatsLTTVStandard
));
134 processingData
->stats
= NULL
;
137 if (syncState
->graphsStream
)
139 processingData
->graphs
= malloc(syncState
->traceNb
*
140 sizeof(ProcessingGraphsLTTVStandard
));
142 for(i
= 0; i
< syncState
->traceNb
; i
++)
144 LttTrace
* traceI
= processingData
->traceSetContext
->traces
[i
]->t
;
146 processingData
->graphs
[i
].startFreq
= traceI
->start_freq
;
147 processingData
->graphs
[i
].freqScale
= traceI
->freq_scale
;
152 processingData
->graphs
= NULL
;
155 registerHooks(processingData
->hookListList
,
156 processingData
->traceSetContext
, &processEventLTTVStandard
, syncState
,
157 syncState
->matchingModule
->canMatch
);
162 * Call the partial processing destroyer, obtain and adjust the factors from
166 * syncState container for synchronization data.
168 static void finalizeProcessingLTTVStandard(SyncState
* const syncState
)
172 double minOffset
, minDrift
;
173 unsigned int refFreqTrace
;
174 ProcessingDataLTTVStandard
* processingData
;
176 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
178 partialDestroyProcessingLTTVStandard(syncState
);
180 factors
= syncState
->matchingModule
->finalizeMatching(syncState
);
182 /* The offsets are adjusted so the lowest one is 0. This is done because
183 * of a Lttv specific limitation: events cannot have negative times. By
184 * having non-negative offsets, events cannot be moved backwards to
188 for (i
= 0; i
< syncState
->traceNb
; i
++)
190 minOffset
= MIN(g_array_index(factors
, Factors
, i
).offset
, minOffset
);
193 for (i
= 0; i
< syncState
->traceNb
; i
++)
195 g_array_index(factors
, Factors
, i
).offset
-= minOffset
;
198 /* Because the timestamps are corrected at the TSC level (not at the
199 * LttTime level) all trace frequencies must be made equal. We choose to
200 * use the frequency of the system with the lowest drift
204 for (i
= 0; i
< syncState
->traceNb
; i
++)
206 if (g_array_index(factors
, Factors
, i
).drift
< minDrift
)
208 minDrift
= g_array_index(factors
, Factors
, i
).drift
;
212 g_assert(syncState
->traceNb
== 0 || minDrift
!= INFINITY
);
214 // Write the factors to the LttTrace structures
215 for (i
= 0; i
< syncState
->traceNb
; i
++)
218 Factors
* traceFactors
;
220 t
= processingData
->traceSetContext
->traces
[i
]->t
;
221 traceFactors
= &g_array_index(factors
, Factors
, i
);
223 t
->drift
= traceFactors
->drift
;
224 t
->offset
= traceFactors
->offset
;
226 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->start_freq
;
228 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->freq_scale
;
229 t
->start_time_from_tsc
=
230 ltt_time_from_uint64(tsc_to_uint64(t
->freq_scale
, t
->start_freq
,
231 t
->drift
* t
->start_tsc
+ t
->offset
));
234 g_array_free(factors
, TRUE
);
236 lttv_traceset_context_compute_time_span(processingData
->traceSetContext
,
237 &processingData
->traceSetContext
->time_span
);
239 g_debug("traceset start %ld.%09ld end %ld.%09ld",
240 processingData
->traceSetContext
->time_span
.start_time
.tv_sec
,
241 processingData
->traceSetContext
->time_span
.start_time
.tv_nsec
,
242 processingData
->traceSetContext
->time_span
.end_time
.tv_sec
,
243 processingData
->traceSetContext
->time_span
.end_time
.tv_nsec
);
248 * Print statistics related to processing Must be called after
249 * finalizeProcessing.
252 * syncState container for synchronization data.
254 static void printProcessingStatsLTTVStandard(SyncState
* const syncState
)
256 ProcessingDataLTTVStandard
* processingData
;
258 if (!syncState
->stats
)
263 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
265 printf("LTTV processing stats:\n");
266 printf("\treceived frames: %d\n", processingData
->stats
->totRecv
);
267 printf("\treceived frames that are IP: %d\n",
268 processingData
->stats
->totRecvIp
);
269 if (syncState
->matchingModule
->canMatch
[TCP
])
271 printf("\treceived and processed packets that are TCP: %d\n",
272 processingData
->stats
->totRecvTCP
);
274 if (syncState
->matchingModule
->canMatch
[UDP
])
276 printf("\treceived and processed packets that are UDP: %d\n",
277 processingData
->stats
->totRecvUDP
);
279 if (syncState
->matchingModule
->canMatch
[TCP
])
281 printf("\tsent packets that are TCP: %d\n",
282 processingData
->stats
->totOutE
);
288 * Unregister event hooks. Deallocate processingData.
291 * syncState: container for synchronization data.
292 * This function deallocates these processingData members:
295 static void destroyProcessingLTTVStandard(SyncState
* const syncState
)
297 ProcessingDataLTTVStandard
* processingData
;
299 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
301 if (processingData
== NULL
)
306 partialDestroyProcessingLTTVStandard(syncState
);
308 if (syncState
->stats
)
310 free(processingData
->stats
);
313 if (syncState
->graphsStream
)
315 free(processingData
->graphs
);
318 free(syncState
->processingData
);
319 syncState
->processingData
= NULL
;
324 * Unregister event hooks. Deallocate some of processingData.
326 * This function can be called right after the events have been processed to
327 * free some data structures that are not needed for finalization.
330 * syncState: container for synchronization data.
331 * This function deallocates these members:
336 static void partialDestroyProcessingLTTVStandard(SyncState
* const syncState
)
339 ProcessingDataLTTVStandard
* processingData
;
341 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
343 if (processingData
== NULL
|| processingData
->traceNumTable
== NULL
)
348 g_hash_table_destroy(processingData
->traceNumTable
);
349 processingData
->traceNumTable
= NULL
;
351 for(i
= 0; i
< syncState
->traceNb
; i
++)
354 g_debug("Cleaning up pendingRecv list");
355 g_hash_table_destroy(processingData
->pendingRecv
[i
]);
357 free(processingData
->pendingRecv
);
359 unregisterHooks(processingData
->hookListList
,
360 processingData
->traceSetContext
);
365 * Lttv hook function that will be called for network events
368 * hookData: LttvTraceHook* for the type of event that generated the call
369 * callData: LttvTracefileContext* at the moment of the event
372 * FALSE Always returns FALSE, meaning to keep processing hooks for
375 static gboolean
processEventLTTVStandard(void* hookData
, void* callData
)
377 LttvTraceHook
* traceHook
;
378 LttvTracefileContext
* tfc
;
384 unsigned long traceNum
;
385 struct marker_info
* info
;
386 SyncState
* syncState
;
387 ProcessingDataLTTVStandard
* processingData
;
390 traceHook
= (LttvTraceHook
*) hookData
;
391 tfc
= (LttvTracefileContext
*) callData
;
392 trace
= tfc
->t_context
->t
;
393 syncState
= (SyncState
*) traceHook
->hook_data
;
394 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
395 event
= ltt_tracefile_get_event(tfc
->tf
);
396 info
= marker_get_info_from_id(tfc
->tf
->mdata
, event
->event_id
);
397 tsc
= ltt_event_cycle_count(event
);
398 time
= ltt_event_time(event
);
399 wTime
.seconds
= time
.tv_sec
;
400 wTime
.nanosec
= time
.tv_nsec
;
402 g_assert(g_hash_table_lookup_extended(processingData
->traceNumTable
,
403 trace
, NULL
, &traceNumP
));
404 traceNum
= GPOINTER_TO_INT(traceNumP
);
406 g_debug("Process event: time: %ld.%09ld trace: %ld (%p) name: %s ",
407 time
.tv_sec
, time
.tv_nsec
, traceNum
, trace
,
408 g_quark_to_string(info
->name
));
410 if (info
->name
== LTT_EVENT_DEV_XMIT_EXTENDED
)
414 if (!ltt_event_get_unsigned(event
,
415 lttv_trace_get_hook_field(traceHook
, 1)) == ETH_P_IP
||
416 !ltt_event_get_unsigned(event
,
417 lttv_trace_get_hook_field(traceHook
, 2)) == IPPROTO_TCP
)
422 if (!syncState
->matchingModule
->canMatch
[TCP
])
427 if (syncState
->stats
)
429 processingData
->stats
->totOutE
++;
432 outE
= malloc(sizeof(Event
));
433 outE
->traceNum
= traceNum
;
435 outE
->wallTime
= wTime
;
437 outE
->copy
= ©TCPEvent
;
438 outE
->destroy
= &destroyTCPEvent
;
439 outE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
440 outE
->event
.tcpEvent
->direction
= OUT
;
441 outE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
442 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
443 htonl(ltt_event_get_unsigned(event
,
444 lttv_trace_get_hook_field(traceHook
, 3)));
445 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
446 htonl(ltt_event_get_unsigned(event
,
447 lttv_trace_get_hook_field(traceHook
, 4)));
448 outE
->event
.tcpEvent
->segmentKey
->tot_len
=
449 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
451 outE
->event
.tcpEvent
->segmentKey
->ihl
= ltt_event_get_unsigned(event
,
452 lttv_trace_get_hook_field(traceHook
, 6));
453 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
454 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
456 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
457 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
459 outE
->event
.tcpEvent
->segmentKey
->seq
= ltt_event_get_unsigned(event
,
460 lttv_trace_get_hook_field(traceHook
, 9));
461 outE
->event
.tcpEvent
->segmentKey
->ack_seq
=
462 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
464 outE
->event
.tcpEvent
->segmentKey
->doff
= ltt_event_get_unsigned(event
,
465 lttv_trace_get_hook_field(traceHook
, 11));
466 outE
->event
.tcpEvent
->segmentKey
->ack
= ltt_event_get_unsigned(event
,
467 lttv_trace_get_hook_field(traceHook
, 12));
468 outE
->event
.tcpEvent
->segmentKey
->rst
= ltt_event_get_unsigned(event
,
469 lttv_trace_get_hook_field(traceHook
, 13));
470 outE
->event
.tcpEvent
->segmentKey
->syn
= ltt_event_get_unsigned(event
,
471 lttv_trace_get_hook_field(traceHook
, 14));
472 outE
->event
.tcpEvent
->segmentKey
->fin
= ltt_event_get_unsigned(event
,
473 lttv_trace_get_hook_field(traceHook
, 15));
475 syncState
->matchingModule
->matchEvent(syncState
, outE
);
477 g_debug("Output event done");
479 else if (info
->name
== LTT_EVENT_DEV_RECEIVE
)
483 if (syncState
->stats
)
485 processingData
->stats
->totRecv
++;
488 protocol
= ltt_event_get_unsigned(event
,
489 lttv_trace_get_hook_field(traceHook
, 1));
491 if (protocol
== ETH_P_IP
)
496 if (syncState
->stats
)
498 processingData
->stats
->totRecvIp
++;
501 inE
= malloc(sizeof(Event
));
502 inE
->traceNum
= traceNum
;
504 inE
->wallTime
= wTime
;
505 inE
->event
.tcpEvent
= NULL
;
506 inE
->copy
= ©Event
;
507 inE
->destroy
= &destroyEvent
;
509 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
510 lttv_trace_get_hook_field(traceHook
, 0));
511 g_hash_table_replace(processingData
->pendingRecv
[traceNum
], skb
,
514 g_debug("Adding inE %p for skb %p to pendingRecv", inE
, skb
);
517 else if (info
->name
== LTT_EVENT_TCPV4_RCV_EXTENDED
)
522 // Search pendingRecv for an event with the same skb
523 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
524 lttv_trace_get_hook_field(traceHook
, 0));
527 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
530 // This should only happen in case of lost events
531 g_warning("No matching pending receive event found");
535 if (syncState
->stats
)
537 processingData
->stats
->totRecvTCP
++;
540 // If it's there, remove it and proceed with a receive event
541 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
544 inE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
545 inE
->copy
= ©TCPEvent
;
546 inE
->destroy
= &destroyTCPEvent
;
547 inE
->event
.tcpEvent
->direction
= IN
;
548 inE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
549 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
550 htonl(ltt_event_get_unsigned(event
,
551 lttv_trace_get_hook_field(traceHook
, 1)));
552 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
553 htonl(ltt_event_get_unsigned(event
,
554 lttv_trace_get_hook_field(traceHook
, 2)));
555 inE
->event
.tcpEvent
->segmentKey
->tot_len
=
556 ltt_event_get_unsigned(event
,
557 lttv_trace_get_hook_field(traceHook
, 3));
558 inE
->event
.tcpEvent
->segmentKey
->ihl
=
559 ltt_event_get_unsigned(event
,
560 lttv_trace_get_hook_field(traceHook
, 4));
561 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
562 ltt_event_get_unsigned(event
,
563 lttv_trace_get_hook_field(traceHook
, 5));
564 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
565 ltt_event_get_unsigned(event
,
566 lttv_trace_get_hook_field(traceHook
, 6));
567 inE
->event
.tcpEvent
->segmentKey
->seq
=
568 ltt_event_get_unsigned(event
,
569 lttv_trace_get_hook_field(traceHook
, 7));
570 inE
->event
.tcpEvent
->segmentKey
->ack_seq
=
571 ltt_event_get_unsigned(event
,
572 lttv_trace_get_hook_field(traceHook
, 8));
573 inE
->event
.tcpEvent
->segmentKey
->doff
=
574 ltt_event_get_unsigned(event
,
575 lttv_trace_get_hook_field(traceHook
, 9));
576 inE
->event
.tcpEvent
->segmentKey
->ack
=
577 ltt_event_get_unsigned(event
,
578 lttv_trace_get_hook_field(traceHook
, 10));
579 inE
->event
.tcpEvent
->segmentKey
->rst
=
580 ltt_event_get_unsigned(event
,
581 lttv_trace_get_hook_field(traceHook
, 11));
582 inE
->event
.tcpEvent
->segmentKey
->syn
=
583 ltt_event_get_unsigned(event
,
584 lttv_trace_get_hook_field(traceHook
, 12));
585 inE
->event
.tcpEvent
->segmentKey
->fin
=
586 ltt_event_get_unsigned(event
,
587 lttv_trace_get_hook_field(traceHook
, 13));
589 syncState
->matchingModule
->matchEvent(syncState
, inE
);
591 g_debug("TCP input event %p for skb %p done", inE
, skb
);
594 else if (info
->name
== LTT_EVENT_UDPV4_RCV_EXTENDED
)
599 // Search pendingRecv for an event with the same skb
600 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
601 lttv_trace_get_hook_field(traceHook
, 0));
604 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
607 // This should only happen in case of lost events
608 g_warning("No matching pending receive event found");
614 if (syncState
->stats
)
616 processingData
->stats
->totRecvUDP
++;
619 // If it's there, remove it and proceed with a receive event
620 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
623 inE
->event
.udpEvent
= malloc(sizeof(UDPEvent
));
624 inE
->copy
= ©UDPEvent
;
625 inE
->destroy
= &destroyUDPEvent
;
626 inE
->event
.udpEvent
->direction
= IN
;
627 inE
->event
.udpEvent
->datagramKey
= malloc(sizeof(DatagramKey
));
628 inE
->event
.udpEvent
->datagramKey
->saddr
=
629 htonl(ltt_event_get_unsigned(event
,
630 lttv_trace_get_hook_field(traceHook
, 1)));
631 inE
->event
.udpEvent
->datagramKey
->daddr
=
632 htonl(ltt_event_get_unsigned(event
,
633 lttv_trace_get_hook_field(traceHook
, 2)));
634 inE
->event
.udpEvent
->unicast
= ltt_event_get_unsigned(event
,
635 lttv_trace_get_hook_field(traceHook
, 3)) == 0 ? false : true;
636 inE
->event
.udpEvent
->datagramKey
->ulen
=
637 ltt_event_get_unsigned(event
,
638 lttv_trace_get_hook_field(traceHook
, 4));
639 inE
->event
.udpEvent
->datagramKey
->source
=
640 ltt_event_get_unsigned(event
,
641 lttv_trace_get_hook_field(traceHook
, 5));
642 inE
->event
.udpEvent
->datagramKey
->dest
=
643 ltt_event_get_unsigned(event
,
644 lttv_trace_get_hook_field(traceHook
, 6));
645 dataStart
= ltt_event_get_long_unsigned(event
,
646 lttv_trace_get_hook_field(traceHook
, 7));
647 g_assert_cmpuint(sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
),
648 ==, sizeof(guint64
));
649 if (inE
->event
.udpEvent
->datagramKey
->ulen
- 8 >=
650 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
))
652 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
653 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
657 memset(inE
->event
.udpEvent
->datagramKey
->dataKey
, 0,
658 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
659 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
660 inE
->event
.udpEvent
->datagramKey
->ulen
- 8);
663 syncState
->matchingModule
->matchEvent(syncState
, inE
);
665 g_debug("UDP input event %p for skb %p done", inE
, skb
);
670 g_assert_not_reached();
678 * Write the processing-specific variables in the gnuplot script.
681 * syncState: container for synchronization data
684 static void writeProcessingGraphVariablesLTTVStandard(SyncState
* const
685 syncState
, const unsigned int i
)
687 ProcessingDataLTTVStandard
* processingData
= syncState
->processingData
;
688 ProcessingGraphsLTTVStandard
* traceI
= &processingData
->graphs
[i
];
690 fprintf(syncState
->graphsStream
, "clock_freq_%u= %.3f\n", i
, (double)
691 traceI
->startFreq
/ traceI
->freqScale
);
696 * Write the processing-specific options in the gnuplot script.
699 * syncState: container for synchronization data
700 * i: first trace number
701 * j: second trace number, garanteed to be larger than i
703 static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState
* const
704 syncState
, const unsigned int i
, const unsigned int j
)
706 fprintf(syncState
->graphsStream
,
707 "set key inside right bottom\n"
708 "set xlabel \"Clock %1$u\"\n"
709 "set xtics nomirror\n"
710 "set ylabel \"Clock %2$u\"\n"
711 "set ytics nomirror\n"
712 "set x2label \"Clock %1$d (s)\"\n"
713 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"
715 "set y2label \"Clock %2$d (s)\"\n"
716 "set y2range [GPVAL_Y_MIN / clock_freq_%2$u : GPVAL_Y_MAX / clock_freq_%2$u]\n"
717 "set y2tics\n", i
, j
);
722 * Write the processing-specific options in the gnuplot script.
725 * syncState: container for synchronization data
726 * i: first trace number
727 * j: second trace number, garanteed to be larger than i
729 static void writeProcessingTraceTimeOptionsLTTVStandard(SyncState
* const
730 syncState
, const unsigned int i
, const unsigned int j
)
732 fprintf(syncState
->graphsStream
,
733 "set key inside right bottom\n"
734 "set xlabel \"Clock %1$u\"\n"
735 "set xtics nomirror\n"
736 "set ylabel \"time (s)\"\n"
737 "set ytics nomirror\n"
738 "set x2label \"Clock %1$d (s)\"\n"
739 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"