| 1 | /* This file is part of the Linux Trace Toolkit viewer |
| 2 | * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca> |
| 3 | * |
| 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; |
| 7 | * |
| 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. |
| 12 | * |
| 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, |
| 16 | * MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef EVENT_ANALYSIS_EVAL_H |
| 20 | #define EVENT_ANALYSIS_EVAL_H |
| 21 | |
| 22 | #include <glib.h> |
| 23 | |
| 24 | #include "data_structures.h" |
| 25 | |
| 26 | |
| 27 | struct RttKey |
| 28 | { |
| 29 | uint32_t saddr, daddr; |
| 30 | }; |
| 31 | |
| 32 | typedef struct |
| 33 | { |
| 34 | unsigned int inversionNb, |
| 35 | tooFastNb, |
| 36 | noRTTInfoNb, |
| 37 | total; |
| 38 | } MessageStats; |
| 39 | |
| 40 | typedef struct |
| 41 | { |
| 42 | double broadcastDiffSum; |
| 43 | unsigned int broadcastNb; |
| 44 | |
| 45 | // MessageStats messageStats[traceNb][traceNb] |
| 46 | MessageStats** messageStats; |
| 47 | |
| 48 | /* double* exchangeRtt[RttKey] |
| 49 | * For this table, saddr and daddr are swapped as necessary such that |
| 50 | * saddr < daddr */ |
| 51 | GHashTable* exchangeRtt; |
| 52 | } AnalysisStatsEval; |
| 53 | |
| 54 | |
| 55 | #define BIN_NB 1001 |
| 56 | struct Bins |
| 57 | { |
| 58 | // index of min and max bins that are != 0 |
| 59 | uint32_t min, max; |
| 60 | // sum of all bins |
| 61 | uint32_t total; |
| 62 | /* bin[0]: underflow ]-INFINITY..0[ |
| 63 | * bin[1]: [0..1e-6[ |
| 64 | * rest defined exponentially, see binStart() |
| 65 | * bin[BIN_NB - 1]: overflow [1..INFINITY[ */ |
| 66 | uint32_t bin[BIN_NB]; |
| 67 | }; |
| 68 | |
| 69 | |
| 70 | typedef struct |
| 71 | { |
| 72 | /* File pointers to files where "trip times" (message latency) histogram |
| 73 | * values are output. Each host-pair has two files, one for each message |
| 74 | * direction. As for traces, the host with the smallest address is |
| 75 | * considered to be the reference for the direction of messages (ie. |
| 76 | * messages from the host with the lowest address to the host with the |
| 77 | * largest address are "sent"). */ |
| 78 | FILE* ttSendPoints; |
| 79 | FILE* ttRecvPoints; |
| 80 | |
| 81 | struct Bins ttSendBins; |
| 82 | struct Bins ttRecvBins; |
| 83 | |
| 84 | /* File pointers to files where half round trip times (evaluated from |
| 85 | * exchanges) histogram values are output. */ |
| 86 | FILE* hrttPoints; |
| 87 | |
| 88 | struct Bins hrttBins; |
| 89 | } AnalysisGraphEval; |
| 90 | |
| 91 | typedef struct |
| 92 | { |
| 93 | // double* rttInfo[RttKey] |
| 94 | GHashTable* rttInfo; |
| 95 | |
| 96 | AnalysisStatsEval* stats; |
| 97 | /* AnalysisGraphsEval* graphs[RttKey]; |
| 98 | * For this table, saddr and daddr are swapped as necessary such that |
| 99 | * saddr < daddr */ |
| 100 | GHashTable* graphs; |
| 101 | } AnalysisDataEval; |
| 102 | |
| 103 | #endif |