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",
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");
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("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");
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", inE
, skb
);
511 else if (info
->name
== LTT_EVENT_TCPV4_RCV_EXTENDED
)
516 // Search pendingRecv for an event with the same skb
517 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
518 lttv_trace_get_hook_field(traceHook
, 0));
521 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
524 // This should only happen in case of lost events
525 g_warning("No matching pending receive event found");
529 if (syncState
->stats
)
531 processingData
->stats
->totRecvTCP
++;
534 // If it's there, remove it and proceed with a receive event
535 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
538 inE
->event
.tcpEvent
= malloc(sizeof(TCPEvent
));
539 inE
->copy
= ©TCPEvent
;
540 inE
->destroy
= &destroyTCPEvent
;
541 inE
->event
.tcpEvent
->direction
= IN
;
542 inE
->event
.tcpEvent
->segmentKey
= malloc(sizeof(SegmentKey
));
543 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.saddr
=
544 htonl(ltt_event_get_unsigned(event
,
545 lttv_trace_get_hook_field(traceHook
, 1)));
546 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.daddr
=
547 htonl(ltt_event_get_unsigned(event
,
548 lttv_trace_get_hook_field(traceHook
, 2)));
549 inE
->event
.tcpEvent
->segmentKey
->tot_len
=
550 ltt_event_get_unsigned(event
,
551 lttv_trace_get_hook_field(traceHook
, 3));
552 inE
->event
.tcpEvent
->segmentKey
->ihl
=
553 ltt_event_get_unsigned(event
,
554 lttv_trace_get_hook_field(traceHook
, 4));
555 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.source
=
556 ltt_event_get_unsigned(event
,
557 lttv_trace_get_hook_field(traceHook
, 5));
558 inE
->event
.tcpEvent
->segmentKey
->connectionKey
.dest
=
559 ltt_event_get_unsigned(event
,
560 lttv_trace_get_hook_field(traceHook
, 6));
561 inE
->event
.tcpEvent
->segmentKey
->seq
=
562 ltt_event_get_unsigned(event
,
563 lttv_trace_get_hook_field(traceHook
, 7));
564 inE
->event
.tcpEvent
->segmentKey
->ack_seq
=
565 ltt_event_get_unsigned(event
,
566 lttv_trace_get_hook_field(traceHook
, 8));
567 inE
->event
.tcpEvent
->segmentKey
->doff
=
568 ltt_event_get_unsigned(event
,
569 lttv_trace_get_hook_field(traceHook
, 9));
570 inE
->event
.tcpEvent
->segmentKey
->ack
=
571 ltt_event_get_unsigned(event
,
572 lttv_trace_get_hook_field(traceHook
, 10));
573 inE
->event
.tcpEvent
->segmentKey
->rst
=
574 ltt_event_get_unsigned(event
,
575 lttv_trace_get_hook_field(traceHook
, 11));
576 inE
->event
.tcpEvent
->segmentKey
->syn
=
577 ltt_event_get_unsigned(event
,
578 lttv_trace_get_hook_field(traceHook
, 12));
579 inE
->event
.tcpEvent
->segmentKey
->fin
=
580 ltt_event_get_unsigned(event
,
581 lttv_trace_get_hook_field(traceHook
, 13));
583 syncState
->matchingModule
->matchEvent(syncState
, inE
);
585 g_debug("TCP input event %p for skb %p done", inE
, skb
);
588 else if (info
->name
== LTT_EVENT_UDPV4_RCV_EXTENDED
)
593 // Search pendingRecv for an event with the same skb
594 skb
= (void*) (long) ltt_event_get_long_unsigned(event
,
595 lttv_trace_get_hook_field(traceHook
, 0));
598 g_hash_table_lookup(processingData
->pendingRecv
[traceNum
], skb
);
601 // This should only happen in case of lost events
602 g_warning("No matching pending receive event found");
608 if (syncState
->stats
)
610 processingData
->stats
->totRecvUDP
++;
613 // If it's there, remove it and proceed with a receive event
614 g_hash_table_steal(processingData
->pendingRecv
[traceNum
], skb
);
617 inE
->event
.udpEvent
= malloc(sizeof(UDPEvent
));
618 inE
->copy
= ©UDPEvent
;
619 inE
->destroy
= &destroyUDPEvent
;
620 inE
->event
.udpEvent
->direction
= IN
;
621 inE
->event
.udpEvent
->datagramKey
= malloc(sizeof(DatagramKey
));
622 inE
->event
.udpEvent
->datagramKey
->saddr
=
623 htonl(ltt_event_get_unsigned(event
,
624 lttv_trace_get_hook_field(traceHook
, 1)));
625 inE
->event
.udpEvent
->datagramKey
->daddr
=
626 htonl(ltt_event_get_unsigned(event
,
627 lttv_trace_get_hook_field(traceHook
, 2)));
628 inE
->event
.udpEvent
->unicast
= ltt_event_get_unsigned(event
,
629 lttv_trace_get_hook_field(traceHook
, 3)) == 0 ? false : true;
630 inE
->event
.udpEvent
->datagramKey
->ulen
=
631 ltt_event_get_unsigned(event
,
632 lttv_trace_get_hook_field(traceHook
, 4));
633 inE
->event
.udpEvent
->datagramKey
->source
=
634 ltt_event_get_unsigned(event
,
635 lttv_trace_get_hook_field(traceHook
, 5));
636 inE
->event
.udpEvent
->datagramKey
->dest
=
637 ltt_event_get_unsigned(event
,
638 lttv_trace_get_hook_field(traceHook
, 6));
639 dataStart
= ltt_event_get_long_unsigned(event
,
640 lttv_trace_get_hook_field(traceHook
, 7));
641 g_assert_cmpuint(sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
),
642 ==, sizeof(guint64
));
643 if (inE
->event
.udpEvent
->datagramKey
->ulen
- 8 >=
644 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
))
646 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
647 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
651 memset(inE
->event
.udpEvent
->datagramKey
->dataKey
, 0,
652 sizeof(inE
->event
.udpEvent
->datagramKey
->dataKey
));
653 memcpy(inE
->event
.udpEvent
->datagramKey
->dataKey
, &dataStart
,
654 inE
->event
.udpEvent
->datagramKey
->ulen
- 8);
657 syncState
->matchingModule
->matchEvent(syncState
, inE
);
659 g_debug("UDP input event %p for skb %p done", inE
, skb
);
664 g_assert_not_reached();
672 * Write the processing-specific variables in the gnuplot script.
675 * syncState: container for synchronization data
678 static void writeProcessingGraphVariablesLTTVStandard(SyncState
* const
679 syncState
, const unsigned int i
)
681 ProcessingDataLTTVStandard
* processingData
= syncState
->processingData
;
682 ProcessingGraphsLTTVStandard
* traceI
= &processingData
->graphs
[i
];
684 fprintf(syncState
->graphsStream
, "clock_freq_%u= %.3f\n", i
, (double)
685 traceI
->startFreq
/ traceI
->freqScale
);
690 * Write the processing-specific options in the gnuplot script.
693 * syncState: container for synchronization data
694 * i: first trace number
695 * j: second trace number, garanteed to be larger than i
697 static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState
* const
698 syncState
, const unsigned int i
, const unsigned int j
)
700 ProcessingDataLTTVStandard
* processingData
;
701 ProcessingGraphsLTTVStandard
* traceI
, * traceJ
;
703 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
705 traceI
= &processingData
->graphs
[i
];
706 traceJ
= &processingData
->graphs
[j
];
708 fprintf(syncState
->graphsStream
,
709 "set key inside right bottom\n"
710 "set xlabel \"Clock %1$u\"\n"
711 "set xtics nomirror\n"
712 "set ylabel \"Clock %2$u\"\n"
713 "set ytics nomirror\n"
714 "set x2label \"Clock %1$d (s)\"\n"
715 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"
717 "set y2label \"Clock %2$d (s)\"\n"
718 "set y2range [GPVAL_Y_MIN / clock_freq_%2$u : GPVAL_Y_MAX / clock_freq_%2$u]\n"
719 "set y2tics\n", i
, j
);
724 * Write the processing-specific options in the gnuplot script.
727 * syncState: container for synchronization data
728 * i: first trace number
729 * j: second trace number, garanteed to be larger than i
731 static void writeProcessingTraceTimeOptionsLTTVStandard(SyncState
* const
732 syncState
, const unsigned int i
, const unsigned int j
)
734 ProcessingDataLTTVStandard
* processingData
;
735 ProcessingGraphsLTTVStandard
* traceI
, * traceJ
;
737 processingData
= (ProcessingDataLTTVStandard
*) syncState
->processingData
;
739 traceI
= &processingData
->graphs
[i
];
740 traceJ
= &processingData
->graphs
[j
];
742 fprintf(syncState
->graphsStream
,
743 "set key inside right bottom\n"
744 "set xlabel \"Clock %1$u\"\n"
745 "set xtics nomirror\n"
746 "set ylabel \"time (s)\"\n"
747 "set ytics nomirror\n"
748 "set x2label \"Clock %1$d (s)\"\n"
749 "set x2range [GPVAL_X_MIN / clock_freq_%1$u : GPVAL_X_MAX / clock_freq_%1$u]\n"