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 if (syncState
->stats
)
110 processingData
->stats
= calloc(1, sizeof(ProcessingStatsLTTVStandard
));
114 processingData
->stats
= NULL
;
117 processingData
->traceNumTable
= g_hash_table_new(&g_direct_hash
, NULL
);
118 processingData
->hookListList
= g_array_sized_new(FALSE
, FALSE
,
119 sizeof(GArray
*), syncState
->traceNb
);
120 processingData
->pendingRecv
= malloc(sizeof(GHashTable
*) *
123 for(i
= 0; i
< syncState
->traceNb
; i
++)
125 g_hash_table_insert(processingData
->traceNumTable
,
126 processingData
->traceSetContext
->traces
[i
]->t
, (gpointer
) i
);
129 if (syncState
->graphsStream
)
131 processingData
->graphs
= malloc(syncState
->traceNb
*
132 sizeof(ProcessingGraphsLTTVStandard
));
134 for(i
= 0; i
< syncState
->traceNb
; i
++)
136 LttTrace
* traceI
= processingData
->traceSetContext
->traces
[i
]->t
;
138 processingData
->graphs
[i
].startFreq
= traceI
->start_freq
;
139 processingData
->graphs
[i
].freqScale
= traceI
->freq_scale
;
144 processingData
->graphs
= NULL
;
147 for(i
= 0; i
< syncState
->traceNb
; i
++)
149 processingData
->pendingRecv
[i
]= g_hash_table_new_full(&g_direct_hash
,
150 NULL
, NULL
, &gdnDestroyEvent
);
153 registerHooks(processingData
->hookListList
,
154 processingData
->traceSetContext
, &processEventLTTVStandard
, syncState
,
155 syncState
->matchingModule
->canMatch
);
160 * Call the partial processing destroyer, obtain and adjust the factors from
164 * syncState container for synchronization data.
166 static void finalizeProcessingLTTVStandard(SyncState
* const syncState
)
170 double minOffset
, minDrift
;
171 unsigned int refFreqTrace
;
172 ProcessingDataLTTVStandard
* processingData
;
174 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
176 partialDestroyProcessingLTTVStandard(syncState
);
178 factors
= syncState
->matchingModule
->finalizeMatching(syncState
);
180 /* The offsets are adjusted so the lowest one is 0. This is done because
181 * of a Lttv specific limitation: events cannot have negative times. By
182 * having non-negative offsets, events cannot be moved backwards to
186 for (i
= 0; i
< syncState
->traceNb
; i
++)
188 minOffset
= MIN(g_array_index(factors
, Factors
, i
).offset
, minOffset
);
191 for (i
= 0; i
< syncState
->traceNb
; i
++)
193 g_array_index(factors
, Factors
, i
).offset
-= minOffset
;
196 /* Because the timestamps are corrected at the TSC level (not at the
197 * LttTime level) all trace frequencies must be made equal. We choose to
198 * use the frequency of the system with the lowest drift
202 for (i
= 0; i
< syncState
->traceNb
; i
++)
204 if (g_array_index(factors
, Factors
, i
).drift
< minDrift
)
206 minDrift
= g_array_index(factors
, Factors
, i
).drift
;
210 g_assert(syncState
->traceNb
== 0 || minDrift
!= INFINITY
);
212 // Write the factors to the LttTrace structures
213 for (i
= 0; i
< syncState
->traceNb
; i
++)
216 Factors
* traceFactors
;
218 t
= processingData
->traceSetContext
->traces
[i
]->t
;
219 traceFactors
= &g_array_index(factors
, Factors
, i
);
221 t
->drift
= traceFactors
->drift
;
222 t
->offset
= traceFactors
->offset
;
224 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->start_freq
;
226 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->freq_scale
;
227 t
->start_time_from_tsc
=
228 ltt_time_from_uint64(tsc_to_uint64(t
->freq_scale
, t
->start_freq
,
229 t
->drift
* t
->start_tsc
+ t
->offset
));
232 g_array_free(factors
, TRUE
);
234 lttv_traceset_context_compute_time_span(processingData
->traceSetContext
,
235 &processingData
->traceSetContext
->time_span
);
237 g_debug("traceset start %ld.%09ld end %ld.%09ld",
238 processingData
->traceSetContext
->time_span
.start_time
.tv_sec
,
239 processingData
->traceSetContext
->time_span
.start_time
.tv_nsec
,
240 processingData
->traceSetContext
->time_span
.end_time
.tv_sec
,
241 processingData
->traceSetContext
->time_span
.end_time
.tv_nsec
);
246 * Print statistics related to processing Must be called after
247 * finalizeProcessing.
250 * syncState container for synchronization data.
252 static void printProcessingStatsLTTVStandard(SyncState
* const syncState
)
254 ProcessingDataLTTVStandard
* processingData
;
256 if (!syncState
->stats
)
261 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
263 printf("LTTV processing stats:\n");
264 printf("\treceived frames: %d\n", processingData
->stats
->totRecv
);
265 printf("\treceived frames that are IP: %d\n",
266 processingData
->stats
->totRecvIp
);
267 if (syncState
->matchingModule
->canMatch
[TCP
])
269 printf("\treceived and processed packets that are TCP: %d\n",
270 processingData
->stats
->totRecvTCP
);
272 if (syncState
->matchingModule
->canMatch
[UDP
])
274 printf("\treceived and processed packets that are UDP: %d\n",
275 processingData
->stats
->totRecvUDP
);
277 if (syncState
->matchingModule
->canMatch
[TCP
])
279 printf("\tsent packets that are TCP: %d\n",
280 processingData
->stats
->totOutE
);
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 if (syncState
->graphsStream
)
313 free(processingData
->graphs
);
316 free(syncState
->processingData
);
317 syncState
->processingData
= NULL
;
322 * Unregister event hooks. Deallocate some of processingData.
324 * This function can be called right after the events have been processed to
325 * free some data structures that are not needed for finalization.
328 * syncState: container for synchronization data.
329 * This function deallocates these members:
334 static void partialDestroyProcessingLTTVStandard(SyncState
* const syncState
)
337 ProcessingDataLTTVStandard
* processingData
;
339 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
341 if (processingData
== NULL
|| processingData
->traceNumTable
== NULL
)
346 g_hash_table_destroy(processingData
->traceNumTable
);
347 processingData
->traceNumTable
= NULL
;
349 for(i
= 0; i
< syncState
->traceNb
; i
++)
352 g_debug("Cleaning up pendingRecv list");
353 g_hash_table_destroy(processingData
->pendingRecv
[i
]);
355 free(processingData
->pendingRecv
);
357 unregisterHooks(processingData
->hookListList
,
358 processingData
->traceSetContext
);
363 * Lttv hook function that will be called for network events
366 * hookData: LttvTraceHook* for the type of event that generated the call
367 * callData: LttvTracefileContext* at the moment of the event
370 * FALSE Always returns FALSE, meaning to keep processing hooks for
373 static gboolean
processEventLTTVStandard(void* hookData
, void* callData
)
375 LttvTraceHook
* traceHook
;
376 LttvTracefileContext
* tfc
;
382 unsigned long traceNum
;
383 struct marker_info
* info
;
384 SyncState
* syncState
;
385 ProcessingDataLTTVStandard
* processingData
;
387 traceHook
= (LttvTraceHook
*) hookData
;
388 tfc
= (LttvTracefileContext
*) callData
;
389 trace
= tfc
->t_context
->t
;
390 syncState
= (SyncState
*) traceHook
->hook_data
;
391 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
392 event
= ltt_tracefile_get_event(tfc
->tf
);
393 info
= marker_get_info_from_id(tfc
->tf
->mdata
, event
->event_id
);
394 tsc
= ltt_event_cycle_count(event
);
395 time
= ltt_event_time(event
);
396 wTime
.seconds
= time
.tv_sec
;
397 wTime
.nanosec
= time
.tv_nsec
;
399 g_assert(g_hash_table_lookup_extended(processingData
->traceNumTable
,
400 trace
, NULL
, (gpointer
*) &traceNum
));
402 g_debug("Process event: time: %ld.%09ld trace: %ld (%p) name: %s ",
403 time
.tv_sec
, time
.tv_nsec
, traceNum
, trace
,
404 g_quark_to_string(info
->name
));
406 if (info
->name
== LTT_EVENT_DEV_XMIT_EXTENDED
)
410 if (!ltt_event_get_unsigned(event
,
411 lttv_trace_get_hook_field(traceHook
, 1)) == ETH_P_IP
||
412 !ltt_event_get_unsigned(event
,
413 lttv_trace_get_hook_field(traceHook
, 2)) == IPPROTO_TCP
)
418 if (!syncState
->matchingModule
->canMatch
[TCP
])
423 if (syncState
->stats
)
425 processingData
->stats
->totOutE
++;
428 outE
= malloc(sizeof(Event
));
429 outE
->traceNum
= traceNum
;
431 outE
->wallTime
= wTime
;
433 outE
->copy
= ©TCPEvent
;
434 outE
->destroy
= &destroyTCPEvent
;
435 outE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
436 outE
->event
.tcpEvent
->direction
= OUT
;
437 outE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
438 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
439 htonl(ltt_event_get_unsigned(event
,
440 lttv_trace_get_hook_field(traceHook
, 3)));
441 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
442 htonl(ltt_event_get_unsigned(event
,
443 lttv_trace_get_hook_field(traceHook
, 4)));
444 outE
->event
.tcpEvent
->segmentKey
->tot_len
=
445 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
447 outE
->event
.tcpEvent
->segmentKey
->ihl
= ltt_event_get_unsigned(event
,
448 lttv_trace_get_hook_field(traceHook
, 6));
449 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
450 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
452 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
453 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
455 outE
->event
.tcpEvent
->segmentKey
->seq
= ltt_event_get_unsigned(event
,
456 lttv_trace_get_hook_field(traceHook
, 9));
457 outE
->event
.tcpEvent
->segmentKey
->ack_seq
=
458 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
460 outE
->event
.tcpEvent
->segmentKey
->doff
= ltt_event_get_unsigned(event
,
461 lttv_trace_get_hook_field(traceHook
, 11));
462 outE
->event
.tcpEvent
->segmentKey
->ack
= ltt_event_get_unsigned(event
,
463 lttv_trace_get_hook_field(traceHook
, 12));
464 outE
->event
.tcpEvent
->segmentKey
->rst
= ltt_event_get_unsigned(event
,
465 lttv_trace_get_hook_field(traceHook
, 13));
466 outE
->event
.tcpEvent
->segmentKey
->syn
= ltt_event_get_unsigned(event
,
467 lttv_trace_get_hook_field(traceHook
, 14));
468 outE
->event
.tcpEvent
->segmentKey
->fin
= ltt_event_get_unsigned(event
,
469 lttv_trace_get_hook_field(traceHook
, 15));
471 syncState
->matchingModule
->matchEvent(syncState
, outE
);
473 g_debug("Output event done");
475 else if (info
->name
== LTT_EVENT_DEV_RECEIVE
)
479 if (syncState
->stats
)
481 processingData
->stats
->totRecv
++;
484 protocol
= ltt_event_get_unsigned(event
,
485 lttv_trace_get_hook_field(traceHook
, 1));
487 if (protocol
== ETH_P_IP
)
492 if (syncState
->stats
)
494 processingData
->stats
->totRecvIp
++;
497 inE
= malloc(sizeof(Event
));
498 inE
->traceNum
= traceNum
;
500 inE
->wallTime
= wTime
;
501 inE
->event
.tcpEvent
= NULL
;
502 inE
->copy
= ©Event
;
503 inE
->destroy
= &destroyEvent
;
505 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
506 lttv_trace_get_hook_field(traceHook
, 0));
507 g_hash_table_replace(processingData
->pendingRecv
[traceNum
], skb
,
510 g_debug("Adding inE %p for skb %p to pendingRecv", inE
, skb
);
513 else if (info
->name
== LTT_EVENT_TCPV4_RCV_EXTENDED
)
518 // Search pendingRecv for an event with the same skb
519 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
520 lttv_trace_get_hook_field(traceHook
, 0));
523 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
526 // This should only happen in case of lost events
527 g_warning("No matching pending receive event found");
531 if (syncState
->stats
)
533 processingData
->stats
->totRecvTCP
++;
536 // If it's there, remove it and proceed with a receive event
537 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
540 inE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
541 inE
->copy
= ©TCPEvent
;
542 inE
->destroy
= &destroyTCPEvent
;
543 inE
->event
.tcpEvent
->direction
= IN
;
544 inE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
545 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
546 htonl(ltt_event_get_unsigned(event
,
547 lttv_trace_get_hook_field(traceHook
, 1)));
548 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
549 htonl(ltt_event_get_unsigned(event
,
550 lttv_trace_get_hook_field(traceHook
, 2)));
551 inE
->event
.tcpEvent
->segmentKey
->tot_len
=
552 ltt_event_get_unsigned(event
,
553 lttv_trace_get_hook_field(traceHook
, 3));
554 inE
->event
.tcpEvent
->segmentKey
->ihl
=
555 ltt_event_get_unsigned(event
,
556 lttv_trace_get_hook_field(traceHook
, 4));
557 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
558 ltt_event_get_unsigned(event
,
559 lttv_trace_get_hook_field(traceHook
, 5));
560 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
561 ltt_event_get_unsigned(event
,
562 lttv_trace_get_hook_field(traceHook
, 6));
563 inE
->event
.tcpEvent
->segmentKey
->seq
=
564 ltt_event_get_unsigned(event
,
565 lttv_trace_get_hook_field(traceHook
, 7));
566 inE
->event
.tcpEvent
->segmentKey
->ack_seq
=
567 ltt_event_get_unsigned(event
,
568 lttv_trace_get_hook_field(traceHook
, 8));
569 inE
->event
.tcpEvent
->segmentKey
->doff
=
570 ltt_event_get_unsigned(event
,
571 lttv_trace_get_hook_field(traceHook
, 9));
572 inE
->event
.tcpEvent
->segmentKey
->ack
=
573 ltt_event_get_unsigned(event
,
574 lttv_trace_get_hook_field(traceHook
, 10));
575 inE
->event
.tcpEvent
->segmentKey
->rst
=
576 ltt_event_get_unsigned(event
,
577 lttv_trace_get_hook_field(traceHook
, 11));
578 inE
->event
.tcpEvent
->segmentKey
->syn
=
579 ltt_event_get_unsigned(event
,
580 lttv_trace_get_hook_field(traceHook
, 12));
581 inE
->event
.tcpEvent
->segmentKey
->fin
=
582 ltt_event_get_unsigned(event
,
583 lttv_trace_get_hook_field(traceHook
, 13));
585 syncState
->matchingModule
->matchEvent(syncState
, inE
);
587 g_debug("TCP input event %p for skb %p done", inE
, skb
);
590 else if (info
->name
== LTT_EVENT_UDPV4_RCV_EXTENDED
)
595 // Search pendingRecv for an event with the same skb
596 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
597 lttv_trace_get_hook_field(traceHook
, 0));
600 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
603 // This should only happen in case of lost events
604 g_warning("No matching pending receive event found");
610 if (syncState
->stats
)
612 processingData
->stats
->totRecvUDP
++;
615 // If it's there, remove it and proceed with a receive event
616 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
619 inE
->event
.udpEvent
= malloc(sizeof(UDPEvent
));
620 inE
->copy
= ©UDPEvent
;
621 inE
->destroy
= &destroyUDPEvent
;
622 inE
->event
.udpEvent
->direction
= IN
;
623 inE
->event
.udpEvent
->datagramKey
= malloc(sizeof(DatagramKey
));
624 inE
->event
.udpEvent
->datagramKey
->saddr
=
625 htonl(ltt_event_get_unsigned(event
,
626 lttv_trace_get_hook_field(traceHook
, 1)));
627 inE
->event
.udpEvent
->datagramKey
->daddr
=
628 htonl(ltt_event_get_unsigned(event
,
629 lttv_trace_get_hook_field(traceHook
, 2)));
630 inE
->event
.udpEvent
->unicast
= ltt_event_get_unsigned(event
,
631 lttv_trace_get_hook_field(traceHook
, 3)) == 0 ? false : true;
632 inE
->event
.udpEvent
->datagramKey
->ulen
=
633 ltt_event_get_unsigned(event
,
634 lttv_trace_get_hook_field(traceHook
, 4));
635 inE
->event
.udpEvent
->datagramKey
->source
=
636 ltt_event_get_unsigned(event
,
637 lttv_trace_get_hook_field(traceHook
, 5));
638 inE
->event
.udpEvent
->datagramKey
->dest
=
639 ltt_event_get_unsigned(event
,
640 lttv_trace_get_hook_field(traceHook
, 6));
641 dataStart
= ltt_event_get_long_unsigned(event
,
642 lttv_trace_get_hook_field(traceHook
, 7));
643 g_assert_cmpuint(sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
),
644 ==, sizeof(guint64
));
645 if (inE
->event
.udpEvent
->datagramKey
->ulen
- 8 >=
646 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
))
648 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
649 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
653 memset(inE
->event
.udpEvent
->datagramKey
->dataKey
, 0,
654 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
655 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
656 inE
->event
.udpEvent
->datagramKey
->ulen
- 8);
659 syncState
->matchingModule
->matchEvent(syncState
, inE
);
661 g_debug("UDP input event %p for skb %p done", inE
, skb
);
666 g_assert_not_reached();
674 * Write the processing-specific variables in the gnuplot script.
677 * syncState: container for synchronization data
680 static void writeProcessingGraphVariablesLTTVStandard(SyncState
* const
681 syncState
, const unsigned int i
)
683 ProcessingDataLTTVStandard
* processingData
= syncState
->processingData
;
684 ProcessingGraphsLTTVStandard
* traceI
= &processingData
->graphs
[i
];
686 fprintf(syncState
->graphsStream
, "clock_freq_%u= %.3f\n", i
, (double)
687 traceI
->startFreq
/ traceI
->freqScale
);
692 * Write the processing-specific options in the gnuplot script.
695 * syncState: container for synchronization data
696 * i: first trace number
697 * j: second trace number, garanteed to be larger than i
699 static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState
* const
700 syncState
, const unsigned int i
, const unsigned int j
)
702 ProcessingDataLTTVStandard
* processingData
;
703 ProcessingGraphsLTTVStandard
* traceI
, * traceJ
;
705 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
707 traceI
= &processingData
->graphs
[i
];
708 traceJ
= &processingData
->graphs
[j
];
710 fprintf(syncState
->graphsStream
,
711 "set key inside right bottom\n"
712 "set xlabel \"Clock %1$u\"\n"
713 "set xtics nomirror\n"
714 "set ylabel \"Clock %2$u\"\n"
715 "set ytics nomirror\n"
716 "set x2label \"Clock %1$d (s)\"\n"
717 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"
719 "set y2label \"Clock %2$d (s)\"\n"
720 "set y2range [GPVAL_Y_MIN / clock_freq_%2$u : GPVAL_Y_MAX / clock_freq_%2$u]\n"
721 "set y2tics\n", i
, j
);
726 * Write the processing-specific options in the gnuplot script.
729 * syncState: container for synchronization data
730 * i: first trace number
731 * j: second trace number, garanteed to be larger than i
733 static void writeProcessingTraceTimeOptionsLTTVStandard(SyncState
* const
734 syncState
, const unsigned int i
, const unsigned int j
)
736 ProcessingDataLTTVStandard
* processingData
;
737 ProcessingGraphsLTTVStandard
* traceI
, * traceJ
;
739 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
741 traceI
= &processingData
->graphs
[i
];
742 traceJ
= &processingData
->graphs
[j
];
744 fprintf(syncState
->graphsStream
,
745 "set key inside right bottom\n"
746 "set xlabel \"Clock %1$u\"\n"
747 "set xtics nomirror\n"
748 "set ylabel \"time (s)\"\n"
749 "set ytics nomirror\n"
750 "set x2label \"Clock %1$d (s)\"\n"
751 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"