diff options
Diffstat (limited to 'include/Reporter.h')
-rw-r--r-- | include/Reporter.h | 137 |
1 files changed, 83 insertions, 54 deletions
diff --git a/include/Reporter.h b/include/Reporter.h index 6f97418..bb7ec6f 100644 --- a/include/Reporter.h +++ b/include/Reporter.h @@ -58,6 +58,7 @@ #include "histogram.h" #include "packet_ring.h" #include "gettcpinfo.h" +#include "payloads.h" // forward declarations found in Settings.hpp struct thread_Settings; @@ -108,10 +109,24 @@ struct MeanMinMaxStats { intmax_t err; }; +struct ShiftIntCounter { + intmax_t current; + intmax_t prev; +}; + +struct ShiftUintCounter { + uintmax_t current; + uintmax_t prev; +}; + #define TCPREADBINCOUNT 8 struct ReadStats { - intmax_t cntRead; - intmax_t totcntRead; + uintmax_t cntRead; + uintmax_t cntReadTimeo; + uintmax_t cntReadErrLen; + struct ShiftUintCounter ReadCnt; + struct ShiftUintCounter ReadTimeoCnt; + struct ShiftUintCounter ReadErrLenCnt; int bins[TCPREADBINCOUNT]; int totbins[TCPREADBINCOUNT]; int binsize; @@ -120,9 +135,10 @@ struct ReadStats { struct WriteStats { intmax_t WriteCnt; intmax_t WriteErr; + intmax_t WriteTimeo; intmax_t totWriteCnt; intmax_t totWriteErr; - intmax_t totWriteWarn; + intmax_t totWriteTimeo; struct iperf_tcpstats tcpstats; }; @@ -134,13 +150,6 @@ struct WriteStats { #define L2LENERR 0x02 #define L2CSUMERR 0x04 -enum WriteErrType { - WriteNoErr = 0, - WriteErrAccount, - WriteErrFatal, - WriteErrNoAccount -}; - struct L2Stats { intmax_t cnt; intmax_t unknown; @@ -165,7 +174,8 @@ enum ReportType { SUM_REPORT, SETTINGS_REPORT, CONNECTION_REPORT, - SERVER_RELAY_REPORT + SERVER_RELAY_REPORT, + STRING_REPORT }; enum ReportSubType { @@ -174,6 +184,11 @@ enum ReportSubType { TOTALSUM_REPORT }; +enum TansferIDType { + REVERSED = 1, + NORMAL +}; + union SendReadStats { struct ReadStats read; struct WriteStats write; @@ -186,10 +201,12 @@ struct ReportCommon { enum ThreadMode ThreadMode; enum ReportMode ReportMode; bool KeyCheck; + bool Omit; int flags; int flags_extend; int flags_extend2; int threads; + int working_load_threads; unsigned short Port; unsigned short PortLast; unsigned short BindPort; @@ -212,6 +229,7 @@ struct ReportCommon { #endif int winsize_requested; unsigned int FQPacingRate; + int FQPacingRateStep; int HistBins; int HistBinsize; int HistUnits; @@ -220,6 +238,8 @@ struct ReportCommon { Socklen_t size_peer; iperf_sockaddr local; Socklen_t size_local; + iperf_sockaddr multicast_group; + Socklen_t size_multicast_group; char* Host; // -c char* HideHost; char* Localhost; // -B @@ -227,13 +247,16 @@ struct ReportCommon { char* Ifrnametx; char* SSMMulticastStr; char* Congestion; + char* LoadCCA; char* transferIDStr; char* PermitKey; int transferID; + int peertransferID; double rtt_weight; double ListenerTimeout; double FPS; int bbsize; + int bbreplysize; int bbhold; int bbcount; int jitter_binwidth; @@ -256,16 +279,7 @@ struct ConnectionInfo { char peerversion[PEERVERBUFSIZE]; struct MeanMinMaxStats connect_times; struct iperf_tcpstats tcpinitstats; -}; - -struct ShiftIntCounter { - intmax_t current; - intmax_t prev; -}; - -struct ShiftUintCounter { - uintmax_t current; - uintmax_t prev; + char connected_cca[TCP_CCA_NAME_MAX]; }; struct ShiftCounters { @@ -323,6 +337,7 @@ struct ReportTimeStamps { struct timeval packetTime; struct timeval prevpacketTime; struct timeval prevsendTime; + struct timeval prevTime; struct timeval nextTime; struct timeval intervalTime; struct timeval IPGstart; @@ -333,8 +348,13 @@ struct TransferInfo { struct ReportCommon *common; struct ReportTimeStamps ts; void (*output_handler) (struct TransferInfo *stats); + struct SumReport *sumreport; + enum ReportType type; + enum edgeLevel uplevel; + enum edgeLevel downlevel; int groupID; - int threadcnt; + int slot_thread_upcount; // increments on a thread's first sample into a report interval + int slot_thread_downcount; // increments on a thread's interval sum output bool isMaskOutput; uintmax_t cntBytes; intmax_t cntError; @@ -354,10 +374,13 @@ struct TransferInfo { struct histogram *framelatency_histogram; struct RunningMMMStats frame; // isochronous frame or msg burst struct histogram *bbrtt_histogram; + struct histogram *bbowdto_histogram; + struct histogram *bbowdfro_histogram; struct RunningMMMStats bbrtt; struct RunningMMMStats bbowdto; struct RunningMMMStats bbowdfro; struct RunningMMMStats bbasym; + uintmax_t bb_clocksync_error; struct MeanMinMaxStats schedule_error; struct L2Stats l2counts; // Packet and frame state info @@ -375,16 +398,18 @@ struct TransferInfo { double fInP; double iInPVar; double fInPVar; + intmax_t FQPacingRateCurrent; + int threadcnt_final; }; struct SumReport { struct ReferenceMutex reference; int threads; - int threads_cntr_fsum; + int final_thread_upcount; struct TransferInfo info; - void (*transfer_protocol_sum_handler) (struct TransferInfo *stats, int final); + void (*transfer_protocol_sum_handler) (struct TransferInfo *stats, bool final); struct BarrierMutex fullduplex_barrier; - int sum_fd_set; + bool sum_fd_set; bool sum_reverse_set; }; @@ -392,8 +417,8 @@ struct ReporterData { // function pointer for per packet processing void (*packet_handler_pre_report) (struct ReporterData *data, struct ReportStruct *packet); void (*packet_handler_post_report) (struct ReporterData *data, struct ReportStruct *packet); - void (*transfer_protocol_handler) (struct ReporterData *data, int final); - int (*transfer_interval_handler) (struct ReporterData *data, struct ReportStruct *packet); + void (*transfer_protocol_handler) (struct ReporterData *data, bool final); + bool (*transfer_interval_handler) (struct ReporterData *data, struct ReportStruct *packet); struct PacketRing *packetring; int reporter_thread_suspends; // used to detect CPU bound systems @@ -425,15 +450,16 @@ typedef void (* report_statistics)( struct TransferInfo* ); typedef void (* report_serverstatistics)( struct ConnectionInfo *, struct TransferInfo* ); void SetSumHandlers (struct thread_Settings *inSettings, struct SumReport* sumreport); -struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, int fullduplex); +struct SumReport* InitSumReport(struct thread_Settings *inSettings, int inID, bool fullduplex); struct ReportHeader* InitIndividualReport(struct thread_Settings *inSettings); struct ReportHeader* InitConnectionReport(struct thread_Settings *inSettings); struct ConnectionInfo* InitConnectOnlyReport(struct thread_Settings *thread); struct ReportHeader *InitSettingsReport(struct thread_Settings *inSettings); struct ReportHeader* InitServerRelayUDPReport(struct thread_Settings *inSettings, struct server_hdr *server); +struct ReportHeader* InitStringReport (char *textoutput); void PostReport(struct ReportHeader *reporthdr); bool ReportPacket (struct ReporterData* data, struct ReportStruct *packet); -int EndJob(struct ReportHeader *reporthdr, struct ReportStruct *packet); +bool EndJob(struct ReportHeader *reporthdr, struct ReportStruct *packet); void FreeReport(struct ReportHeader *reporthdr); void FreeSumReport (struct SumReport *sumreport); void FreeConnectionReport(struct ConnectionInfo *reporthdr); @@ -469,34 +495,34 @@ void reporter_handle_packet_bb_server(struct ReporterData *data, struct ReportSt // Invoked from the Reporter thread per function vector this_ireport->transfer_interval_handler // This is set during Report instantiation (found in Reports.c) // These conditionally, e.g per a sample interval, invoke the transfer protocol handlers -int reporter_condprint_time_interval_report(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_frame_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_frame_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_frame_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_frame_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_burst_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_burst_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_burst_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet); -int reporter_condprint_burst_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_time_interval_report(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_frame_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_frame_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_frame_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_frame_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_burst_interval_report_client_udp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_burst_interval_report_server_udp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_burst_interval_report_server_tcp(struct ReporterData *data, struct ReportStruct *packet); +bool reporter_condprint_burst_interval_report_client_tcp(struct ReporterData *data, struct ReportStruct *packet); // Each report type needs specialized updating prior to printing its report // These functions realize that updating. They are called by the transfer protocol handler, // e.g. (*data->transfer_protocol_handler)(data, 0) found in src/Reporter.c // These update the TransferInfo stats struct which is used during output (e.g. the output handler) -void reporter_transfer_protocol_null(struct ReporterData *data, int final); -void reporter_transfer_protocol_client_tcp(struct ReporterData *data, int final); -void reporter_transfer_protocol_client_bb_tcp(struct ReporterData *data, int final); -void reporter_transfer_protocol_client_udp(struct ReporterData *data, int final); -void reporter_transfer_protocol_server_tcp(struct ReporterData *data, int final); -void reporter_transfer_protocol_server_bb_tcp(struct ReporterData *data, int final); -void reporter_transfer_protocol_server_udp(struct ReporterData *data, int final); +void reporter_transfer_protocol_null(struct ReporterData *data, bool final); +void reporter_transfer_protocol_client_tcp(struct ReporterData *data, bool final); +void reporter_transfer_protocol_client_bb_tcp(struct ReporterData *data, bool final); +void reporter_transfer_protocol_client_udp(struct ReporterData *data, bool final); +void reporter_transfer_protocol_server_tcp(struct ReporterData *data, bool final); +void reporter_transfer_protocol_server_bb_tcp(struct ReporterData *data, bool final); +void reporter_transfer_protocol_server_udp(struct ReporterData *data, bool final); // Function vectors to suppport sum reports -void reporter_transfer_protocol_sum_client_tcp(struct TransferInfo *stats, int final); -void reporter_transfer_protocol_sum_server_tcp(struct TransferInfo *stats, int final); -void reporter_transfer_protocol_sum_client_udp(struct TransferInfo *stats, int final); -void reporter_transfer_protocol_sum_server_udp(struct TransferInfo *stats, int final); -void reporter_transfer_protocol_fullduplex_tcp(struct TransferInfo *stats, int final); -void reporter_transfer_protocol_fullduplex_udp(struct TransferInfo *stats, int final); +void reporter_transfer_protocol_sum_client_tcp(struct TransferInfo *stats, bool final); +void reporter_transfer_protocol_sum_server_tcp(struct TransferInfo *stats, bool final); +void reporter_transfer_protocol_sum_client_udp(struct TransferInfo *stats, bool final); +void reporter_transfer_protocol_sum_server_udp(struct TransferInfo *stats, bool final); +void reporter_transfer_protocol_fullduplex_tcp(struct TransferInfo *stats, bool final); +void reporter_transfer_protocol_fullduplex_udp(struct TransferInfo *stats, bool final); // Report output print routines invoked by the transfer_protocol handler // Bound in Report instantiation and invoked by the transfer protocol @@ -520,6 +546,7 @@ void tcp_output_burst_write(struct TransferInfo *stats); void tcp_output_sum_write(struct TransferInfo *stats); void tcp_output_sumcnt_write(struct TransferInfo *stats); void tcp_output_write_enhanced (struct TransferInfo *stats); +void tcp_output_write_enhanced_fq (struct TransferInfo *stats); void tcp_output_write_enhanced_isoch (struct TransferInfo *stats); void tcp_output_sum_write_enhanced (struct TransferInfo *stats); void tcp_output_sumcnt_write_enhanced (struct TransferInfo *stats); @@ -559,6 +586,7 @@ void udp_output_enhanced_csv(struct TransferInfo *stats); void tcp_output_basic_csv(struct TransferInfo *stats); void tcp_output_read_enhanced_csv(struct TransferInfo *stats); void tcp_output_write_enhanced_csv(struct TransferInfo *stats); +void tcp_output_write_bb_csv (struct TransferInfo *stats); // The report output routines that are simpler and aren't related to stats void reporter_print_connection_report(struct ConnectionInfo *report); @@ -571,10 +599,11 @@ void reporter_connect_printf_tcp_final(struct ConnectionInfo *report); void write_UDP_AckFIN(struct TransferInfo *stats, int len); -int reporter_process_transfer_report (struct ReporterData *this_ireport); -int reporter_process_report (struct ReportHeader *reporthdr); +bool reporter_process_transfer_report (struct ReporterData *this_ireport); +bool reporter_process_report (struct ReportHeader *reporthdr); -void setTransferID(struct thread_Settings *inSettings, int role_reversal); +void setTransferID(struct thread_Settings *inSettings, enum TansferIDType traffic_direction); +void updateTransferIDPeer(struct thread_Settings *inSettings); void format_ips_port_string (struct TransferInfo *stats, bool sum); #ifdef __cplusplus |