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"
38 // Functions common to all processing modules
39 static void initProcessingLTTVStandard(SyncState
* const syncState
,
40 LttvTracesetContext
* const traceSetContext
);
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: set of LTTV traces
96 static void initProcessingLTTVStandard(SyncState
* const syncState
, LttvTracesetContext
*
97 const traceSetContext
)
100 ProcessingDataLTTVStandard
* processingData
;
102 processingData
= malloc(sizeof(ProcessingDataLTTVStandard
));
103 syncState
->processingData
= processingData
;
104 processingData
->traceSetContext
= traceSetContext
;
106 if (syncState
->stats
)
108 processingData
->stats
= calloc(1, sizeof(ProcessingStatsLTTVStandard
));
112 processingData
->stats
= NULL
;
115 processingData
->traceNumTable
= g_hash_table_new(&g_direct_hash
, NULL
);
116 processingData
->hookListList
= g_array_sized_new(FALSE
, FALSE
,
117 sizeof(GArray
*), syncState
->traceNb
);
118 processingData
->pendingRecv
= malloc(sizeof(GHashTable
*) *
121 for(i
= 0; i
< syncState
->traceNb
; i
++)
123 g_hash_table_insert(processingData
->traceNumTable
,
124 processingData
->traceSetContext
->traces
[i
]->t
, (gpointer
) i
);
127 if (syncState
->graphsStream
)
129 processingData
->graphs
= malloc(syncState
->traceNb
*
130 sizeof(ProcessingGraphsLTTVStandard
));
132 for(i
= 0; i
< syncState
->traceNb
; i
++)
134 LttTrace
* traceI
= traceSetContext
->traces
[i
]->t
;
136 processingData
->graphs
[i
].startFreq
= traceI
->start_freq
;
137 processingData
->graphs
[i
].freqScale
= traceI
->freq_scale
;
142 processingData
->graphs
= NULL
;
145 for(i
= 0; i
< syncState
->traceNb
; i
++)
147 processingData
->pendingRecv
[i
]= g_hash_table_new_full(&g_direct_hash
,
148 NULL
, NULL
, &gdnDestroyEvent
);
151 registerHooks(processingData
->hookListList
, traceSetContext
,
152 &processEventLTTVStandard
, syncState
,
153 syncState
->matchingModule
->canMatch
);
158 * Call the partial processing destroyer, obtain and adjust the factors from
162 * syncState container for synchronization data.
164 static void finalizeProcessingLTTVStandard(SyncState
* const syncState
)
168 double minOffset
, minDrift
;
169 unsigned int refFreqTrace
;
170 ProcessingDataLTTVStandard
* processingData
;
172 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
174 partialDestroyProcessingLTTVStandard(syncState
);
176 factors
= syncState
->matchingModule
->finalizeMatching(syncState
);
178 /* The offsets are adjusted so the lowest one is 0. This is done because
179 * of a Lttv specific limitation: events cannot have negative times. By
180 * having non-negative offsets, events cannot be moved backwards to
184 for (i
= 0; i
< syncState
->traceNb
; i
++)
186 minOffset
= MIN(g_array_index(factors
, Factors
, i
).offset
, minOffset
);
189 for (i
= 0; i
< syncState
->traceNb
; i
++)
191 g_array_index(factors
, Factors
, i
).offset
-= minOffset
;
194 /* Because the timestamps are corrected at the TSC level (not at the
195 * LttTime level) all trace frequencies must be made equal. We choose to
196 * use the frequency of the system with the lowest drift
200 for (i
= 0; i
< syncState
->traceNb
; i
++)
202 if (g_array_index(factors
, Factors
, i
).drift
< minDrift
)
204 minDrift
= g_array_index(factors
, Factors
, i
).drift
;
208 g_assert(syncState
->traceNb
== 0 || minDrift
!= INFINITY
);
210 // Write the factors to the LttTrace structures
211 for (i
= 0; i
< syncState
->traceNb
; i
++)
214 Factors
* traceFactors
;
216 t
= processingData
->traceSetContext
->traces
[i
]->t
;
217 traceFactors
= &g_array_index(factors
, Factors
, i
);
219 t
->drift
= traceFactors
->drift
;
220 t
->offset
= traceFactors
->offset
;
222 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->start_freq
;
224 processingData
->traceSetContext
->traces
[refFreqTrace
]->t
->freq_scale
;
225 t
->start_time_from_tsc
=
226 ltt_time_from_uint64(tsc_to_uint64(t
->freq_scale
, t
->start_freq
,
227 t
->drift
* t
->start_tsc
+ t
->offset
));
230 g_array_free(factors
, TRUE
);
232 lttv_traceset_context_compute_time_span(processingData
->traceSetContext
,
233 &processingData
->traceSetContext
->time_span
);
235 g_debug("traceset start %ld.%09ld end %ld.%09ld\n",
236 processingData
->traceSetContext
->time_span
.start_time
.tv_sec
,
237 processingData
->traceSetContext
->time_span
.start_time
.tv_nsec
,
238 processingData
->traceSetContext
->time_span
.end_time
.tv_sec
,
239 processingData
->traceSetContext
->time_span
.end_time
.tv_nsec
);
244 * Print statistics related to processing Must be called after
245 * finalizeProcessing.
248 * syncState container for synchronization data.
250 static void printProcessingStatsLTTVStandard(SyncState
* const syncState
)
252 ProcessingDataLTTVStandard
* processingData
;
254 if (!syncState
->stats
)
259 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
261 printf("LTTV processing stats:\n");
262 printf("\treceived frames: %d\n", processingData
->stats
->totRecv
);
263 printf("\treceived frames that are IP: %d\n",
264 processingData
->stats
->totRecvIp
);
265 if (syncState
->matchingModule
->canMatch
[TCP
])
267 printf("\treceived and processed packets that are TCP: %d\n",
268 processingData
->stats
->totRecvTCP
);
270 if (syncState
->matchingModule
->canMatch
[UDP
])
272 printf("\treceived and processed packets that are UDP: %d\n",
273 processingData
->stats
->totRecvUDP
);
275 if (syncState
->matchingModule
->canMatch
[TCP
])
277 printf("\tsent packets that are TCP: %d\n",
278 processingData
->stats
->totOutE
);
284 * Unregister event hooks. Deallocate processingData.
287 * syncState: container for synchronization data.
288 * This function deallocates these processingData members:
291 static void destroyProcessingLTTVStandard(SyncState
* const syncState
)
293 ProcessingDataLTTVStandard
* processingData
;
295 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
297 if (processingData
== NULL
)
302 partialDestroyProcessingLTTVStandard(syncState
);
304 if (syncState
->stats
)
306 free(processingData
->stats
);
309 if (syncState
->graphsStream
)
311 free(processingData
->graphs
);
314 free(syncState
->processingData
);
315 syncState
->processingData
= NULL
;
320 * Unregister event hooks. Deallocate some of processingData.
322 * This function can be called right after the events have been processed to
323 * free some data structures that are not needed for finalization.
326 * syncState: container for synchronization data.
327 * This function deallocates these members:
332 static void partialDestroyProcessingLTTVStandard(SyncState
* const syncState
)
335 ProcessingDataLTTVStandard
* processingData
;
337 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
339 if (processingData
== NULL
|| processingData
->traceNumTable
== NULL
)
344 g_hash_table_destroy(processingData
->traceNumTable
);
345 processingData
->traceNumTable
= NULL
;
347 for(i
= 0; i
< syncState
->traceNb
; i
++)
350 g_debug("Cleaning up pendingRecv list\n");
351 g_hash_table_destroy(processingData
->pendingRecv
[i
]);
353 free(processingData
->pendingRecv
);
355 unregisterHooks(processingData
->hookListList
,
356 processingData
->traceSetContext
);
361 * Lttv hook function that will be called for network events
364 * hookData: LttvTraceHook* for the type of event that generated the call
365 * callData: LttvTracefileContext* at the moment of the event
368 * FALSE Always returns FALSE, meaning to keep processing hooks for
371 static gboolean
processEventLTTVStandard(void* hookData
, void* callData
)
373 LttvTraceHook
* traceHook
;
374 LttvTracefileContext
* tfc
;
380 unsigned long traceNum
;
381 struct marker_info
* info
;
382 SyncState
* syncState
;
383 ProcessingDataLTTVStandard
* processingData
;
385 traceHook
= (LttvTraceHook
*) hookData
;
386 tfc
= (LttvTracefileContext
*) callData
;
387 trace
= tfc
->t_context
->t
;
388 syncState
= (SyncState
*) traceHook
->hook_data
;
389 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
390 event
= ltt_tracefile_get_event(tfc
->tf
);
391 info
= marker_get_info_from_id(tfc
->tf
->mdata
, event
->event_id
);
392 tsc
= ltt_event_cycle_count(event
);
393 time
= ltt_event_time(event
);
394 wTime
.seconds
= time
.tv_sec
;
395 wTime
.nanosec
= time
.tv_nsec
;
397 g_assert(g_hash_table_lookup_extended(processingData
->traceNumTable
,
398 trace
, NULL
, (gpointer
*) &traceNum
));
400 g_debug("XXXX process event: time: %ld.%09ld trace: %ld (%p) name: %s ",
401 time
.tv_sec
, time
.tv_nsec
, traceNum
, trace
,
402 g_quark_to_string(info
->name
));
404 if (info
->name
== LTT_EVENT_DEV_XMIT_EXTENDED
)
408 if (!ltt_event_get_unsigned(event
,
409 lttv_trace_get_hook_field(traceHook
, 1)) == ETH_P_IP
||
410 !ltt_event_get_unsigned(event
,
411 lttv_trace_get_hook_field(traceHook
, 2)) == IPPROTO_TCP
)
416 if (!syncState
->matchingModule
->canMatch
[TCP
])
421 if (syncState
->stats
)
423 processingData
->stats
->totOutE
++;
426 outE
= malloc(sizeof(Event
));
427 outE
->traceNum
= traceNum
;
429 outE
->wallTime
= wTime
;
431 outE
->copy
= ©TCPEvent
;
432 outE
->destroy
= &destroyTCPEvent
;
433 outE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
434 outE
->event
.tcpEvent
->direction
= OUT
;
435 outE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
436 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
437 htonl(ltt_event_get_unsigned(event
,
438 lttv_trace_get_hook_field(traceHook
, 3)));
439 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
440 htonl(ltt_event_get_unsigned(event
,
441 lttv_trace_get_hook_field(traceHook
, 4)));
442 outE
->event
.tcpEvent
->segmentKey
->tot_len
=
443 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
445 outE
->event
.tcpEvent
->segmentKey
->ihl
= ltt_event_get_unsigned(event
,
446 lttv_trace_get_hook_field(traceHook
, 6));
447 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
448 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
450 outE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
451 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
453 outE
->event
.tcpEvent
->segmentKey
->seq
= ltt_event_get_unsigned(event
,
454 lttv_trace_get_hook_field(traceHook
, 9));
455 outE
->event
.tcpEvent
->segmentKey
->ack_seq
=
456 ltt_event_get_unsigned(event
, lttv_trace_get_hook_field(traceHook
,
458 outE
->event
.tcpEvent
->segmentKey
->doff
= ltt_event_get_unsigned(event
,
459 lttv_trace_get_hook_field(traceHook
, 11));
460 outE
->event
.tcpEvent
->segmentKey
->ack
= ltt_event_get_unsigned(event
,
461 lttv_trace_get_hook_field(traceHook
, 12));
462 outE
->event
.tcpEvent
->segmentKey
->rst
= ltt_event_get_unsigned(event
,
463 lttv_trace_get_hook_field(traceHook
, 13));
464 outE
->event
.tcpEvent
->segmentKey
->syn
= ltt_event_get_unsigned(event
,
465 lttv_trace_get_hook_field(traceHook
, 14));
466 outE
->event
.tcpEvent
->segmentKey
->fin
= ltt_event_get_unsigned(event
,
467 lttv_trace_get_hook_field(traceHook
, 15));
469 syncState
->matchingModule
->matchEvent(syncState
, outE
);
471 g_debug("Output event done\n");
473 else if (info
->name
== LTT_EVENT_DEV_RECEIVE
)
477 if (syncState
->stats
)
479 processingData
->stats
->totRecv
++;
482 protocol
= ltt_event_get_unsigned(event
,
483 lttv_trace_get_hook_field(traceHook
, 1));
485 if (protocol
== ETH_P_IP
)
490 if (syncState
->stats
)
492 processingData
->stats
->totRecvIp
++;
495 inE
= malloc(sizeof(Event
));
496 inE
->traceNum
= traceNum
;
498 inE
->wallTime
= wTime
;
499 inE
->event
.tcpEvent
= NULL
;
500 inE
->copy
= ©Event
;
501 inE
->destroy
= &destroyEvent
;
503 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
504 lttv_trace_get_hook_field(traceHook
, 0));
505 g_hash_table_replace(processingData
->pendingRecv
[traceNum
], skb
,
508 g_debug("Adding inE %p for skb %p to pendingRecv\n", inE
, skb
);
515 else if (info
->name
== LTT_EVENT_TCPV4_RCV_EXTENDED
)
520 // Search pendingRecv for an event with the same skb
521 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
522 lttv_trace_get_hook_field(traceHook
, 0));
525 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
528 // This should only happen in case of lost events
529 g_warning("No matching pending receive event found");
533 if (syncState
->stats
)
535 processingData
->stats
->totRecvTCP
++;
538 // If it's there, remove it and proceed with a receive event
539 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
542 inE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
543 inE
->copy
= ©TCPEvent
;
544 inE
->destroy
= &destroyTCPEvent
;
545 inE
->event
.tcpEvent
->direction
= IN
;
546 inE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
547 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
548 htonl(ltt_event_get_unsigned(event
,
549 lttv_trace_get_hook_field(traceHook
, 1)));
550 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
551 htonl(ltt_event_get_unsigned(event
,
552 lttv_trace_get_hook_field(traceHook
, 2)));
553 inE
->event
.tcpEvent
->segmentKey
->tot_len
=
554 ltt_event_get_unsigned(event
,
555 lttv_trace_get_hook_field(traceHook
, 3));
556 inE
->event
.tcpEvent
->segmentKey
->ihl
=
557 ltt_event_get_unsigned(event
,
558 lttv_trace_get_hook_field(traceHook
, 4));
559 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
560 ltt_event_get_unsigned(event
,
561 lttv_trace_get_hook_field(traceHook
, 5));
562 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
563 ltt_event_get_unsigned(event
,
564 lttv_trace_get_hook_field(traceHook
, 6));
565 inE
->event
.tcpEvent
->segmentKey
->seq
=
566 ltt_event_get_unsigned(event
,
567 lttv_trace_get_hook_field(traceHook
, 7));
568 inE
->event
.tcpEvent
->segmentKey
->ack_seq
=
569 ltt_event_get_unsigned(event
,
570 lttv_trace_get_hook_field(traceHook
, 8));
571 inE
->event
.tcpEvent
->segmentKey
->doff
=
572 ltt_event_get_unsigned(event
,
573 lttv_trace_get_hook_field(traceHook
, 9));
574 inE
->event
.tcpEvent
->segmentKey
->ack
=
575 ltt_event_get_unsigned(event
,
576 lttv_trace_get_hook_field(traceHook
, 10));
577 inE
->event
.tcpEvent
->segmentKey
->rst
=
578 ltt_event_get_unsigned(event
,
579 lttv_trace_get_hook_field(traceHook
, 11));
580 inE
->event
.tcpEvent
->segmentKey
->syn
=
581 ltt_event_get_unsigned(event
,
582 lttv_trace_get_hook_field(traceHook
, 12));
583 inE
->event
.tcpEvent
->segmentKey
->fin
=
584 ltt_event_get_unsigned(event
,
585 lttv_trace_get_hook_field(traceHook
, 13));
587 syncState
->matchingModule
->matchEvent(syncState
, inE
);
589 g_debug("TCP input event %p for skb %p done\n", inE
, skb
);
592 else if (info
->name
== LTT_EVENT_UDPV4_RCV_EXTENDED
)
597 // Search pendingRecv for an event with the same skb
598 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
599 lttv_trace_get_hook_field(traceHook
, 0));
602 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
605 // This should only happen in case of lost events
606 g_warning("No matching pending receive event found");
612 if (syncState
->stats
)
614 processingData
->stats
->totRecvUDP
++;
617 // If it's there, remove it and proceed with a receive event
618 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
621 inE
->event
.udpEvent
= malloc(sizeof(UDPEvent
));
622 inE
->copy
= ©UDPEvent
;
623 inE
->destroy
= &destroyUDPEvent
;
624 inE
->event
.udpEvent
->direction
= IN
;
625 inE
->event
.udpEvent
->datagramKey
= malloc(sizeof(DatagramKey
));
626 inE
->event
.udpEvent
->datagramKey
->saddr
=
627 htonl(ltt_event_get_unsigned(event
,
628 lttv_trace_get_hook_field(traceHook
, 1)));
629 inE
->event
.udpEvent
->datagramKey
->daddr
=
630 htonl(ltt_event_get_unsigned(event
,
631 lttv_trace_get_hook_field(traceHook
, 2)));
632 inE
->event
.udpEvent
->unicast
= ltt_event_get_unsigned(event
,
633 lttv_trace_get_hook_field(traceHook
, 3)) == 0 ? false : true;
634 inE
->event
.udpEvent
->datagramKey
->ulen
=
635 ltt_event_get_unsigned(event
,
636 lttv_trace_get_hook_field(traceHook
, 4));
637 inE
->event
.udpEvent
->datagramKey
->source
=
638 ltt_event_get_unsigned(event
,
639 lttv_trace_get_hook_field(traceHook
, 5));
640 inE
->event
.udpEvent
->datagramKey
->dest
=
641 ltt_event_get_unsigned(event
,
642 lttv_trace_get_hook_field(traceHook
, 6));
643 dataStart
= ltt_event_get_long_unsigned(event
,
644 lttv_trace_get_hook_field(traceHook
, 7));
645 g_assert_cmpuint(sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
),
646 ==, sizeof(guint64
));
647 if (inE
->event
.udpEvent
->datagramKey
->ulen
- 8 >=
648 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
))
650 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
651 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
655 memset(inE
->event
.udpEvent
->datagramKey
->dataKey
, 0,
656 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
657 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
658 inE
->event
.udpEvent
->datagramKey
->ulen
- 8);
661 syncState
->matchingModule
->matchEvent(syncState
, inE
);
663 g_debug("UDP input event %p for skb %p done\n", inE
, skb
);
668 g_assert_not_reached();
676 * Write the processing-specific variables in the gnuplot script.
679 * syncState: container for synchronization data
682 static void writeProcessingGraphVariablesLTTVStandard(SyncState
* const
683 syncState
, const unsigned int i
)
685 ProcessingDataLTTVStandard
* processingData
= syncState
->processingData
;
686 ProcessingGraphsLTTVStandard
* traceI
= &processingData
->graphs
[i
];
688 fprintf(syncState
->graphsStream
, "clock_freq_%u= %.3f\n", i
, (double)
689 traceI
->startFreq
/ traceI
->freqScale
);
694 * Write the processing-specific options in the gnuplot script.
697 * syncState: container for synchronization data
698 * i: first trace number
699 * j: second trace number, garanteed to be larger than i
701 static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState
* const
702 syncState
, const unsigned int i
, const unsigned int j
)
704 ProcessingDataLTTVStandard
* processingData
;
705 ProcessingGraphsLTTVStandard
* traceI
, * traceJ
;
707 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
709 traceI
= &processingData
->graphs
[i
];
710 traceJ
= &processingData
->graphs
[j
];
712 fprintf(syncState
->graphsStream
,
713 "set key inside right bottom\n"
714 "set xlabel \"Clock %1$u\"\n"
715 "set xtics nomirror\n"
716 "set ylabel \"Clock %2$u\"\n"
717 "set ytics nomirror\n"
718 "set x2label \"Clock %1$d (s)\"\n"
719 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"
721 "set y2label \"Clock %2$d (s)\"\n"
722 "set y2range [GPVAL_Y_MIN / clock_freq_%2$u : GPVAL_Y_MAX / clock_freq_%2$u]\n"
723 "set y2tics\n", i
, j
);
728 * Write the processing-specific options in the gnuplot script.
731 * syncState: container for synchronization data
732 * i: first trace number
733 * j: second trace number, garanteed to be larger than i
735 static void writeProcessingTraceTimeOptionsLTTVStandard(SyncState
* const
736 syncState
, const unsigned int i
, const unsigned int j
)
738 ProcessingDataLTTVStandard
* processingData
;
739 ProcessingGraphsLTTVStandard
* traceI
, * traceJ
;
741 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
743 traceI
= &processingData
->graphs
[i
];
744 traceJ
= &processingData
->graphs
[j
];
746 fprintf(syncState
->graphsStream
,
747 "set key inside right bottom\n"
748 "set xlabel \"Clock %1$u\"\n"
749 "set xtics nomirror\n"
750 "set ylabel \"time (s)\"\n"
751 "set ytics nomirror\n"
752 "set x2label \"Clock %1$d (s)\"\n"
753 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"