Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

perf.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "util.h"
#include "perf.h"

Go to the source code of this file.

Defines

#define PATH_MAX   1024
#define FILE_MAX   (PATH_MAX + 256)

Functions

int InitPerfStats (SFPERF *sfPerf)
int UpdatePerfStats (SFPERF *sfPerf, unsigned char *pucPacket, int len, int iRebuiltPkt)
int ProcessPerfStats (SFPERF *sfPerf)
int sfInitPerformanceStatistics (SFPERF *sfPerf)
int sfSetPerformanceSampleTime (SFPERF *sfPerf, int iSeconds)
int sfSetPerformanceAccounting (SFPERF *sfPerf, int iReset)
int sfSetPerformanceStatistics (SFPERF *sfPerf, int iFlag)
int sfSetPerformanceStatisticsEx (SFPERF *sfPerf, int iFlag, void *p)
int sfRotatePerformanceStatisticsFile (SFPERF *sfPerf)
int sfPerformanceStats (SFPERF *sfPerf, unsigned char *pucPacket, int len, int iRebuiltPkt)
int CheckSampleInterval (time_t curr_time, SFPERF *sfPerf)
int sfProcessPerfStats (SFPERF *sfPerf)


Define Documentation

#define FILE_MAX   (PATH_MAX + 256)
 

Definition at line 156 of file perf.c.

Referenced by sfRotatePerformanceStatisticsFile().

#define PATH_MAX   1024
 

Definition at line 152 of file perf.c.

Referenced by sfRotatePerformanceStatisticsFile().


Function Documentation

int CheckSampleInterval time_t  curr_time,
SFPERF sfPerf
 

Definition at line 235 of file perf.c.

References InitPerfStats(), ProcessPerfStats(), _SFPERF::sample_interval, and _SFPERF::sample_time.

Referenced by ParsePerfMonitorArgs(), and sfPerformanceStats().

int InitPerfStats SFPERF sfPerf  ) 
 

Definition at line 256 of file perf.c.

References InitBaseStats(), InitEventStats(), InitFlowStats(), _SFPERF::iPerfFlags, NULL, _SFPERF::sample_time, _SFPERF::sfBase, _SFPERF::sfEvent, _SFPERF::sfFlow, SFPERF_BASE, SFPERF_EVENT, and SFPERF_FLOW.

Referenced by CheckSampleInterval().

int ProcessPerfStats SFPERF sfPerf  ) 
 

Definition at line 302 of file perf.c.

References _SFPERF::fh, _SFPERF::iPerfFlags, ProcessBaseStats(), ProcessEventStats(), ProcessFlowStats(), _SFPERF::sfBase, _SFPERF::sfEvent, _SFPERF::sfFlow, SFPERF_BASE, SFPERF_CONSOLE, SFPERF_EVENT, SFPERF_FILE, and SFPERF_FLOW.

Referenced by CheckSampleInterval(), and sfProcessPerfStats().

int sfInitPerformanceStatistics SFPERF sfPerf  ) 
 

Definition at line 49 of file perf.c.

References memset, sfSetPerformanceSampleTime(), and sfSetPerformanceStatistics().

Referenced by ParsePerfMonitorArgs().

int sfPerformanceStats SFPERF sfPerf,
unsigned char *  pucPacket,
int  len,
int  iRebuiltPkt
 

Definition at line 216 of file perf.c.

References CheckSampleInterval(), _SFPERF::iPerfFlags, _SFPERF::iPktCnt, NULL, SFPERF_SUMMARY, and UpdatePerfStats().

Referenced by ProcessPerfMonitor().

int sfProcessPerfStats SFPERF sfPerf  ) 
 

Definition at line 297 of file perf.c.

References ProcessPerfStats().

Referenced by PerfMonitorCleanExit().

int sfRotatePerformanceStatisticsFile SFPERF sfPerf  ) 
 

Definition at line 159 of file perf.c.

References errno, FatalError(), FILE_MAX, LogMessage(), NULL, PATH_MAX, SFPERF_FILE, sfSetPerformanceStatisticsEx(), and snprintf.

Referenced by ProcessPerfMonitor().

int sfSetPerformanceAccounting SFPERF sfPerf,
int  iReset
 

Definition at line 73 of file perf.c.

References _SFBASE::iReset, and _SFPERF::sfBase.

Referenced by ParsePerfMonitorArgs().

int sfSetPerformanceSampleTime SFPERF sfPerf,
int  iSeconds
 

Definition at line 58 of file perf.c.

References _SFPERF::sample_interval, and _SFPERF::sample_time.

Referenced by ParsePerfMonitorArgs(), and sfInitPerformanceStatistics().

int sfSetPerformanceStatistics SFPERF sfPerf,
int  iFlag
 

Definition at line 81 of file perf.c.

References _SFBASE::iFlags, _SFPERF::iPerfFlags, MAX_PERF_STATS, _SFPERF::sfBase, SFPERF_BASE, SFPERF_BASE_MAX, SFPERF_CONSOLE, SFPERF_EVENT, and SFPERF_FLOW.

Referenced by ParsePerfMonitorArgs(), and sfInitPerformanceStatistics().

int sfSetPerformanceStatisticsEx SFPERF sfPerf,
int  iFlag,
void *  p
 

Definition at line 112 of file perf.c.

References _SFPERF::fh, _SFPERF::file, _SFPERF::iPerfFlags, _SFPERF::iPktCnt, SFPERF_FILE, SFPERF_PKTCNT, and SFPERF_SUMMARY.

Referenced by ParsePerfMonitorArgs(), and sfRotatePerformanceStatisticsFile().

int UpdatePerfStats SFPERF sfPerf,
unsigned char *  pucPacket,
int  len,
int  iRebuiltPkt
 

Definition at line 282 of file perf.c.

References _SFPERF::iPerfFlags, _SFPERF::sfBase, _SFPERF::sfFlow, SFPERF_BASE, SFPERF_FLOW, UpdateBaseStats(), and UpdateFlowStats().

Referenced by sfPerformanceStats().


Generated on Sun May 14 14:51:25 2006 by  doxygen 1.4.2