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>
32 #include "sync_chain.h"
33 #include "event_processing_lttng_common.h"
35 #include "event_processing_lttng_standard.h"
39 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
43 // Functions common to all processing modules
44 static void initProcessingLTTVStandard(SyncState
* const syncState
,
45 LttvTracesetContext
* const traceSetContext
);
46 static void destroyProcessingLTTVStandard(SyncState
* const syncState
);
48 static void finalizeProcessingLTTVStandard(SyncState
* const syncState
);
49 static void printProcessingStatsLTTVStandard(SyncState
* const syncState
);
50 static void writeProcessingGraphsPlotsLTTVStandard(FILE* stream
, SyncState
*
51 const syncState
, const unsigned int i
, const unsigned int j
);
52 static void writeProcessingGraphsOptionsLTTVStandard(FILE* stream
, SyncState
*
53 const syncState
, const unsigned int i
, const unsigned int j
);
55 // Functions specific to this module
56 static void registerProcessingLTTVStandard() __attribute__((constructor (102)));
57 static gboolean
processEventLTTVStandard(void* hookData
, void* callData
);
58 static void partialDestroyProcessingLTTVStandard(SyncState
* const syncState
);
61 static ProcessingModule processingModuleLTTVStandard
= {
62 .name
= "LTTV-standard",
63 .initProcessing
= &initProcessingLTTVStandard
,
64 .destroyProcessing
= &destroyProcessingLTTVStandard
,
65 .finalizeProcessing
= &finalizeProcessingLTTVStandard
,
66 .printProcessingStats
= &printProcessingStatsLTTVStandard
,
67 .writeProcessingGraphsPlots
= &writeProcessingGraphsPlotsLTTVStandard
,
68 .writeProcessingGraphsOptions
= &writeProcessingGraphsOptionsLTTVStandard
,
74 * Processing Module registering function
76 static void registerProcessingLTTVStandard()
78 g_queue_push_tail(&processingModules
, &processingModuleLTTVStandard
);
85 * Allocate and initialize data structures for synchronizing a traceset.
86 * Register event hooks.
89 * syncState: container for synchronization data.
90 * This function allocates these processingData members:
95 * traceSetContext: set of LTTV traces
97 static void initProcessingLTTVStandard(SyncState
* const syncState
, LttvTracesetContext
*
98 const traceSetContext
)
101 ProcessingDataLTTVStandard
* processingData
;
103 processingData
= malloc(sizeof(ProcessingDataLTTVStandard
));
104 syncState
->processingData
= processingData
;
105 processingData
->traceSetContext
= traceSetContext
;
107 if (syncState
->stats
)
109 processingData
->stats
= calloc(1, sizeof(ProcessingStatsLTTVStandard
));
113 processingData
->stats
= NULL
;
116 processingData
->traceNumTable
= g_hash_table_new(&g_direct_hash
, NULL
);
117 processingData
->hookListList
= g_array_sized_new(FALSE
, FALSE
,
118 sizeof(GArray
*), syncState
->traceNb
);
119 processingData
->pendingRecv
= malloc(sizeof(GHashTable
*) *
122 for(i
= 0; i
< syncState
->traceNb
; i
++)
124 g_hash_table_insert(processingData
->traceNumTable
,
125 processingData
->traceSetContext
->traces
[i
]->t
, (gpointer
) i
);
128 for(i
= 0; i
< syncState
->traceNb
; i
++)
130 processingData
->pendingRecv
[i
]= g_hash_table_new_full(&g_direct_hash
,
131 NULL
, NULL
, &gdnDestroyEvent
);
134 registerHooks(processingData
->hookListList
, traceSetContext
,
135 &processEventLTTVStandard
, syncState
,
136 syncState
->matchingModule
->canMatch
);
141 * Call the partial processing destroyer, obtain and adjust the factors from
145 * syncState container for synchronization data.
147 static void finalizeProcessingLTTVStandard(SyncState
* const syncState
)
151 double minOffset
, minDrift
;
152 unsigned int refFreqTrace
;
153 ProcessingDataLTTVStandard
* processingData
;
155 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
157 partialDestroyProcessingLTTVStandard(syncState
);
159 factors
= syncState
->matchingModule
->finalizeMatching(syncState
);
161 /* The offsets are adjusted so the lowest one is 0. This is done because
162 * of a Lttv specific limitation: events cannot have negative times. By
163 * having non-negative offsets, events cannot be moved backwards to
167 for (i
= 0; i
< syncState
->traceNb
; i
++)
169 minOffset
= MIN(g_array_index(factors
, Factors
, i
).offset
, minOffset
);
172 for (i
= 0; i
< syncState
->traceNb
; i
++)
174 g_array_index(factors
, Factors
, i
).offset
-= minOffset
;
177 /* Because the timestamps are corrected at the TSC level (not at the
178 * LttTime level) all trace frequencies must be made equal. We choose to
179 * use the frequency of the system with the lowest drift
183 for (i
= 0; i
< syncState
->traceNb
; i
++)
185 if (g_array_index(factors
, Factors
, i
).drift
< minDrift
)
187 minDrift
= g_array_index(factors
, Factors
, i
).drift
;
191 g_assert(syncState
->traceNb
== 0 || minDrift
!= INFINITY
);
193 // Write the factors to the LttTrace structures
194 for (i
= 0; i
< syncState
->traceNb
; i
++)
197 Factors
* traceFactors
;
199 t
= processingData
->traceSetContext
->traces
[i
]->t
;
200 traceFactors
= &g_array_index(factors
, Factors
, i
);
202 t
->drift
= traceFactors
->drift
;
203 t
->offset
= traceFactors
->offset
;
205 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->start_freq
;
207 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->freq_scale
;
208 t
->start_time_from_tsc
=
209 ltt_time_from_uint64(tsc_to_uint64(t
->freq_scale
, t
->start_freq
,
210 t
->drift
* t
->start_tsc
+ t
->offset
));
213 g_array_free(factors
, TRUE
);
215 lttv_traceset_context_compute_time_span(processingData
->traceSetContext
,
216 &processingData
->traceSetContext
->time_span
);
218 g_debug("traceset start %ld.%09ld end %ld.%09ld\n",
219 processingData
->traceSetContext
->time_span
.start_time
.tv_sec
,
220 processingData
->traceSetContext
->time_span
.start_time
.tv_nsec
,
221 processingData
->traceSetContext
->time_span
.end_time
.tv_sec
,
222 processingData
->traceSetContext
->time_span
.end_time
.tv_nsec
);
227 * Print statistics related to processing and downstream modules. Must be
228 * called after finalizeProcessing.
231 * syncState container for synchronization data.
233 static void printProcessingStatsLTTVStandard(SyncState
* const syncState
)
236 ProcessingDataLTTVStandard
* processingData
;
238 if (!syncState
->stats
)
243 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
245 printf("LTTV processing stats:\n");
246 printf("\treceived frames: %d\n", processingData
->stats
->totRecv
);
247 printf("\treceived frames that are IP: %d\n",
248 processingData
->stats
->totRecvIp
);
249 if (syncState
->matchingModule
->canMatch
[TCP
])
251 printf("\treceived and processed packets that are TCP: %d\n",
252 processingData
->stats
->totRecvTCP
);
254 if (syncState
->matchingModule
->canMatch
[UDP
])
256 printf("\treceived and processed packets that are UDP: %d\n",
257 processingData
->stats
->totRecvUDP
);
259 if (syncState
->matchingModule
->canMatch
[TCP
])
261 printf("\tsent packets that are TCP: %d\n",
262 processingData
->stats
->totOutE
);
265 if (syncState
->matchingModule
->printMatchingStats
!= NULL
)
267 syncState
->matchingModule
->printMatchingStats(syncState
);
270 printf("Resulting synchronization factors:\n");
271 for (i
= 0; i
< syncState
->traceNb
; i
++)
275 t
= processingData
->traceSetContext
->traces
[i
]->t
;
277 printf("\ttrace %u drift= %g offset= %g (%f) start time= %ld.%09ld\n",
278 i
, t
->drift
, t
->offset
, (double) tsc_to_uint64(t
->freq_scale
,
279 t
->start_freq
, t
->offset
) / NANOSECONDS_PER_SECOND
,
280 t
->start_time_from_tsc
.tv_sec
, t
->start_time_from_tsc
.tv_nsec
);
286 * Unregister event hooks. Deallocate processingData.
289 * syncState: container for synchronization data.
290 * This function deallocates these processingData members:
293 static void destroyProcessingLTTVStandard(SyncState
* const syncState
)
295 ProcessingDataLTTVStandard
* processingData
;
297 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
299 if (processingData
== NULL
)
304 partialDestroyProcessingLTTVStandard(syncState
);
306 if (syncState
->stats
)
308 free(processingData
->stats
);
311 free(syncState
->processingData
);
312 syncState
->processingData
= NULL
;
317 * Unregister event hooks. Deallocate some of processingData.
319 * This function can be called right after the events have been processed to
320 * free some data structures that are not needed for finalization.
323 * syncState: container for synchronization data.
324 * This function deallocates these members:
329 static void partialDestroyProcessingLTTVStandard(SyncState
* const syncState
)
332 ProcessingDataLTTVStandard
* processingData
;
334 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
336 if (processingData
== NULL
|| processingData
->traceNumTable
== NULL
)
341 g_hash_table_destroy(processingData
->traceNumTable
);
342 processingData
->traceNumTable
= NULL
;
344 for(i
= 0; i
< syncState
->traceNb
; i
++)
347 g_debug("Cleaning up pendingRecv list\n");
348 g_hash_table_destroy(processingData
->pendingRecv
[i
]);
350 free(processingData
->pendingRecv
);
352 unregisterHooks(processingData
->hookListList
,
353 processingData
->traceSetContext
);
358 * Lttv hook function that will be called for network events
361 * hookData: LttvTraceHook* for the type of event that generated the call
362 * callData: LttvTracefileContext* at the moment of the event
365 * FALSE Always returns FALSE, meaning to keep processing hooks for
368 static gboolean
processEventLTTVStandard(void* hookData
, void* callData
)
370 LttvTraceHook
* traceHook
;
371 LttvTracefileContext
* tfc
;
377 unsigned long traceNum
;
378 struct marker_info
* info
;
379 SyncState
* syncState
;
380 ProcessingDataLTTVStandard
* processingData
;
382 traceHook
= (LttvTraceHook
*) hookData
;
383 tfc
= (LttvTracefileContext
*) callData
;
384 trace
= tfc
->t_context
->t
;
385 syncState
= (SyncState
*) traceHook
->hook_data
;
386 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
387 event
= ltt_tracefile_get_event(tfc
->tf
);
388 info
= marker_get_info_from_id(tfc
->tf
->mdata
, event
->event_id
);
389 tsc
= ltt_event_cycle_count(event
);
390 time
= ltt_event_time(event
);
391 wTime
.seconds
= time
.tv_sec
;
392 wTime
.nanosec
= time
.tv_nsec
;
394 g_assert(g_hash_table_lookup_extended(processingData
->traceNumTable
,
395 trace
, NULL
, (gpointer
*) &traceNum
));
397 g_debug("XXXX process event: time: %ld.%09ld trace: %ld (%p) name: %s ",
398 time
.tv_sec
, time
.tv_nsec
, traceNum
, trace
,
399 g_quark_to_string(info
->name
));
401 if (info
->name
== LTT_EVENT_DEV_XMIT_EXTENDED
)
405 if (!ltt_event_get_unsigned(event
,
406 lttv_trace_get_hook_field(traceHook
, 1)) == ETH_P_IP
||
407 !ltt_event_get_unsigned(event
,
408 lttv_trace_get_hook_field(traceHook
, 2)) == IPPROTO_TCP
)
413 if (!syncState
->matchingModule
->canMatch
[TCP
])
418 if (syncState
->stats
)
420 processingData
->stats
->totOutE
++;
423 outE
= malloc(sizeof(Event
));
424 outE
->traceNum
= traceNum
;
426 outE
->wallTime
= wTime
;
428 outE
->copy
= ©TCPEvent
;
429 outE
->destroy
= &destroyTCPEvent
;
430 outE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
431 outE
->event
.tcpEvent
->direction
= OUT
;
432 outE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
433 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
434 htonl(ltt_event_get_unsigned(event
,
435 lttv_trace_get_hook_field(traceHook
, 3)));
436 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
437 htonl(ltt_event_get_unsigned(event
,
438 lttv_trace_get_hook_field(traceHook
, 4)));
439 outE
->event
.tcpEvent
->segmentKey
->tot_len
=
440 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
442 outE
->event
.tcpEvent
->segmentKey
->ihl
= ltt_event_get_unsigned(event
,
443 lttv_trace_get_hook_field(traceHook
, 6));
444 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
445 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
447 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
448 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
450 outE
->event
.tcpEvent
->segmentKey
->seq
= ltt_event_get_unsigned(event
,
451 lttv_trace_get_hook_field(traceHook
, 9));
452 outE
->event
.tcpEvent
->segmentKey
->ack_seq
=
453 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
455 outE
->event
.tcpEvent
->segmentKey
->doff
= ltt_event_get_unsigned(event
,
456 lttv_trace_get_hook_field(traceHook
, 11));
457 outE
->event
.tcpEvent
->segmentKey
->ack
= ltt_event_get_unsigned(event
,
458 lttv_trace_get_hook_field(traceHook
, 12));
459 outE
->event
.tcpEvent
->segmentKey
->rst
= ltt_event_get_unsigned(event
,
460 lttv_trace_get_hook_field(traceHook
, 13));
461 outE
->event
.tcpEvent
->segmentKey
->syn
= ltt_event_get_unsigned(event
,
462 lttv_trace_get_hook_field(traceHook
, 14));
463 outE
->event
.tcpEvent
->segmentKey
->fin
= ltt_event_get_unsigned(event
,
464 lttv_trace_get_hook_field(traceHook
, 15));
466 syncState
->matchingModule
->matchEvent(syncState
, outE
);
468 g_debug("Output event done\n");
470 else if (info
->name
== LTT_EVENT_DEV_RECEIVE
)
474 if (syncState
->stats
)
476 processingData
->stats
->totRecv
++;
479 protocol
= ltt_event_get_unsigned(event
,
480 lttv_trace_get_hook_field(traceHook
, 1));
482 if (protocol
== ETH_P_IP
)
487 if (syncState
->stats
)
489 processingData
->stats
->totRecvIp
++;
492 inE
= malloc(sizeof(Event
));
493 inE
->traceNum
= traceNum
;
495 inE
->wallTime
= wTime
;
496 inE
->event
.tcpEvent
= NULL
;
497 inE
->copy
= ©Event
;
498 inE
->destroy
= &destroyEvent
;
500 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
501 lttv_trace_get_hook_field(traceHook
, 0));
502 g_hash_table_replace(processingData
->pendingRecv
[traceNum
], skb
,
505 g_debug("Adding inE %p for skb %p to pendingRecv\n", inE
, skb
);
512 else if (info
->name
== LTT_EVENT_TCPV4_RCV_EXTENDED
)
517 // Search pendingRecv for an event with the same skb
518 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
519 lttv_trace_get_hook_field(traceHook
, 0));
522 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
525 // This should only happen in case of lost events
526 g_warning("No matching pending receive event found");
530 if (syncState
->stats
)
532 processingData
->stats
->totRecvTCP
++;
535 // If it's there, remove it and proceed with a receive event
536 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
539 inE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
540 inE
->copy
= ©TCPEvent
;
541 inE
->destroy
= &destroyTCPEvent
;
542 inE
->event
.tcpEvent
->direction
= IN
;
543 inE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
544 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
545 htonl(ltt_event_get_unsigned(event
,
546 lttv_trace_get_hook_field(traceHook
, 1)));
547 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
548 htonl(ltt_event_get_unsigned(event
,
549 lttv_trace_get_hook_field(traceHook
, 2)));
550 inE
->event
.tcpEvent
->segmentKey
->tot_len
=
551 ltt_event_get_unsigned(event
,
552 lttv_trace_get_hook_field(traceHook
, 3));
553 inE
->event
.tcpEvent
->segmentKey
->ihl
=
554 ltt_event_get_unsigned(event
,
555 lttv_trace_get_hook_field(traceHook
, 4));
556 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
557 ltt_event_get_unsigned(event
,
558 lttv_trace_get_hook_field(traceHook
, 5));
559 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
560 ltt_event_get_unsigned(event
,
561 lttv_trace_get_hook_field(traceHook
, 6));
562 inE
->event
.tcpEvent
->segmentKey
->seq
=
563 ltt_event_get_unsigned(event
,
564 lttv_trace_get_hook_field(traceHook
, 7));
565 inE
->event
.tcpEvent
->segmentKey
->ack_seq
=
566 ltt_event_get_unsigned(event
,
567 lttv_trace_get_hook_field(traceHook
, 8));
568 inE
->event
.tcpEvent
->segmentKey
->doff
=
569 ltt_event_get_unsigned(event
,
570 lttv_trace_get_hook_field(traceHook
, 9));
571 inE
->event
.tcpEvent
->segmentKey
->ack
=
572 ltt_event_get_unsigned(event
,
573 lttv_trace_get_hook_field(traceHook
, 10));
574 inE
->event
.tcpEvent
->segmentKey
->rst
=
575 ltt_event_get_unsigned(event
,
576 lttv_trace_get_hook_field(traceHook
, 11));
577 inE
->event
.tcpEvent
->segmentKey
->syn
=
578 ltt_event_get_unsigned(event
,
579 lttv_trace_get_hook_field(traceHook
, 12));
580 inE
->event
.tcpEvent
->segmentKey
->fin
=
581 ltt_event_get_unsigned(event
,
582 lttv_trace_get_hook_field(traceHook
, 13));
584 syncState
->matchingModule
->matchEvent(syncState
, inE
);
586 g_debug("TCP input event %p for skb %p done\n", inE
, skb
);
589 else if (info
->name
== LTT_EVENT_UDPV4_RCV_EXTENDED
)
594 // Search pendingRecv for an event with the same skb
595 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
596 lttv_trace_get_hook_field(traceHook
, 0));
599 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
602 // This should only happen in case of lost events
603 g_warning("No matching pending receive event found");
609 if (syncState
->stats
)
611 processingData
->stats
->totRecvUDP
++;
614 // If it's there, remove it and proceed with a receive event
615 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
618 inE
->event
.udpEvent
= malloc(sizeof(UDPEvent
));
619 inE
->copy
= ©UDPEvent
;
620 inE
->destroy
= &destroyUDPEvent
;
621 inE
->event
.udpEvent
->direction
= IN
;
622 inE
->event
.udpEvent
->datagramKey
= malloc(sizeof(DatagramKey
));
623 inE
->event
.udpEvent
->datagramKey
->saddr
=
624 htonl(ltt_event_get_unsigned(event
,
625 lttv_trace_get_hook_field(traceHook
, 1)));
626 inE
->event
.udpEvent
->datagramKey
->daddr
=
627 htonl(ltt_event_get_unsigned(event
,
628 lttv_trace_get_hook_field(traceHook
, 2)));
629 inE
->event
.udpEvent
->unicast
= ltt_event_get_unsigned(event
,
630 lttv_trace_get_hook_field(traceHook
, 3)) == 0 ? false : true;
631 inE
->event
.udpEvent
->datagramKey
->ulen
=
632 ltt_event_get_unsigned(event
,
633 lttv_trace_get_hook_field(traceHook
, 4));
634 inE
->event
.udpEvent
->datagramKey
->source
=
635 ltt_event_get_unsigned(event
,
636 lttv_trace_get_hook_field(traceHook
, 5));
637 inE
->event
.udpEvent
->datagramKey
->dest
=
638 ltt_event_get_unsigned(event
,
639 lttv_trace_get_hook_field(traceHook
, 6));
640 dataStart
= ltt_event_get_long_unsigned(event
,
641 lttv_trace_get_hook_field(traceHook
, 7));
642 g_assert_cmpuint(sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
),
643 ==, sizeof(guint64
));
644 if (inE
->event
.udpEvent
->datagramKey
->ulen
- 8 >=
645 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
))
647 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
648 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
652 memset(inE
->event
.udpEvent
->datagramKey
->dataKey
, 0,
653 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
654 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
655 inE
->event
.udpEvent
->datagramKey
->ulen
- 8);
658 syncState
->matchingModule
->matchEvent(syncState
, inE
);
660 g_debug("UDP input event %p for skb %p done\n", inE
, skb
);
665 g_assert_not_reached();
673 * Write the processing-specific graph lines in the gnuplot script (none at
674 * the moment). Call the downstream module's graph function.
677 * stream: stream where to write the data
678 * syncState: container for synchronization data
679 * i: first trace number
680 * j: second trace number, garanteed to be larger than i
682 static void writeProcessingGraphsPlotsLTTVStandard(FILE* stream
, SyncState
*
683 const syncState
, const unsigned int i
, const unsigned int j
)
685 if (syncState
->matchingModule
->writeMatchingGraphsPlots
!= NULL
)
687 syncState
->matchingModule
->writeMatchingGraphsPlots(stream
, syncState
,
694 * Write the processing-specific options in the gnuplot script. Call the
695 * downstream module's options function.
698 * stream: stream where to write the data
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 writeProcessingGraphsOptionsLTTVStandard(FILE* stream
, SyncState
*
704 const syncState
, const unsigned int i
, const unsigned int j
)
706 ProcessingDataLTTVStandard
* processingData
;
707 LttTrace
* traceI
, * traceJ
;
709 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
711 traceI
= processingData
->traceSetContext
->traces
[i
]->t
;
712 traceJ
= processingData
->traceSetContext
->traces
[j
]->t
;
715 "set x2label \"Clock %1$d (s)\"\n"
716 "set x2range [GPVAL_X_MIN / %2$.1f : GPVAL_X_MAX / %2$.1f]\n"
718 "set y2label \"Clock %3$d (s)\"\n"
719 "set y2range [GPVAL_Y_MIN / %4$.1f : GPVAL_Y_MAX / %4$.1f]\n"
720 "set y2tics\n", i
, (double) traceI
->start_freq
/ traceI
->freq_scale
,
721 j
, (double) traceJ
->start_freq
/ traceJ
->freq_scale
);
723 if (syncState
->matchingModule
->writeMatchingGraphsOptions
!= NULL
)
725 syncState
->matchingModule
->writeMatchingGraphsOptions(stream
,