AFS-Monitor
view release on metacpan or search on metacpan
src/Monitor.xs view on Meta::CPAN
*/
static void
myPrintTheseStats(HV *RXSTATS, struct rx_statistics *rxstats)
{
HV *PACKETS;
HV *TYPE;
HV *TOTALRTT;
HV *MINRTT;
HV *MAXRTT;
int i;
int num_unused;
hv_store(RXSTATS, "packetRequests", 14, newSViv(rxstats->packetRequests),
0);
hv_store(RXSTATS, "receivePktAllocFailures", 23,
newSViv(rxstats->receivePktAllocFailures), 0);
hv_store(RXSTATS, "receiveCbufPktAllocFailures", 27,
newSViv(rxstats->receiveCbufPktAllocFailures), 0);
hv_store(RXSTATS, "sendPktAllocFailures", 20,
newSViv(rxstats->sendPktAllocFailures), 0);
hv_store(RXSTATS, "sendCbufPktAllocFailures", 24,
newSViv(rxstats->sendCbufPktAllocFailures), 0);
hv_store(RXSTATS, "specialPktAllocFailures", 23,
newSViv(rxstats->specialPktAllocFailures), 0);
hv_store(RXSTATS, "socketGreedy", 12, newSViv(rxstats->socketGreedy), 0);
hv_store(RXSTATS, "bogusPacketOnRead", 17,
newSViv(rxstats->bogusPacketOnRead), 0);
hv_store(RXSTATS, "bogusHost", 9, newSViv(rxstats->bogusHost), 0);
hv_store(RXSTATS, "noPacketOnRead", 14, newSViv(rxstats->noPacketOnRead),
0);
hv_store(RXSTATS, "noPacketBuffersOnRead", 21,
newSViv(rxstats->noPacketBuffersOnRead), 0);
hv_store(RXSTATS, "selects", 7, newSViv(rxstats->selects), 0);
hv_store(RXSTATS, "sendSelects", 11, newSViv(rxstats->sendSelects), 0);
PACKETS = newHV();
num_unused = 0;
for (i = 0; i < RX_N_PACKET_TYPES; i++) {
char *packet_type = rx_packetTypes[i];
TYPE = newHV();
hv_store(TYPE, "packetsRead", 11, newSViv(rxstats->packetsRead[i]), 0);
hv_store(TYPE, "packetsSent", 11, newSViv(rxstats->packetsSent[i]), 0);
if (packet_type == "unused") {
/* rename "unused" types */
/* can't have several entries in a hash with same name */
char packet_type_unused[7];
sprintf(packet_type_unused, "unused%d", num_unused);
packet_type = packet_type_unused;
num_unused++;
}
hv_store(PACKETS, packet_type, strlen(packet_type),
newRV_inc((SV *) (TYPE)), 0);
}
hv_store(RXSTATS, "packets", 7, newRV_inc((SV *) (PACKETS)), 0);
hv_store(RXSTATS, "dataPacketsRead", 15, newSViv(rxstats->dataPacketsRead),
0);
hv_store(RXSTATS, "ackPacketsRead", 14, newSViv(rxstats->ackPacketsRead),
0);
hv_store(RXSTATS, "dupPacketsRead", 14, newSViv(rxstats->dupPacketsRead),
0);
hv_store(RXSTATS, "spuriousPacketsRead", 19,
newSViv(rxstats->spuriousPacketsRead), 0);
hv_store(RXSTATS, "ignorePacketDally", 17,
newSViv(rxstats->ignorePacketDally), 0);
hv_store(RXSTATS, "pingPacketsSent", 15, newSViv(rxstats->pingPacketsSent),
0);
hv_store(RXSTATS, "abortPacketsSent", 16,
newSViv(rxstats->abortPacketsSent), 0);
hv_store(RXSTATS, "busyPacketsSent", 15, newSViv(rxstats->busyPacketsSent),
0);
hv_store(RXSTATS, "ackPacketsSent", 14, newSViv(rxstats->ackPacketsSent),
0);
hv_store(RXSTATS, "dataPacketsSent", 15, newSViv(rxstats->dataPacketsSent),
0);
hv_store(RXSTATS, "dataPacketsReSent", 17,
newSViv(rxstats->dataPacketsReSent), 0);
hv_store(RXSTATS, "dataPacketsPushed", 17,
newSViv(rxstats->dataPacketsPushed), 0);
hv_store(RXSTATS, "ignoreAckedPacket", 17,
newSViv(rxstats->ignoreAckedPacket), 0);
hv_store(RXSTATS, "netSendFailures", 15, newSViv(rxstats->netSendFailures),
0);
hv_store(RXSTATS, "fatalErrors", 11, newSViv(rxstats->fatalErrors), 0);
hv_store(RXSTATS, "nServerConns", 12, newSViv(rxstats->nServerConns), 0);
hv_store(RXSTATS, "nClientConns", 12, newSViv(rxstats->nClientConns), 0);
hv_store(RXSTATS, "nPeerStructs", 12, newSViv(rxstats->nPeerStructs), 0);
hv_store(RXSTATS, "nCallStructs", 12, newSViv(rxstats->nCallStructs), 0);
hv_store(RXSTATS, "nFreeCallStructs", 16,
newSViv(rxstats->nFreeCallStructs), 0);
hv_store(RXSTATS, "nRttSamples", 11, newSViv(rxstats->nRttSamples), 0);
TOTALRTT = newHV();
hv_store(TOTALRTT, "sec", 3, newSViv(rxstats->totalRtt.sec), 0);
hv_store(TOTALRTT, "usec", 4, newSViv(rxstats->totalRtt.usec), 0);
hv_store(RXSTATS, "totalRtt", 8, newRV_inc((SV *) (TOTALRTT)), 0);
MINRTT = newHV();
hv_store(MINRTT, "sec", 3, newSViv(rxstats->minRtt.sec), 0);
hv_store(MINRTT, "usec", 4, newSViv(rxstats->minRtt.usec), 0);
hv_store(RXSTATS, "minRtt", 6, newRV_inc((SV *) (MINRTT)), 0);
MAXRTT = newHV();
hv_store(MAXRTT, "sec", 3, newSViv(rxstats->maxRtt.sec), 0);
hv_store(MAXRTT, "usec", 4, newSViv(rxstats->maxRtt.usec), 0);
hv_store(RXSTATS, "maxRtt", 6, newRV_inc((SV *) (MAXRTT)), 0);
#if !defined(AFS_PTHREAD_ENV) && !defined(AFS_USE_GETTIMEOFDAY)
hv_store(RXSTATS, "clock_nUpdates", 14, newSViv(clock_nUpdates), 0);
#endif
}
/* end of rxdebug helper functions */
/* start of afsmonitor helper functions */
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
#define FS 1 /* for misc. use */
#define CM 2 /* for misc. use */
#define CFG_STR_LEN 80 /* max length of config file fields */
#define NUM_XSTAT_FS_AFS_PERFSTATS_LONGS 66 /* number of fields (longs)
* in struct afs_PerfStats */
#define NUM_AFS_STATS_CMPERF_LONGS 40 /* number of longs in struct afs_stats_CMPerf
* excluding up/down stats and fields we dont display */
/*
* from src/afsmonitor/afsmonitor.h
*
*/
src/Monitor.xs view on Meta::CPAN
"CallBack",
"InitCallBackState",
"Probe",
"GetLock",
"GetCE",
"XStatsVersion",
"GetXStats"
};
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
static char *xferOpNames[] = {
"FetchData",
"StoreData"
};
/*
* from src/afsmonitor/afsmonitor.h
*
*/
/* structure of each threshold item */
struct Threshold {
char itemName[THRESH_VAR_NAME_LEN]; /* field name */
int index; /* positional index */
char threshVal[THRESH_VAR_LEN]; /* user provided threshold value */
char handler[256]; /* user provided ovf handler */
};
/*
* from src/afsmonitor/afsmonitor.h
*
*/
/* structures to store info of hosts to be monitored */
struct afsmon_hostEntry {
char hostName[HOST_NAME_LEN]; /* fs or cm host name */
int numThresh; /* number of thresholds for this host */
struct Threshold *thresh; /* ptr to threshold entries */
struct afsmon_hostEntry *next;
};
/*
* from src/afsmonitor/afsmonitor.h
*
*/
/* structures to store statistics in a format convenient to dump to the
screen */
/* for file servers */
struct fs_Display_Data {
char hostName[HOST_NAME_LEN];
int probeOK; /* 0 => probe failed */
char data[NUM_FS_STAT_ENTRIES][FS_STAT_STRING_LEN];
short threshOvf[NUM_FS_STAT_ENTRIES]; /* overflow flags */
int ovfCount; /* overflow count */
};
/* for cache managers */
struct cm_Display_Data {
char hostName[HOST_NAME_LEN];
int probeOK; /* 0 => probe failed */
char data[NUM_CM_STAT_ENTRIES][CM_STAT_STRING_LEN];
short threshOvf[NUM_CM_STAT_ENTRIES]; /* overflow flags */
int ovfCount; /* overflow count */
};
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
/* wouldn't compile without this, but it wasn't in original afsmonitor.c */
#if !defined(__USE_GNU) && !defined(__APPLE_CC__)
char *
strcasestr(char *s1, char *s2)
{
char *ptr;
int len1, len2;
len1 = strlen(s1);
len2 = strlen(s2);
if (len1 < len2)
return ((char *)NULL);
ptr = s1;
while (len1 >= len2 && len1 > 0) {
if ((strncasecmp(ptr, s2, len2)) == 0)
return (ptr);
ptr++;
len1--;
}
return ((char *)NULL);
}
#endif /* __USE_GNU */
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
struct hostent *
GetHostByName(char *name)
{
struct hostent *he;
#ifdef AFS_SUN5_ENV
char ip_addr[32];
#endif
he = gethostbyname(name);
#ifdef AFS_SUN5_ENV
/* On solaris the above does not resolve hostnames to full names */
if (he != NULL) {
memcpy(ip_addr, he->h_addr, he->h_length);
he = gethostbyaddr(ip_addr, he->h_length, he->h_addrtype);
}
#endif
return (he);
src/Monitor.xs view on Meta::CPAN
}
else if ((strcasecmp(arg1, "cm")) == 0) {
switch (lastHostType) {
case 0: /* its a global threshold */
(*global_cmThreshCount)++;
break;
case 2: /* inc thresh count of last cache manager */
last_hostEntry->numThresh++;
break;
case 1:
sprintf(buffer,
"A threshold for a Cache Manager cannot be placed after a File Server host entry in the config file");
return (-1);
default:
sprintf(buffer, "Programming error 2");
return (-1);
}
}
else {
sprintf(buffer,
"Syntax error. Second argument should be \"fs\" or \"cm\"");
return (-1);
}
return (0);
} /* my_parse_threshEntry() */
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_parse_showEntry(a_line, fs_showDefault, cm_showDefault, fs_showFlags,
cm_showFlags, buffer)
char *a_line;
int *fs_showDefault;
int *cm_showDefault;
short *fs_showFlags;
short *cm_showFlags;
char *buffer;
{
char opcode[CFG_STR_LEN]; /* specifies type of config entry */
char arg1[CFG_STR_LEN]; /* show fs or cm entry ? */
char arg2[CFG_STR_LEN]; /* what we gotta show */
char arg3[CFG_STR_LEN]; /* junk */
char catName[CFG_STR_LEN]; /* for category names */
int numGroups = 0; /* number of groups in a section */
int fromIdx = 0;
int toIdx = 0;
int found = 0;
int idx = 0; /* index to fs_categories[] */
int i = 0;
int j = 0;
extern char *fs_varNames[];
extern char *cm_varNames[];
extern char *fs_categories[]; /* file server data category names */
extern char *cm_categories[]; /* cache manager data category names */
opcode[0] = 0;
arg1[0] = 0;
arg2[0] = 0;
arg3[0] = 0;
sscanf(a_line, "%s %s %s %s", opcode, arg1, arg2, arg3);
if (arg3[0] != '\0') {
sprintf(buffer, "Extraneous characters at end of line");
return (-1);
}
if ((strcasecmp(arg1, "fs") != 0) && (strcasecmp(arg1, "cm") != 0)) {
sprintf(buffer,
"Second argument of \"show\" directive should be \"fs\" or \"cm\"");
return (-1);
}
/* Each entry can either be a variable name or a section/group name. Variable
* names are listed in xx_varNames[] and section/group names in xx_categories[].
* The section/group names in xx_categiries[] also give the starting/ending
* indices of the variables belonging to that section/group. These indices
* are stored in order in xx_Display_map[] and displayed to the screen in that
* order. */
/* To handle duplicate "show" entries we keep track of what what we have
* already marked to show in the xx_showFlags[] */
if (strcasecmp(arg1, "fs") == 0) { /* its a File Server entry */
/* mark that we have to show only what the user wants */
*fs_showDefault = 0;
/* if it is a section/group name, find it in the fs_categories[] array */
found = 0;
if (strcasestr(arg2, "_section") != (char *)NULL
|| strcasestr(arg2, "_group") != (char *)NULL) {
idx = 0;
while (idx < FS_NUM_DATA_CATEGORIES) {
sscanf(fs_categories[idx], "%s %d %d", catName, &fromIdx, &toIdx);
idx++;
if (strcasecmp(arg2, catName) == 0) {
found = 1;
break;
}
}
if (!found) { /* typo in section/group name */
sprintf(buffer, "Could not find section/group name %s", arg2);
return (-1);
}
}
/* if it is a group name, read its start/end indices and fill in the
* fs_Display_map[]. */
if (strcasestr(arg2, "_group") != (char *)NULL) {
if (fromIdx < 0 || toIdx < 0 || fromIdx > NUM_FS_STAT_ENTRIES ||
toIdx > NUM_FS_STAT_ENTRIES)
src/Monitor.xs view on Meta::CPAN
break;
}
tmp_host = tmp_host->next;
}
if (!found) {
sprintf(buffer, "Unable to find host %s in %s hostEntry list", hostname,
(a_type - 1) ? "CM" : "FS");
return (-1);
}
/* put this entry on the thresh list of this host, overwrite global value
* if needed */
threshP = tmp_host->thresh;
done = 0;
for (i = 0; i < tmp_host->numThresh; i++) {
if ((threshP->itemName[0] == '\0') ||
(strcasecmp(threshP->itemName, a_varName) == 0)) {
strncpy(threshP->itemName, a_varName, THRESH_VAR_NAME_LEN);
strncpy(threshP->threshVal, a_value, THRESH_VAR_LEN);
strcpy(threshP->handler, a_handler);
threshP->index = index;
done = 1;
break;
}
threshP++;
}
if (!done) {
sprintf(buffer, "Unable to insert threshold %s for %s host %s",
a_varName, (a_type - 1) ? "CM" : "FS", tmp_host->hostName);
return (-1);
}
return (0);
} /* my_store_threshold() */
/*
* from /src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*
* int
* check_fs_thresholds(a_hostEntry, a_Data)
* struct afsmon_hostEntry *a_hostEntry;
* struct fs_Display_Data *a_Data;
*
* and
*
* int
* check_cm_thresholds(a_hostEntry, a_Data)
* struct afsmon_hostEntry *a_hostEntry;
* struct cm_Display_Data *a_Data;
*/
int
my_check_thresholds(a_hostEntry, HOSTINFO, type, buffer)
struct afsmon_hostEntry *a_hostEntry; /* ptr to hostEntry */
HV *HOSTINFO; /* ptr to data to be displayed */
int type;
char *buffer;
{
struct Threshold *threshP;
double tValue = 0; /* threshold value */
double pValue = 0; /* probe value */
int i;
int idx;
int count; /* number of thresholds exceeded */
HV *SECTION;
HV *GROUP;
HV *VALUE;
int found;
char *key;
I32 keylen;
char strval[256];
int code = 0;
char *varName;
if (a_hostEntry->numThresh == 0) {
/* store in ovf count ?? */
return (0);
}
count = 0;
threshP = a_hostEntry->thresh;
for (i = 0; i < a_hostEntry->numThresh; i++) {
found = 0;
if (threshP->itemName[0] == '\0') {
threshP++;
continue;
}
idx = threshP->index; /* positional index to the data array */
tValue = atof(threshP->threshVal); /* threshold value */
hv_iterinit(HOSTINFO);
while ((SECTION = (HV *) hv_iternextsv(HOSTINFO, &key, &keylen))) {
if (!SvROK(SECTION)
|| SvTYPE(SECTION = (HV *) SvRV(SECTION)) != SVt_PVHV) {
continue;
}
hv_iterinit(SECTION);
while ((GROUP = (HV *) hv_iternextsv(SECTION, &key, &keylen))) {
if (!SvROK(GROUP)
|| SvTYPE(GROUP = (HV *) SvRV(GROUP)) != SVt_PVHV) {
continue;
}
if (type == FS)
varName = fs_varNames[idx];
else if (type == CM)
varName = cm_varNames[idx];
else
return (-1);
if (hv_exists(GROUP, varName, strlen(varName))) {
VALUE = (HV *)
SvRV(*hv_fetch(GROUP, varName, strlen(varName), FALSE));
pValue = SvIV(*hv_fetch(VALUE, "value", 5, FALSE));
found = 1;
break;
}
}
if (found)
break;
}
if (!found) {
threshP++;
continue;
}
if (pValue > tValue) {
hv_store(VALUE, "overflow", 8, newSViv(1), 0);
hv_store(VALUE, "threshold", 9, newSVnv(tValue), 0);
if (threshP->handler[0] != '\0') {
sprintf(strval, "%g", pValue);
code = my_execute_thresh_handler(threshP->handler,
a_hostEntry->hostName, type,
threshP->itemName,
threshP->threshVal, strval,
VALUE, buffer);
if (code) {
return (code);
}
}
count++;
}
threshP++;
src/Monitor.xs view on Meta::CPAN
void
my_Print_fs_OverallPerfInfo(a_ovP, fs_outFD)
struct afs_PerfStats *a_ovP;
FILE *fs_outFD;
{
fprintf(fs_outFD, "\t%10d numPerfCalls\n\n", a_ovP->numPerfCalls);
/*
* Vnode cache section.
*/
fprintf(fs_outFD, "\t%10d vcache_L_Entries\n", a_ovP->vcache_L_Entries);
fprintf(fs_outFD, "\t%10d vcache_L_Allocs\n", a_ovP->vcache_L_Allocs);
fprintf(fs_outFD, "\t%10d vcache_L_Gets\n", a_ovP->vcache_L_Gets);
fprintf(fs_outFD, "\t%10d vcache_L_Reads\n", a_ovP->vcache_L_Reads);
fprintf(fs_outFD, "\t%10d vcache_L_Writes\n\n", a_ovP->vcache_L_Writes);
fprintf(fs_outFD, "\t%10d vcache_S_Entries\n", a_ovP->vcache_S_Entries);
fprintf(fs_outFD, "\t%10d vcache_S_Allocs\n", a_ovP->vcache_S_Allocs);
fprintf(fs_outFD, "\t%10d vcache_S_Gets\n", a_ovP->vcache_S_Gets);
fprintf(fs_outFD, "\t%10d vcache_S_Reads\n", a_ovP->vcache_S_Reads);
fprintf(fs_outFD, "\t%10d vcache_S_Writes\n\n", a_ovP->vcache_S_Writes);
fprintf(fs_outFD, "\t%10d vcache_H_Entries\n", a_ovP->vcache_H_Entries);
fprintf(fs_outFD, "\t%10d vcache_H_Gets\n", a_ovP->vcache_H_Gets);
fprintf(fs_outFD, "\t%10d vcache_H_Replacements\n\n",
a_ovP->vcache_H_Replacements);
/*
* Directory package section.
*/
fprintf(fs_outFD, "\t%10d dir_Buffers\n", a_ovP->dir_Buffers);
fprintf(fs_outFD, "\t%10d dir_Calls\n", a_ovP->dir_Calls);
fprintf(fs_outFD, "\t%10d dir_IOs\n\n", a_ovP->dir_IOs);
/*
* Rx section.
*/
fprintf(fs_outFD, "\t%10d rx_packetRequests\n", a_ovP->rx_packetRequests);
fprintf(fs_outFD, "\t%10d rx_noPackets_RcvClass\n",
a_ovP->rx_noPackets_RcvClass);
fprintf(fs_outFD, "\t%10d rx_noPackets_SendClass\n",
a_ovP->rx_noPackets_SendClass);
fprintf(fs_outFD, "\t%10d rx_noPackets_SpecialClass\n",
a_ovP->rx_noPackets_SpecialClass);
fprintf(fs_outFD, "\t%10d rx_socketGreedy\n", a_ovP->rx_socketGreedy);
fprintf(fs_outFD, "\t%10d rx_bogusPacketOnRead\n",
a_ovP->rx_bogusPacketOnRead);
fprintf(fs_outFD, "\t%10d rx_bogusHost\n", a_ovP->rx_bogusHost);
fprintf(fs_outFD, "\t%10d rx_noPacketOnRead\n", a_ovP->rx_noPacketOnRead);
fprintf(fs_outFD, "\t%10d rx_noPacketBuffersOnRead\n",
a_ovP->rx_noPacketBuffersOnRead);
fprintf(fs_outFD, "\t%10d rx_selects\n", a_ovP->rx_selects);
fprintf(fs_outFD, "\t%10d rx_sendSelects\n", a_ovP->rx_sendSelects);
fprintf(fs_outFD, "\t%10d rx_packetsRead_RcvClass\n",
a_ovP->rx_packetsRead_RcvClass);
fprintf(fs_outFD, "\t%10d rx_packetsRead_SendClass\n",
a_ovP->rx_packetsRead_SendClass);
fprintf(fs_outFD, "\t%10d rx_packetsRead_SpecialClass\n",
a_ovP->rx_packetsRead_SpecialClass);
fprintf(fs_outFD, "\t%10d rx_dataPacketsRead\n",
a_ovP->rx_dataPacketsRead);
fprintf(fs_outFD, "\t%10d rx_ackPacketsRead\n", a_ovP->rx_ackPacketsRead);
fprintf(fs_outFD, "\t%10d rx_dupPacketsRead\n", a_ovP->rx_dupPacketsRead);
fprintf(fs_outFD, "\t%10d rx_spuriousPacketsRead\n",
a_ovP->rx_spuriousPacketsRead);
fprintf(fs_outFD, "\t%10d rx_packetsSent_RcvClass\n",
a_ovP->rx_packetsSent_RcvClass);
fprintf(fs_outFD, "\t%10d rx_packetsSent_SendClass\n",
a_ovP->rx_packetsSent_SendClass);
fprintf(fs_outFD, "\t%10d rx_packetsSent_SpecialClass\n",
a_ovP->rx_packetsSent_SpecialClass);
fprintf(fs_outFD, "\t%10d rx_ackPacketsSent\n", a_ovP->rx_ackPacketsSent);
fprintf(fs_outFD, "\t%10d rx_pingPacketsSent\n",
a_ovP->rx_pingPacketsSent);
fprintf(fs_outFD, "\t%10d rx_abortPacketsSent\n",
a_ovP->rx_abortPacketsSent);
fprintf(fs_outFD, "\t%10d rx_busyPacketsSent\n",
a_ovP->rx_busyPacketsSent);
fprintf(fs_outFD, "\t%10d rx_dataPacketsSent\n",
a_ovP->rx_dataPacketsSent);
fprintf(fs_outFD, "\t%10d rx_dataPacketsReSent\n",
a_ovP->rx_dataPacketsReSent);
fprintf(fs_outFD, "\t%10d rx_dataPacketsPushed\n",
a_ovP->rx_dataPacketsPushed);
fprintf(fs_outFD, "\t%10d rx_ignoreAckedPacket\n",
a_ovP->rx_ignoreAckedPacket);
fprintf(fs_outFD, "\t%10d rx_totalRtt_Sec\n", a_ovP->rx_totalRtt_Sec);
fprintf(fs_outFD, "\t%10d rx_totalRtt_Usec\n", a_ovP->rx_totalRtt_Usec);
fprintf(fs_outFD, "\t%10d rx_minRtt_Sec\n", a_ovP->rx_minRtt_Sec);
fprintf(fs_outFD, "\t%10d rx_minRtt_Usec\n", a_ovP->rx_minRtt_Usec);
fprintf(fs_outFD, "\t%10d rx_maxRtt_Sec\n", a_ovP->rx_maxRtt_Sec);
fprintf(fs_outFD, "\t%10d rx_maxRtt_Usec\n", a_ovP->rx_maxRtt_Usec);
fprintf(fs_outFD, "\t%10d rx_nRttSamples\n", a_ovP->rx_nRttSamples);
fprintf(fs_outFD, "\t%10d rx_nServerConns\n", a_ovP->rx_nServerConns);
fprintf(fs_outFD, "\t%10d rx_nClientConns\n", a_ovP->rx_nClientConns);
fprintf(fs_outFD, "\t%10d rx_nPeerStructs\n", a_ovP->rx_nPeerStructs);
fprintf(fs_outFD, "\t%10d rx_nCallStructs\n", a_ovP->rx_nCallStructs);
fprintf(fs_outFD, "\t%10d rx_nFreeCallStructs\n\n",
a_ovP->rx_nFreeCallStructs);
/*
* Host module fields.
*/
fprintf(fs_outFD, "\t%10d host_NumHostEntries\n",
a_ovP->host_NumHostEntries);
fprintf(fs_outFD, "\t%10d host_HostBlocks\n", a_ovP->host_HostBlocks);
fprintf(fs_outFD, "\t%10d host_NonDeletedHosts\n",
a_ovP->host_NonDeletedHosts);
fprintf(fs_outFD, "\t%10d host_HostsInSameNetOrSubnet\n",
a_ovP->host_HostsInSameNetOrSubnet);
fprintf(fs_outFD, "\t%10d host_HostsInDiffSubnet\n",
a_ovP->host_HostsInDiffSubnet);
fprintf(fs_outFD, "\t%10d host_HostsInDiffNetwork\n",
a_ovP->host_HostsInDiffNetwork);
fprintf(fs_outFD, "\t%10d host_NumClients\n", a_ovP->host_NumClients);
fprintf(fs_outFD, "\t%10d host_ClientBlocks\n\n",
a_ovP->host_ClientBlocks);
} /* my_Print_fs_OverallPerfInfo() */
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_Print_fs_DetailedPerfInfo(a_detP, fs_outFD)
struct fs_stats_DetailedStats *a_detP;
FILE *fs_outFD;
{
int currIdx = 0; /*Loop variable */
fprintf(fs_outFD, "\t%10d epoch\n", a_detP->epoch);
for (currIdx = 0; currIdx < FS_STATS_NUM_RPC_OPS; currIdx++)
my_Print_fs_OpTiming(currIdx, &(a_detP->rpcOpTimes[currIdx]), fs_outFD);
for (currIdx = 0; currIdx < FS_STATS_NUM_XFER_OPS; currIdx++)
my_Print_fs_XferTiming(currIdx, &(a_detP->xferOpTimes[currIdx]),
fs_outFD);
} /* my_Print_fs_DetailedPerfInfo() */
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_Print_fs_FullPerfInfo(a_fs_Results, fs_outFD)
struct xstat_fs_ProbeResults *a_fs_Results;
FILE *fs_outFD;
{
/*Correct # longs to rcv */
static afs_int32 fullPerfLongs = (sizeof(struct fs_stats_FullPerfStats) >> 2);
afs_int32 numLongs = 0; /*# longwords received */
struct fs_stats_FullPerfStats *fullPerfP = 0; /*Ptr to full perf stats */
char *printableTime = 0; /*Ptr to printable time string */
numLongs = a_fs_Results->data.AFS_CollData_len;
if (numLongs != fullPerfLongs) {
fprintf(fs_outFD,
" ** Data size mismatch in full performance collection!\n");
fprintf(fs_outFD, " ** Expecting %d, got %d\n", fullPerfLongs,
numLongs);
return;
}
printableTime = ctime((time_t *) & (a_fs_Results->probeTime));
printableTime[strlen(printableTime) - 1] = '\0';
fullPerfP = (struct fs_stats_FullPerfStats *)
(a_fs_Results->data.AFS_CollData_val);
fprintf(fs_outFD,
"AFS_XSTATSCOLL_FULL_PERF_INFO (coll %d) for FS %s\n[Probe %d, %s]\n\n",
a_fs_Results->collectionNumber, a_fs_Results->connP->hostName,
a_fs_Results->probeNum, printableTime);
my_Print_fs_OverallPerfInfo(&(fullPerfP->overall), fs_outFD);
my_Print_fs_DetailedPerfInfo(&(fullPerfP->det), fs_outFD);
}
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_afsmon_fsOutput(a_outfile, a_detOutput, xstat_fs_Results)
char *a_outfile; /* ptr to output file name */
int a_detOutput; /* detailed output ? */
struct xstat_fs_ProbeResults xstat_fs_Results;
{
char *printTime = 0; /* ptr to time string */
char *hostname = 0; /* fileserner name */
afs_int32 numLongs = 0; /* longwords in result */
afs_int32 *currLong = 0; /* ptr to longwords in result */
int i = 0;
FILE *fs_outFD = 0;
fs_outFD = fopen(a_outfile, "a");
if (fs_outFD == (FILE *) NULL) {
warn("failed to open output file %s", a_outfile);
return;
}
/* get the probe time and strip the \n at the end */
printTime = ctime((time_t *) & (xstat_fs_Results.probeTime));
printTime[strlen(printTime) - 1] = '\0';
hostname = xstat_fs_Results.connP->hostName;
/* print "time hostname FS" */
fprintf(fs_outFD, "\n%s %s FS ", printTime, hostname);
/* if probe failed print -1 and return */
if (xstat_fs_Results.probeOK) {
fprintf(fs_outFD, "-1\n");
fclose(fs_outFD);
return;
}
/* print out the probe information as long words */
numLongs = xstat_fs_Results.data.AFS_CollData_len;
currLong = (afs_int32 *) (xstat_fs_Results.data.AFS_CollData_val);
for (i = 0; i < numLongs; i++) {
fprintf(fs_outFD, "%d ", *currLong++);
}
fprintf(fs_outFD, "\n\n");
/* print detailed information */
if (a_detOutput) {
my_Print_fs_FullPerfInfo(&xstat_fs_Results, fs_outFD);
fflush(fs_outFD);
}
fclose(fs_outFD);
} /* my_afsmon_fsOutput() */
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_fs_Results_ltoa(a_fsData, a_fsResults)
struct fs_Display_Data *a_fsData; /* target buffer */
struct xstat_fs_ProbeResults *a_fsResults; /* ptr to xstat fs Results */
{
afs_int32 *srcbuf;
struct fs_stats_FullPerfStats *fullPerfP;
int idx;
int i, j;
afs_int32 *tmpbuf;
fullPerfP = (struct fs_stats_FullPerfStats *)
(a_fsResults->data.AFS_CollData_val);
/* there are two parts to the xstat FS statistics
* - fullPerfP->overall which give the overall performance statistics, and
* - fullPerfP->det which gives detailed info about file server operation
* execution times */
/* copy overall performance statistics */
srcbuf = (afs_int32 *) & (fullPerfP->overall);
idx = 0;
for (i = 0; i < NUM_XSTAT_FS_AFS_PERFSTATS_LONGS; i++) {
sprintf(a_fsData->data[idx], "%d", *srcbuf);
idx++;
srcbuf++;
}
/* copy epoch */
srcbuf = (afs_int32 *) & (fullPerfP->det.epoch);
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* epoch */
idx++;
/* copy fs operation timing */
srcbuf = (afs_int32 *) (fullPerfP->det.rpcOpTimes);
for (i = 0; i < FS_STATS_NUM_RPC_OPS; i++) {
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numOps */
idx++;
srcbuf++;
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numSuccesses */
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sum time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* min time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* max time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
}
/* copy fs transfer timings */
srcbuf = (afs_int32 *) (fullPerfP->det.xferOpTimes);
for (i = 0; i < FS_STATS_NUM_XFER_OPS; i++) {
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numOps */
idx++;
srcbuf++;
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* numSuccesses */
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sum time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* min time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* max time */
sprintf(a_fsData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* sum bytes */
idx++;
srcbuf++;
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* min bytes */
idx++;
srcbuf++;
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* max bytes */
idx++;
srcbuf++;
for (j = 0; j < FS_STATS_NUM_XFER_BUCKETS; j++) {
sprintf(a_fsData->data[idx], "%d", *srcbuf); /* bucket[j] */
idx++;
srcbuf++;
}
}
return (0);
} /* my_fs_Results_ltoa() */
void
fs_Results_to_Hash(struct fs_Display_Data *fsData, HV *HOSTINFO,
short *showFlags, int showDefault)
{
int secidx;
int grpidx;
int numgrp;
int fromidx;
int toidx;
char section[CFG_STR_LEN] = "";
char group[CFG_STR_LEN] = "";
HV *ENTRY;
HV *GROUP;
HV *SECTION;
int i;
secidx = 0;
grpidx = secidx + 1;
while (secidx < FS_NUM_DATA_CATEGORIES) {
sscanf(fs_categories[secidx], "%s %d", section, &numgrp);
SECTION = newHV();
while (grpidx <= secidx + numgrp) {
GROUP = newHV();
sscanf(fs_categories[grpidx], "%s %d %d", group, &fromidx, &toidx);
for (i = fromidx; i <= toidx; i++) {
if (showFlags[i] || showDefault) {
ENTRY = newHV();
hv_store(ENTRY, "value", 5, newSVnv(atof(fsData->data[i])), 0);
hv_store(GROUP, fs_varNames[i], strlen(fs_varNames[i]),
newRV_inc((SV *) ENTRY), 0);
}
}
if (HvKEYS(GROUP))
hv_store(SECTION, group, strlen(group), newRV_inc((SV *) GROUP),
0);
grpidx++;
}
if (HvKEYS(SECTION))
hv_store(HOSTINFO, section, strlen(section),
newRV_inc((SV *) SECTION), 0);
secidx += numgrp + 1;
grpidx = secidx + 1;
}
} /* fs_Results_to_Hash() */
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_save_FS_data_forDisplay(a_fsResults, HOSTINFO, numFS, FSnameList,
fs_showFlags, fs_showDefault, buffer)
struct xstat_fs_ProbeResults *a_fsResults;
HV *HOSTINFO;
int numFS;
struct afsmon_hostEntry *FSnameList;
short *fs_showFlags;
int fs_showDefault;
char *buffer;
{
struct fs_Display_Data *curr_fsDataP;
struct afsmon_hostEntry *curr_host = 0;
int i = 0;
int code = 0;
int done = 0;
char buff2[256] = "";
curr_fsDataP =
(struct fs_Display_Data *)malloc(sizeof(struct fs_Display_Data));
if (curr_fsDataP == (struct fs_Display_Data *) NULL) {
sprintf(buffer, "Memory allocation failure");
return (-1);
}
memset(curr_fsDataP, 0, sizeof(struct fs_Display_Data));
hv_store(HOSTINFO, "hostName", 8, newSVpv(a_fsResults->connP->hostName, 0),
0);
/* Check the status of the probe. If it succeeded, we store its
* results in the display data structure. If it failed we only mark
* the failed status in the display data structure. */
if (a_fsResults->probeOK) { /* 1 => notOK the xstat results */
hv_store(HOSTINFO, "probeOK", 7, newSViv(0), 0);
}
else { /* probe succeeded, update display data structures */
hv_store(HOSTINFO, "probeOK", 7, newSViv(1), 0);
my_fs_Results_ltoa(curr_fsDataP, a_fsResults);
fs_Results_to_Hash(curr_fsDataP, HOSTINFO, fs_showFlags,
fs_showDefault);
/* compare with thresholds and set the overflow flags.
* note that the threshold information is in the hostEntry structure and
* each threshold item has a positional index associated with it */
/* locate the hostEntry for this host */
done = 0;
curr_host = FSnameList;
for (i = 0; i < numFS; i++) {
if (strcasecmp(curr_host->hostName, a_fsResults->connP->hostName)
== 0) {
done = 1;
break;
}
curr_host = curr_host->next;;
}
if (!done) {
sprintf(buffer, "Error storing results for FS host %s (70)",
a_fsResults->connP->hostName);
return (70);
}
code = my_check_thresholds(curr_host, HOSTINFO, FS, buff2);
if (code) {
sprintf(buffer, "Error in checking thresholds (75) %s", buff2);
return (75);
}
} /* the probe succeeded, so we store the data in the display structure */
return (0);
} /* my_save_FS_data_forDisplay() */
/*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_afsmon_FS_Handler(xstat_fs_Results, numFS, conn_idx, buffer, argp)
struct xstat_fs_ProbeResults xstat_fs_Results;
int numFS;
int conn_idx;
char *buffer;
va_list argp;
{
char *outputfile = va_arg(argp, char *);
int detailed = va_arg(argp, int);
AV *FILESERV = va_arg(argp, AV *);
struct afsmon_hostEntry *FSnameList =
va_arg(argp, struct afsmon_hostEntry *);
short *fs_showFlags = va_arg(argp, short *);
int fs_showDefault = va_arg(argp, int);
HV *HOSTINFO = newHV();
int code = 0;
if (outputfile)
my_afsmon_fsOutput(outputfile, detailed, xstat_fs_Results);
/* add everything to data structure */
code =
my_save_FS_data_forDisplay(&xstat_fs_Results, HOSTINFO, numFS,
FSnameList, fs_showFlags, fs_showDefault,
buffer);
if (code) {
return (code);
}
/* Add HOSTINFO to FS */
av_store(FILESERV, conn_idx, newRV_inc((SV *) (HOSTINFO)));
return (0);
} /* my_afsmon_FS_Handler() */
/*
* from src/xstat/xstat_fs.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_fs_LWP(ProbeHandler, xstat_fs_ConnInfo, xstat_fs_numServers,
xstat_fs_collIDP, xstat_fs_numCollections, buffer, argp)
int (*ProbeHandler) ();
struct xstat_fs_ConnectionInfo *xstat_fs_ConnInfo;
int xstat_fs_numServers;
afs_int32 *xstat_fs_collIDP;
int xstat_fs_numCollections;
char *buffer;
va_list argp;
{
afs_int32 srvVersionNumber = 0; /*Xstat version # */
afs_int32 clientVersionNumber = AFS_XSTAT_VERSION; /*Client xstat version */
afs_int32 *currCollIDP = 0;
int numColls = 0;
int conn_idx = 0;
struct xstat_fs_ConnectionInfo *curr_conn = 0;
char buff2[256] = "";
int code = 0;
int index = 0;
struct xstat_fs_ProbeResults xstat_fs_Results;
afs_int32 xstat_fsData[AFS_MAX_XSTAT_LONGS];
xstat_fs_Results.probeTime = 0;
xstat_fs_Results.connP = (struct xstat_fs_ConnectionInfo *) NULL;
xstat_fs_Results.collectionNumber = 0;
xstat_fs_Results.data.AFS_CollData_len = AFS_MAX_XSTAT_LONGS;
xstat_fs_Results.data.AFS_CollData_val = (afs_int32 *) xstat_fsData;
xstat_fs_Results.probeOK = 0;
curr_conn = xstat_fs_ConnInfo;
for (conn_idx = 0; conn_idx < xstat_fs_numServers; conn_idx++) {
/*
* Grab the statistics for the current File Server, if the
* connection is valid.
*/
if (curr_conn->rxconn != (struct rx_connection *) NULL) {
currCollIDP = xstat_fs_collIDP;
for (numColls = 0;
numColls < xstat_fs_numCollections; numColls++, currCollIDP++) {
/*
* Initialize the per-probe values.
*/
xstat_fs_Results.collectionNumber = *currCollIDP;
xstat_fs_Results.data.AFS_CollData_len = AFS_MAX_XSTAT_LONGS;
memset(xstat_fs_Results.data.AFS_CollData_val, 0,
AFS_MAX_XSTAT_LONGS * 4);
xstat_fs_Results.connP = curr_conn;
xstat_fs_Results.probeOK =
RXAFS_GetXStats(curr_conn->rxconn,
clientVersionNumber,
*currCollIDP,
&srvVersionNumber,
&(xstat_fs_Results.probeTime),
&(xstat_fs_Results.data));
code =
ProbeHandler(xstat_fs_Results, xstat_fs_numServers, index,
buff2, argp);
index++;
if (code) {
sprintf(buffer, "Handler returned error code %d. %s",
code, buff2);
return (code);
}
} /* For each collection */
} /*Valid Rx connection */
/*
* Advance the xstat_fs connection pointer.
*/
curr_conn++;
} /* For each xstat_fs connection */
return (0);
} /* my_xstat_fs_LWP() */
/*
* from src/xstat/xstat_fs.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_fs_Init(int (*ProbeHandler) (), int xstat_fs_numServers,
struct sockaddr_in *a_socketArray,
int xstat_fs_numCollections, afs_int32 * xstat_fs_collIDP,
char *buffer, ...)
{
int curr_srv = 0;
int conn_err = 0;
char *hostNameFound = "";
struct xstat_fs_ConnectionInfo *curr_conn = 0, *xstat_fs_ConnInfo = 0;
struct rx_securityClass *secobj = 0; /*Client security object */
char buff2[256] = "";
int PortToUse = 0;
int code = 0;
va_list argp;
xstat_fs_ConnInfo = (struct xstat_fs_ConnectionInfo *)
malloc(xstat_fs_numServers * sizeof(struct xstat_fs_ConnectionInfo));
if (xstat_fs_ConnInfo == (struct xstat_fs_ConnectionInfo *) NULL) {
sprintf(buffer,
"Can't allocate %d connection info structs (%d bytes)",
xstat_fs_numServers,
(xstat_fs_numServers * sizeof(struct xstat_fs_ConnectionInfo)));
return (-1); /*No cleanup needs to be done yet */
}
PortToUse = XSTAT_FS_CBPORT;
do {
code = rx_Init(htons(PortToUse));
if (code) {
src/Monitor.xs view on Meta::CPAN
*/
void
my_Print_cm_RPCPerfInfo(a_rpcP, cm_outFD)
struct afs_stats_RPCOpInfo *a_rpcP;
FILE *cm_outFD;
{
int currIdx; /*Loop variable */
/*
* Print the contents of each of the opcode-related arrays.
*/
fprintf(cm_outFD, "FS Operation Timings:\n---------------------\n");
for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++)
my_Print_cm_OpTiming(currIdx, fsOpNames, &(a_rpcP->fsRPCTimes[currIdx]),
cm_outFD);
fprintf(cm_outFD, "\nError Info:\n-----------\n");
for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++)
my_Print_cm_ErrInfo(currIdx, fsOpNames, &(a_rpcP->fsRPCErrors[currIdx]),
cm_outFD);
fprintf(cm_outFD, "\nTransfer timings:\n-----------------\n");
for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_XFER_OPS; currIdx++)
my_Print_cm_XferTiming(currIdx, xferOpNames,
&(a_rpcP->fsXferTimes[currIdx]), cm_outFD);
fprintf(cm_outFD, "\nCM Operation Timings:\n---------------------\n");
for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; currIdx++)
my_Print_cm_OpTiming(currIdx, cmOpNames, &(a_rpcP->cmRPCTimes[currIdx]),
cm_outFD);
} /* my_Print_cm_RPCPerfInfo() */
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_Print_cm_FullPerfInfo(xstat_cm_Results, cm_outFD)
struct xstat_cm_ProbeResults xstat_cm_Results;
FILE *cm_outFD;
{
/* Ptr to authentication stats */
struct afs_stats_AuthentInfo *authentP;
/* Ptr to access stats */
struct afs_stats_AccessInfo *accessinfP;
/* Correct #longs */
static afs_int32 fullPerfLongs = (sizeof(struct afs_stats_CMFullPerf) >> 2);
/* # longs actually received */
afs_int32 numLongs;
/* Ptr to full perf info */
struct afs_stats_CMFullPerf *fullP;
/* Ptr to printable time string */
char *printableTime;
numLongs = xstat_cm_Results.data.AFSCB_CollData_len;
if (numLongs != fullPerfLongs) {
fprintf(cm_outFD,
" ** Data size mismatch in performance collection!\n");
fprintf(cm_outFD, " ** Expecting %d, got %d\n", fullPerfLongs,
numLongs);
return;
}
printableTime = ctime((time_t *) & (xstat_cm_Results.probeTime));
printableTime[strlen(printableTime) - 1] = '\0';
fullP = (struct afs_stats_CMFullPerf *)
(xstat_cm_Results.data.AFSCB_CollData_val);
fprintf(cm_outFD,
"AFSCB_XSTATSCOLL_FULL_PERF_INFO (coll %d) for CM %s\n[Probe %d, %s]\n\n",
xstat_cm_Results.collectionNumber,
xstat_cm_Results.connP->hostName, xstat_cm_Results.probeNum,
printableTime);
/*
* Print the overall numbers first, followed by all of the RPC numbers,
* then each of the other groupings.
*/
fprintf(cm_outFD,
"Overall Performance Info:\n-------------------------\n");
my_Print_cm_OverallPerfInfo(&(fullP->perf), cm_outFD);
fprintf(cm_outFD, "\n");
my_Print_cm_RPCPerfInfo(&(fullP->rpc), cm_outFD);
authentP = &(fullP->authent);
fprintf(cm_outFD, "\nAuthentication info:\n--------------------\n");
fprintf(cm_outFD,
"\t%d PAGS, %d records (%d auth, %d unauth), %d max in PAG, chain max: %d\n",
authentP->curr_PAGs, authentP->curr_Records,
authentP->curr_AuthRecords, authentP->curr_UnauthRecords,
authentP->curr_MaxRecordsInPAG, authentP->curr_LongestChain);
fprintf(cm_outFD, "\t%d PAG creations, %d tkt updates\n",
authentP->PAGCreations, authentP->TicketUpdates);
fprintf(cm_outFD,
"\t[HWMs: %d PAGS, %d records, %d max in PAG, chain max: %d]\n",
authentP->HWM_PAGs, authentP->HWM_Records,
authentP->HWM_MaxRecordsInPAG, authentP->HWM_LongestChain);
accessinfP = &(fullP->accessinf);
fprintf(cm_outFD,
"\n[Un]replicated accesses:\n------------------------\n");
fprintf(cm_outFD,
"\t%d unrep, %d rep, %d reps accessed, %d max reps/ref, %d first OK\n\n",
accessinfP->unreplicatedRefs, accessinfP->replicatedRefs,
accessinfP->numReplicasAccessed, accessinfP->maxReplicasPerRef,
accessinfP->refFirstReplicaOK);
/* There really isn't any authorship info
* authorP = &(fullP->author); */
} /* my_Print_cm_FullPerfInfo() */
/*
* from src/afsmonitor/afsmon-output.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_afsmon_cmOutput(a_outfile, a_detOutput, xstat_cm_Results)
char *a_outfile; /* ptr to output file name */
int a_detOutput; /* detailed output ? */
struct xstat_cm_ProbeResults xstat_cm_Results;
{
char *printTime = 0; /* ptr to time string */
char *hostname = 0; /* fileserner name */
afs_int32 numLongs = 0; /* longwords in result */
afs_int32 *currLong = 0; /* ptr to longwords in result */
int i = 0;
FILE *cm_outFD = 0;
cm_outFD = fopen(a_outfile, "a");
if (cm_outFD == (FILE *) NULL) {
warn("failed to open output file %s", a_outfile);
return;
}
/* get the probe time and strip the \n at the end */
printTime = ctime((time_t *) & (xstat_cm_Results.probeTime));
printTime[strlen(printTime) - 1] = '\0';
hostname = xstat_cm_Results.connP->hostName;
/* print "time hostname CM" prefix */
fprintf(cm_outFD, "\n%s %s CM ", printTime, hostname);
/* if probe failed print -1 and vanish */
if (xstat_cm_Results.probeOK) {
fprintf(cm_outFD, "-1\n");
fclose(cm_outFD);
return;
}
/* print out the probe information as long words */
numLongs = xstat_cm_Results.data.AFSCB_CollData_len;
currLong = (afs_int32 *) (xstat_cm_Results.data.AFSCB_CollData_val);
for (i = 0; i < numLongs; i++) {
fprintf(cm_outFD, "%d ", *currLong++);
}
fprintf(cm_outFD, "\n\n");
/* print detailed information */
if (a_detOutput) {
my_Print_cm_FullPerfInfo(xstat_cm_Results, cm_outFD);
fflush(cm_outFD);
}
fclose(cm_outFD);
} /* my_afsmon_cmOutput() */
/*
* unchanged except for removing debugging print statements at beginning, and one
* correction (replacing xstat_cm_Results with a_cmResults)
*
* from src/afsmonitor/afsmonitor.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_cm_Results_ltoa(a_cmData, a_cmResults)
struct cm_Display_Data *a_cmData; /* target buffer */
struct xstat_cm_ProbeResults *a_cmResults; /* ptr to xstat cm Results */
{
struct afs_stats_CMFullPerf *fullP; /* ptr to complete CM stats */
afs_int32 *srcbuf;
afs_int32 *tmpbuf;
int i, j;
int idx;
afs_int32 numLongs;
fullP = (struct afs_stats_CMFullPerf *)
(a_cmResults->data.AFSCB_CollData_val);
/* There are 4 parts to CM statistics
* - Overall performance statistics (including up/down statistics)
* - This CMs FS RPC operations info
* - This CMs FS RPC errors info
* - This CMs FS transfers info
* - Authentication info
* - [Un]Replicated access info
*/
/* copy overall performance statistics */
srcbuf = (afs_int32 *) & (fullP->perf);
idx = 0;
/* we skip the 19 entry, ProtServAddr, so the index must account for this */
for (i = 0; i < NUM_AFS_STATS_CMPERF_LONGS + 1; i++) {
if (i == 19) {
srcbuf++;
continue; /* skip ProtServerAddr */
}
sprintf(a_cmData->data[idx], "%d", *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* server up/down statistics */
/* copy file server up/down stats */
srcbuf = (afs_int32 *) (fullP->perf.fs_UpDown);
numLongs =
2 * (sizeof(struct afs_stats_SrvUpDownInfo) / sizeof(afs_int32));
for (i = 0; i < numLongs; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy volume location server up/down stats */
srcbuf = (afs_int32 *) (fullP->perf.vl_UpDown);
numLongs =
2 * (sizeof(struct afs_stats_SrvUpDownInfo) / sizeof(afs_int32));
for (i = 0; i < numLongs; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy CMs individual FS RPC operations info */
srcbuf = (afs_int32 *) (fullP->rpc.fsRPCTimes);
for (i = 0; i < AFS_STATS_NUM_FS_RPC_OPS; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numOps */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numSuccesses */
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sum time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* min time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* max time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy CMs individual FS RPC errors info */
srcbuf = (afs_int32 *) (fullP->rpc.fsRPCErrors);
for (i = 0; i < AFS_STATS_NUM_FS_RPC_OPS; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* server */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* network */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* prot */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* vol */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* busies */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* other */
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy CMs individual RPC transfers info */
srcbuf = (afs_int32 *) (fullP->rpc.fsXferTimes);
for (i = 0; i < AFS_STATS_NUM_FS_XFER_OPS; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numOps */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numSuccesses */
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sum time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* min time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* max time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* sum bytes */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* min bytes */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* max bytes */
idx++;
srcbuf++;
for (j = 0; j < AFS_STATS_NUM_XFER_BUCKETS; j++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* bucket[j] */
idx++;
srcbuf++;
}
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy CM operations timings */
srcbuf = (afs_int32 *) (fullP->rpc.cmRPCTimes);
for (i = 0; i < AFS_STATS_NUM_CM_RPC_OPS; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numOps */
idx++;
srcbuf++;
sprintf(a_cmData->data[idx], "%d", *srcbuf); /* numSuccesses */
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sum time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* sqr time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* min time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
tmpbuf = srcbuf++; /* max time */
sprintf(a_cmData->data[idx], "%d.%06d", *tmpbuf, *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy authentication info */
srcbuf = (afs_int32 *) & (fullP->authent);
numLongs = sizeof(struct afs_stats_AuthentInfo) / sizeof(afs_int32);
for (i = 0; i < numLongs; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
/* copy CM [un]replicated access info */
srcbuf = (afs_int32 *) & (fullP->accessinf);
numLongs = sizeof(struct afs_stats_AccessInfo) / sizeof(afs_int32);
for (i = 0; i < numLongs; i++) {
sprintf(a_cmData->data[idx], "%d", *srcbuf);
idx++;
srcbuf++;
}
/*printf("Ending index value = %d\n",idx-1); */
return (0);
} /* my_cm_Results_ltoa() */
/* cm_Results_to_Hash() */
void
cm_Results_to_Hash(struct cm_Display_Data *cmData, HV *HOSTINFO,
short *showFlags, int showDefault)
{
int secidx;
int grpidx;
int numgrp;
int fromidx;
int toidx;
char section[CFG_STR_LEN] = "";
char group[CFG_STR_LEN] = "";
HV *ENTRY;
HV *GROUP;
HV *SECTION;
int i;
secidx = 0;
grpidx = secidx + 1;
while (secidx < CM_NUM_DATA_CATEGORIES) {
sscanf(cm_categories[secidx], "%s %d", section, &numgrp);
SECTION = newHV();
while (grpidx <= secidx + numgrp) {
GROUP = newHV();
sscanf(cm_categories[grpidx], "%s %d %d", group, &fromidx, &toidx);
for (i = fromidx; i <= toidx; i++) {
if (showFlags[i] || showDefault) {
ENTRY = newHV();
hv_store(ENTRY, "value", 5, newSVnv(atof(cmData->data[i])), 0);
hv_store(GROUP, cm_varNames[i], strlen(cm_varNames[i]),
newRV_inc((SV *) ENTRY), 0);
}
}
if (HvKEYS(GROUP))
hv_store(SECTION, group, strlen(group), newRV_inc((SV *) GROUP),
0);
grpidx++;
}
if (HvKEYS(SECTION))
hv_store(HOSTINFO, section, strlen(section),
newRV_inc((SV *) SECTION), 0);
secidx += numgrp + 1;
grpidx = secidx + 1;
}
} /* cm_Results_to_Hash() */
/*
* from src/afsmonitor/afsmonitor.c:
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_save_CM_data_forDisplay(a_cmResults, HOSTINFO, numCM, CMnameList,
cm_showFlags, cm_showDefault, buffer)
struct xstat_cm_ProbeResults *a_cmResults;
HV *HOSTINFO;
int numCM;
struct afsmon_hostEntry *CMnameList;
short *cm_showFlags;
int cm_showDefault;
char *buffer;
{
struct cm_Display_Data *curr_cmDataP;
struct afsmon_hostEntry *curr_host = 0;
int i = 0;
int code = 0;
int done = 0;
char buff2[256] = "";
curr_cmDataP =
(struct cm_Display_Data *)malloc(sizeof(struct cm_Display_Data));
if (curr_cmDataP == (struct cm_Display_Data *) NULL) {
sprintf(buffer, "Memory allocation failure");
return (-10);
}
memset(curr_cmDataP, 0, sizeof(struct cm_Display_Data));
hv_store(HOSTINFO, "hostName", 8, newSVpv(a_cmResults->connP->hostName, 0),
0);
/* Check the status of the probe. If it succeeded, we store its
* results in the display data structure. If it failed we only mark
* the failed status in the display data structure. */
if (a_cmResults->probeOK) { /* 1 => notOK the xstat results */
hv_store(HOSTINFO, "probeOK", 7, newSViv(0), 0);
}
else { /* probe succeeded, update display data structures */
hv_store(HOSTINFO, "probeOK", 7, newSViv(1), 0);
my_cm_Results_ltoa(curr_cmDataP, a_cmResults);
cm_Results_to_Hash(curr_cmDataP, HOSTINFO, cm_showFlags,
cm_showDefault);
done = 0;
curr_host = CMnameList;
for (i = 0; i < numCM; i++) {
if (strcasecmp(curr_host->hostName, a_cmResults->connP->hostName)
== 0) {
done = 1;
break;
}
curr_host = curr_host->next;;
}
if (!done) {
sprintf(buffer, "Error storing results for CM host %s (100)",
a_cmResults->connP->hostName);
return (100);
}
code = my_check_thresholds(curr_host, HOSTINFO, CM, buff2);
if (code) {
sprintf(buffer, "Error in checking thresholds (105) %s", buff2);
return (105);
}
}
return (0);
} /* my_save_CM_data_forDisplay() */
/*
* from src/afsmonitor/afsmonitor.c:
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_afsmon_CM_Handler(xstat_cm_Results, numCM, conn_idx, buffer, argp)
struct xstat_cm_ProbeResults xstat_cm_Results;
int numCM;
int conn_idx;
char *buffer;
va_list argp;
{
int code = 0;
char *outputfile = va_arg(argp, char *);
int detailed = va_arg(argp, int);
AV *CACHEMAN = va_arg(argp, AV *);
struct afsmon_hostEntry *CMnameList =
va_arg(argp, struct afsmon_hostEntry *);
short *cm_showFlags = va_arg(argp, short *);
int cm_showDefault = va_arg(argp, int);
HV *HOSTINFO = newHV();
if (outputfile) {
my_afsmon_cmOutput(outputfile, detailed, xstat_cm_Results);
}
/* add everything to data structure */
code =
my_save_CM_data_forDisplay(&xstat_cm_Results, HOSTINFO, numCM,
CMnameList, cm_showFlags, cm_showDefault,
buffer);
if (code) {
return (code);
}
/* Add HOSTINFO to CM */
av_store(CACHEMAN, conn_idx, newRV_inc((SV *) HOSTINFO));
return (0);
} /* my_afsmon_CM_Handler() */
/*
* from src/xstat/xstat_cm.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_cm_LWP(ProbeHandler, xstat_cm_ConnInfo, xstat_cm_numServers,
xstat_cm_collIDP, xstat_cm_numCollections, buffer, argp)
int (*ProbeHandler) ();
struct xstat_cm_ConnectionInfo *xstat_cm_ConnInfo;
int xstat_cm_numServers;
afs_int32 *xstat_cm_collIDP;
int xstat_cm_numCollections;
char *buffer;
va_list argp;
{
afs_int32 srvVersionNumber = 0; /*Xstat version # */
afs_int32 clientVersionNumber = AFSCB_XSTAT_VERSION; /*Client xstat version */
afs_int32 *currCollIDP = 0;
int numColls = 0;
int conn_idx = 0;
struct xstat_cm_ConnectionInfo *curr_conn = 0;
char buff2[256] = "";
int code = 0;
int index = 0;
struct xstat_cm_ProbeResults xstat_cm_Results;
afs_int32 xstat_cmData[AFSCB_MAX_XSTAT_LONGS];
xstat_cm_Results.probeTime = 0;
xstat_cm_Results.connP = (struct xstat_cm_ConnectionInfo *) NULL;
xstat_cm_Results.collectionNumber = 0;
xstat_cm_Results.data.AFSCB_CollData_len = AFSCB_MAX_XSTAT_LONGS;
xstat_cm_Results.data.AFSCB_CollData_val = (afs_int32 *) xstat_cmData;
xstat_cm_Results.probeOK = 0;
curr_conn = xstat_cm_ConnInfo;
for (conn_idx = 0; conn_idx < xstat_cm_numServers; conn_idx++) {
/*
* Grab the statistics for the current File Server, if the
* connection is valid.
*/
if (curr_conn->rxconn != (struct rx_connection *) NULL) {
currCollIDP = xstat_cm_collIDP;
for (numColls = 0;
numColls < xstat_cm_numCollections; numColls++, currCollIDP++) {
/*
* Initialize the per-probe values.
*/
xstat_cm_Results.collectionNumber = *currCollIDP;
xstat_cm_Results.data.AFSCB_CollData_len = AFSCB_MAX_XSTAT_LONGS;
memset(xstat_cm_Results.data.AFSCB_CollData_val, 0,
AFSCB_MAX_XSTAT_LONGS * 4);
xstat_cm_Results.connP = curr_conn;
xstat_cm_Results.probeOK =
RXAFSCB_GetXStats(curr_conn->rxconn,
clientVersionNumber, *currCollIDP,
&srvVersionNumber,
&(xstat_cm_Results.probeTime),
&(xstat_cm_Results.data));
code =
ProbeHandler(xstat_cm_Results, xstat_cm_numServers, index,
buff2, argp);
index++;
if (code) {
sprintf(buffer, "Handler routine got error code %d. %s",
code, buff2);
return (code);
}
} /* For each collection */
} /*Valid Rx connection */
/*
* Advance the xstat_fs connection pointer.
*/
curr_conn++;
} /* For each xstat_cm connection */
return (0);
} /* my_xstat_cm_LWP() */
/*
* from src/xstat/xstat_cm.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_cm_Init(int (*ProbeHandler) (), int xstat_cm_numServers,
struct sockaddr_in *a_socketArray,
int xstat_cm_numCollections, afs_int32 * xstat_cm_collIDP,
char *buffer, ...)
{
int curr_srv = 0;
int conn_err = 0;
char *hostNameFound = "";
struct xstat_cm_ConnectionInfo *curr_conn = 0, *xstat_cm_ConnInfo = 0;
struct rx_securityClass *secobj = 0; /*Client security object */
char buff2[256] = "";
int code = 0;
va_list argp;
xstat_cm_ConnInfo = (struct xstat_cm_ConnectionInfo *)
malloc(xstat_cm_numServers * sizeof(struct xstat_cm_ConnectionInfo));
if (xstat_cm_ConnInfo == (struct xstat_cm_ConnectionInfo *) NULL) {
sprintf(buffer,
"Can't allocate %d connection info structs (%d bytes)",
xstat_cm_numServers,
(xstat_cm_numServers * sizeof(struct xstat_cm_ConnectionInfo)));
return (-1); /*No cleanup needs to be done yet */
}
code = rx_Init(htons(0));
if (code) {
sprintf(buffer, "Fatal error in rx_Init(), error=%d", code);
return (-1);
src/Monitor.xs view on Meta::CPAN
centry.netFid.Unique - 25);
continue;
}
if (((aint32 == 0) && !IsLocked(¢ry.lock)) ||
((aint32 == 2) && (centry.refCount == 0)) ||
((aint32 == 4) && (centry.callback == 0)))
continue;
/* otherwise print this entry */
hv_store(CENTRY, "cell", 4, newSViv(centry.cell), 0);
NETFID = newHV();
hv_store(NETFID, "Vnode", 5, newSViv(centry.netFid.Vnode), 0);
hv_store(NETFID, "Volume", 6, newSViv(centry.netFid.Volume), 0);
hv_store(NETFID, "Unique", 6, newSViv(centry.netFid.Unique), 0);
hv_store(CENTRY, "netFid", 6, newRV_inc((SV *) NETFID), 0);
#ifdef USE_GETCELLNAME
cellname = GetCellName(aconn, centry.cell);
if (cellname)
hv_store(CENTRY, "cellname", 8, newSVpv(cellname, 0), 0);
#endif
if (IsLocked(¢ry.lock)) {
LOCK = newHV();
my_PrintLock(¢ry.lock, LOCK);
hv_store(CENTRY, "lock", 4, newRV_inc((SV *) LOCK), 0);
}
hv_store(CENTRY, "Length", 6, newSViv(centry.Length), 0);
hv_store(CENTRY, "DataVersion", 11, newSViv(centry.DataVersion), 0);
hv_store(CENTRY, "refCount", 8, newSViv(centry.refCount), 0);
hv_store(CENTRY, "callback", 8, newSViv(centry.callback), 0);
hv_store(CENTRY, "cbExpires", 9, newSViv(centry.cbExpires), 0);
hv_store(CENTRY, "opens", 5, newSViv(centry.opens), 0);
hv_store(CENTRY, "writers", 7, newSViv(centry.writers), 0);
/* now display states */
hv_store(CENTRY, "mvstat", 6, newSViv(centry.mvstat), 0);
hv_store(CENTRY, "states", 6, newSViv(centry.states), 0);
av_store(CACHE_ENTRIES, i, newRV_inc((SV *) CENTRY));
}
return 0;
}
/*
* from src/venus/cmdebug.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
PrintCacheEntries64(struct rx_connection *aconn, int aint32,
AV *CACHE_ENTRIES, char *buffer)
{
register int i;
register afs_int32 code;
struct AFSDBCacheEntry64 centry;
char *cellname;
char *data_name;
HV *NETFID;
HV *CENTRY;
HV *LOCK;
for (i = 0; i < 10000; i++) {
code = RXAFSCB_GetCE64(aconn, i, ¢ry);
if (code) {
if (code == 1)
break;
sprintf(buffer, "cmdebug: failed to get cache entry %d (%s)\n", i,
error_message(code));
return code;
}
CENTRY = newHV();
hv_store(CENTRY, "addr", 4, newSViv(centry.addr), 0);
if (centry.addr == 0) {
/* PS output */
NETFID = newHV();
hv_store(NETFID, "Vnode", 5, newSViv(centry.netFid.Vnode), 0);
hv_store(NETFID, "Volume", 6, newSViv(centry.netFid.Volume), 0);
hv_store(NETFID, "Unique", 6, newSViv(centry.netFid.Unique-25), 0);
hv_store(CENTRY, "netFid", 6, newRV_inc((SV *) NETFID), 0);
av_store(CACHE_ENTRIES, i, newRV_inc((SV *) CENTRY));
continue;
}
if (((aint32 == 0) && !IsLocked(¢ry.lock)) ||
((aint32 == 2) && (centry.refCount == 0)) ||
((aint32 == 4) && (centry.callback == 0)))
continue;
/* otherwise print this entry */
hv_store(CENTRY, "cell", 4, newSViv(centry.cell), 0);
NETFID = newHV();
hv_store(NETFID, "Vnode", 5, newSViv(centry.netFid.Vnode), 0);
hv_store(NETFID, "Volume", 6, newSViv(centry.netFid.Volume), 0);
hv_store(NETFID, "Unique", 6, newSViv(centry.netFid.Unique), 0);
hv_store(CENTRY, "netFid", 6, newRV_inc((SV *) NETFID), 0);
#ifdef USE_GETCELLNAME
cellname = GetCellName(aconn, centry.cell);
if (cellname)
hv_store(CENTRY, "cellname", 8, newSVpv(cellname, 0), 0);
#endif
if (IsLocked(¢ry.lock)) {
LOCK = newHV();
my_PrintLock(¢ry.lock, LOCK);
hv_store(CENTRY, "lock", 4, newRV_inc((SV *) LOCK), 0);
}
hv_store(CENTRY, "Length", 6, newSViv(centry.Length), 0);
hv_store(CENTRY, "DataVersion", 11, newSViv(centry.DataVersion), 0);
hv_store(CENTRY, "refCount", 8, newSViv(centry.refCount), 0);
hv_store(CENTRY, "callback", 8, newSViv(centry.callback), 0);
hv_store(CENTRY, "cbExpires", 9, newSViv(centry.cbExpires), 0);
hv_store(CENTRY, "opens", 5, newSViv(centry.opens), 0);
hv_store(CENTRY, "writers", 7, newSViv(centry.writers), 0);
/* now display states */
if (centry.mvstat == 0)
data_name = "normal file";
else if (centry.mvstat == 1)
data_name = "mount point";
else if (centry.mvstat == 2)
data_name = "volume root";
else if (centry.mvstat == 3)
data_name = "directory";
else if (centry.mvstat == 4)
data_name = "symlink";
else if (centry.mvstat == 5)
data_name = "microsoft dfs link";
else if (centry.mvstat == 6)
data_name = "invalid link";
else
data_name = "bogus mvstat";
hv_store(CENTRY, "mvstat", 6, newSVpv(data_name, strlen(data_name)), 0);
data_name = "";
if (centry.states & 1)
sprintf(data_name, "%s, stat'd", data_name);
if (centry.states & 2)
sprintf(data_name, "%s, backup", data_name);
if (centry.states & 4)
sprintf(data_name, "%s, read-only", data_name);
if (centry.states & 8)
sprintf(data_name, "%s, mt pt valid", data_name);
if (centry.states & 0x10)
sprintf(data_name, "%s, pending core", data_name);
if (centry.states & 0x40)
sprintf(data_name, "%s, wait-for-store", data_name);
if (centry.states & 0x80)
sprintf(data_name, "%s, mapped", data_name);
hv_store(CENTRY, "states", 6, newSVpv(data_name, strlen(data_name)), 0);
av_store(CACHE_ENTRIES, i, newRV_inc((SV *) CENTRY));
}
return 0;
}
/*
* from src/venus/cmdebug.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_PrintCacheEntries(struct rx_connection *aconn, int aint32,
AV *CACHE_ENTRIES, char *buffer)
{
register afs_int32 code;
struct AFSDBCacheEntry64 centry64;
code = RXAFSCB_GetCE64(aconn, 0, ¢ry64);
if (code != RXGEN_OPCODE)
return PrintCacheEntries64(aconn, aint32, CACHE_ENTRIES, buffer);
else
return PrintCacheEntries32(aconn, aint32, CACHE_ENTRIES, buffer);
}
#endif /* ifdef OpenAFS_1_4 */
/* end of cmdebug helper functions */
/* udebug helper functions */
/*
* from src/ubik/ubik.h
*
*/
#define MAXSKEW 10
/*
* from src/ubik/udebug.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
static short
udebug_PortNumber(register char *aport)
{
register int tc;
register afs_int32 total;
total = 0;
while ((tc = *aport++)) {
if (tc < '0' || tc > '9')
return -1; /* bad port number */
total *= 10;
total += tc - (int)'0';
}
src/Monitor.xs view on Meta::CPAN
if (ts)
return ntohs(ts->s_port); /* returns it in host byte order */
len = strlen(aname);
if (strncmp(aname, "vlserver", len) == 0) {
return 7003;
} else if (strncmp(aname, "ptserver", len) == 0) {
return 7002;
} else if (strncmp(aname, "kaserver", len) == 0) {
return 7004;
} else if (strncmp(aname, "buserver", len) == 0) {
return 7021;
}
return (-1);
}
/* end of udebug helper functions */
/* scout helper functions */
/*
* from src/fsprobe/fsprobe.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
#define FSPROBE_CBPORT 7101
extern int RXAFSCB_ExecuteRequest();
int
my_fsprobe_LWP(fsprobe_numServers, fsprobe_ConnInfo, fsprobe_Results,
fsprobe_statsBytes, fsprobe_probeOKBytes,
scout_debugfd, RETVAL, buffer)
int fsprobe_numServers;
struct fsprobe_ConnectionInfo *fsprobe_ConnInfo;
struct fsprobe_ProbeResults *fsprobe_Results;
int fsprobe_statsBytes;
int fsprobe_probeOKBytes;
FILE *scout_debugfd;
AV *RETVAL;
char *buffer;
{
static char rn[] = "fsprobe_LWP"; /*Routine name */
register afs_int32 code = 0; /*Results of calls */
int conn_idx; /*Connection index */
struct fsprobe_ConnectionInfo *curr_conn; /*Current connection */
struct ProbeViceStatistics *curr_stats; /*Current stats region */
int *curr_probeOK; /*Current probeOK field */
int i;
if (scout_debugfd) {
fprintf(scout_debugfd, "[%s] Called\n", rn);
fprintf(scout_debugfd,
"[%s] Collecting data from %d connected servers\n", rn,
fsprobe_numServers);
fflush(scout_debugfd);
}
curr_conn = fsprobe_ConnInfo;
curr_stats = fsprobe_Results->stats;
curr_probeOK = fsprobe_Results->probeOK;
fsprobe_Results->probeNum++;
memset(fsprobe_Results->stats, 0, fsprobe_statsBytes);
memset(fsprobe_Results->probeOK, 0, fsprobe_probeOKBytes);
for (conn_idx = 0; conn_idx < fsprobe_numServers; conn_idx++) {
/*
* Grab the statistics for the current FileServer, if the
* connection is valid.
*/
if (scout_debugfd) {
fprintf(scout_debugfd, "[%s] Contacting server %s\n", rn,
curr_conn->hostName);
fflush(scout_debugfd);
}
if (curr_conn->rxconn != (struct rx_connection *) NULL) {
if (scout_debugfd) {
fprintf(scout_debugfd,
"[%s] Connection valid, calling RXAFS_GetStatistics\n",
rn);
fflush(scout_debugfd);
}
*curr_probeOK = RXAFS_GetStatistics(curr_conn->rxconn, (struct ViceStatistics *)curr_stats);
} /*Valid Rx connection */
/*
* Call the Volume Server too to get additional stats
*/
if (scout_debugfd) {
fprintf(scout_debugfd, "[%s] Contacting volume server %s\n", rn,
curr_conn->hostName);
fflush(scout_debugfd);
}
if (curr_conn->rxVolconn != (struct rx_connection *) NULL) {
char pname[10];
struct diskPartition partition;
if (scout_debugfd) {
fprintf(scout_debugfd,
"[%s] Connection valid, calling RXAFS_GetStatistics\n",
rn);
fflush(scout_debugfd);
}
for (i = 0; i < curr_conn->partCnt; i++) {
if (curr_conn->partList.partFlags[i] & PARTVALID) {
MapPartIdIntoName(curr_conn->partList.partId[i], pname);
code =
AFSVolPartitionInfo(curr_conn->rxVolconn, pname,
&partition);
if (code) {
sprintf(buffer,
"Could not get information on server %s partition %s",
curr_conn->hostName, pname);
}
src/Monitor.xs view on Meta::CPAN
newSViv(a_ovP->vcache_S_Allocs), 0);
hv_store(DATA, "vcache_S_Gets", strlen("vcache_S_Gets"),
newSViv(a_ovP->vcache_S_Gets), 0);
hv_store(DATA, "vcache_S_Reads", strlen("vcache_S_Reads"),
newSViv(a_ovP->vcache_S_Reads), 0);
hv_store(DATA, "vcache_S_Writes", strlen("vcache_S_Writes"),
newSViv(a_ovP->vcache_S_Writes), 0);
hv_store(DATA, "vcache_H_Entries", strlen("vcache_H_Entries"),
newSViv(a_ovP->vcache_H_Entries), 0);
hv_store(DATA, "vcache_H_Gets", strlen("vcache_H_Gets"),
newSViv(a_ovP->vcache_H_Gets), 0);
hv_store(DATA, "vcache_H_Replacements", strlen("vcache_H_Replacements"),
newSViv(a_ovP->vcache_H_Replacements), 0);
/*
* Directory package section.
*/
hv_store(DATA, "dir_Buffers", strlen("dir_Buffers"),
newSViv(a_ovP->dir_Buffers), 0);
hv_store(DATA, "dir_Calls", strlen("dir_Calls"),
newSViv(a_ovP->dir_Calls), 0);
hv_store(DATA, "dir_IOs", strlen("dir_IOs"), newSViv(a_ovP->dir_IOs), 0);
/*
* Rx section.
*/
hv_store(DATA, "rx_packetRequests", strlen("rx_packetRequests"),
newSViv(a_ovP->rx_packetRequests), 0);
hv_store(DATA, "rx_noPackets_RcvClass", strlen("rx_noPackets_RcvClass"),
newSViv(a_ovP->rx_noPackets_RcvClass), 0);
hv_store(DATA, "rx_noPackets_SendClass", strlen("rx_noPackets_SendClass"),
newSViv(a_ovP->rx_noPackets_SendClass), 0);
hv_store(DATA, "rx_noPackets_SpecialClass",
strlen("rx_noPackets_SpecialClass"),
newSViv(a_ovP->rx_noPackets_SpecialClass), 0);
hv_store(DATA, "rx_socketGreedy", strlen("rx_socketGreedy"),
newSViv(a_ovP->rx_socketGreedy), 0);
hv_store(DATA, "rx_bogusPacketOnRead", strlen("rx_bogusPacketOnRead"),
newSViv(a_ovP->rx_bogusPacketOnRead), 0);
hv_store(DATA, "rx_bogusHost", strlen("rx_bogusHost"),
newSViv(a_ovP->rx_bogusHost), 0);
hv_store(DATA, "rx_noPacketOnRead", strlen("rx_noPacketOnRead"),
newSViv(a_ovP->rx_noPacketOnRead), 0);
hv_store(DATA, "rx_noPacketBuffersOnRead",
strlen("rx_noPacketBuffersOnRead"),
newSViv(a_ovP->rx_noPacketBuffersOnRead), 0);
hv_store(DATA, "rx_selects", strlen("rx_selects"),
newSViv(a_ovP->rx_selects), 0);
hv_store(DATA, "rx_sendSelects", strlen("rx_sendSelects"),
newSViv(a_ovP->rx_sendSelects), 0);
hv_store(DATA, "rx_packetsRead_RcvClass",
strlen("rx_packetsRead_RcvClass"),
newSViv(a_ovP->rx_packetsRead_RcvClass), 0);
hv_store(DATA, "rx_packetsRead_SendClass",
strlen("rx_packetsRead_SendClass"),
newSViv(a_ovP->rx_packetsRead_SendClass), 0);
hv_store(DATA, "rx_packetsRead_SpecialClass",
strlen("rx_packetsRead_SpecialClass"),
newSViv(a_ovP->rx_packetsRead_SpecialClass), 0);
hv_store(DATA, "rx_dataPacketsRead", strlen("rx_dataPacketsRead"),
newSViv(a_ovP->rx_dataPacketsRead), 0);
hv_store(DATA, "rx_ackPacketsRead", strlen("rx_ackPacketsRead"),
newSViv(a_ovP->rx_ackPacketsRead), 0);
hv_store(DATA, "rx_dupPacketsRead", strlen("rx_dupPacketsRead"),
newSViv(a_ovP->rx_dupPacketsRead), 0);
hv_store(DATA, "rx_spuriousPacketsRead", strlen("rx_spuriousPacketsRead"),
newSViv(a_ovP->rx_spuriousPacketsRead), 0);
hv_store(DATA, "rx_packetsSent_RcvClass",
strlen("rx_packetsSent_RcvClass"),
newSViv(a_ovP->rx_packetsSent_RcvClass), 0);
hv_store(DATA, "rx_packetsSent_SendClass",
strlen("rx_packetsSent_SendClass"),
newSViv(a_ovP->rx_packetsSent_SendClass), 0);
hv_store(DATA, "rx_packetsSent_SpecialClass",
strlen("rx_packetsSent_SpecialClass"),
newSViv(a_ovP->rx_packetsSent_SpecialClass), 0);
hv_store(DATA, "rx_ackPacketsSent", strlen("rx_ackPacketsSent"),
newSViv(a_ovP->rx_ackPacketsSent), 0);
hv_store(DATA, "rx_pingPacketsSent", strlen("rx_pingPacketsSent"),
newSViv(a_ovP->rx_pingPacketsSent), 0);
hv_store(DATA, "rx_abortPacketsSent", strlen("rx_abortPacketsSent"),
newSViv(a_ovP->rx_abortPacketsSent), 0);
hv_store(DATA, "rx_busyPacketsSent", strlen("rx_busyPacketsSent"),
newSViv(a_ovP->rx_busyPacketsSent), 0);
hv_store(DATA, "rx_dataPacketsSent", strlen("rx_dataPacketsSent"),
newSViv(a_ovP->rx_dataPacketsSent), 0);
hv_store(DATA, "rx_dataPacketsReSent", strlen("rx_dataPacketsReSent"),
newSViv(a_ovP->rx_dataPacketsReSent), 0);
hv_store(DATA, "rx_dataPacketsPushed", strlen("rx_dataPacketsPushed"),
newSViv(a_ovP->rx_dataPacketsPushed), 0);
hv_store(DATA, "rx_ignoreAckedPacket", strlen("rx_ignoreAckedPacket"),
newSViv(a_ovP->rx_ignoreAckedPacket), 0);
hv_store(DATA, "rx_totalRtt_Sec", strlen("rx_totalRtt_Sec"),
newSViv(a_ovP->rx_totalRtt_Sec), 0);
hv_store(DATA, "rx_totalRtt_Usec", strlen("rx_totalRtt_Usec"),
newSViv(a_ovP->rx_totalRtt_Usec), 0);
hv_store(DATA, "rx_minRtt_Sec", strlen("rx_minRtt_Sec"),
newSViv(a_ovP->rx_minRtt_Sec), 0);
hv_store(DATA, "rx_minRtt_Usec", strlen("rx_minRtt_Usec"),
newSViv(a_ovP->rx_minRtt_Usec), 0);
hv_store(DATA, "rx_maxRtt_Sec", strlen("rx_maxRtt_Sec"),
newSViv(a_ovP->rx_maxRtt_Sec), 0);
hv_store(DATA, "rx_maxRtt_Usec", strlen("rx_maxRtt_Usec"),
newSViv(a_ovP->rx_maxRtt_Usec), 0);
hv_store(DATA, "rx_nRttSamples", strlen("rx_nRttSamples"),
newSViv(a_ovP->rx_nRttSamples), 0);
hv_store(DATA, "rx_nServerConns", strlen("rx_nServerConns"),
newSViv(a_ovP->rx_nServerConns), 0);
hv_store(DATA, "rx_nClientConns", strlen("rx_nClientConns"),
newSViv(a_ovP->rx_nClientConns), 0);
hv_store(DATA, "rx_nPeerStructs", strlen("rx_nPeerStructs"),
newSViv(a_ovP->rx_nPeerStructs), 0);
hv_store(DATA, "rx_nCallStructs", strlen("rx_nCallStructs"),
newSViv(a_ovP->rx_nCallStructs), 0);
hv_store(DATA, "rx_nFreeCallStructs", strlen("rx_nFreeCallStructs"),
newSViv(a_ovP->rx_nFreeCallStructs), 0);
#ifndef NOAFS_XSTATSCOLL_CBSTATS
hv_store(DATA, "rx_nBusies", strlen("rx_nBusies"),
newSViv(a_ovP->rx_nBusies), 0);
hv_store(DATA, "fs_nBusies", strlen("fs_nBusies"),
newSViv(a_ovP->fs_nBusies), 0);
hv_store(DATA, "fs_GetCapabilities", strlen("fs_GetCapabilities"),
newSViv(a_ovP->fs_nGetCaps), 0);
#endif
/*
* Host module fields.
*/
hv_store(DATA, "host_NumHostEntries", strlen("host_NumHostEntries"),
newSViv(a_ovP->host_NumHostEntries), 0);
hv_store(DATA, "host_HostBlocks", strlen("host_HostBlocks"),
newSViv(a_ovP->host_HostBlocks), 0);
hv_store(DATA, "host_NonDeletedHosts", strlen("host_NonDeletedHosts"),
newSViv(a_ovP->host_NonDeletedHosts), 0);
hv_store(DATA, "host_HostsInSameNetOrSubnet",
strlen("host_HostsInSameNetOrSubnet"),
newSViv(a_ovP->host_HostsInSameNetOrSubnet), 0);
hv_store(DATA, "host_HostsInDiffSubnet", strlen("host_HostsInDiffSubnet"),
newSViv(a_ovP->host_HostsInDiffSubnet), 0);
hv_store(DATA, "host_HostsInDiffNetwork",
strlen("host_HostsInDiffNetwork"),
newSViv(a_ovP->host_HostsInDiffNetwork), 0);
hv_store(DATA, "host_NumClients", strlen("host_NumClients"),
newSViv(a_ovP->host_NumClients), 0);
hv_store(DATA, "host_ClientBlocks", strlen("host_ClientBlocks"),
newSViv(a_ovP->host_ClientBlocks), 0);
hv_store(DATA, "sysname_ID", strlen("sysname_ID"),
newSViv(a_ovP->sysname_ID), 0);
}
/*
* from src/xstat/xstat_fs_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_PrintCallInfo(struct xstat_fs_ProbeResults *xstat_fs_Results, HV *HOSTINFO)
{
int numInt32s;
afs_int32 *currInt32;
register int i;
char temp[100];
HV *DATA = newHV();
numInt32s = xstat_fs_Results->data.AFS_CollData_len;
hv_store(DATA, "AFS_CollData_len", 16, newSViv(numInt32s), 0);
currInt32 = (afs_int32 *) (xstat_fs_Results->data.AFS_CollData_val);
for (i = 0; i < numInt32s; i++) {
sprintf(temp, "%d", i);
hv_store(DATA, temp, strlen(temp), newSViv(*currInt32++), 0);
}
hv_store(HOSTINFO, "data", 4, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_fs_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_PrintPerfInfo(struct xstat_fs_ProbeResults *xstat_fs_Results, HV *HOSTINFO)
{
/* Correct # int32s to rcv */
static afs_int32 perfInt32s = (sizeof(struct afs_PerfStats) >> 2);
/* # int32words received */
afs_int32 numInt32s;
/* Ptr to performance stats */
struct afs_PerfStats *perfP;
HV *DATA = newHV();
numInt32s = xstat_fs_Results->data.AFS_CollData_len;
if (numInt32s != perfInt32s) {
warn("** Data size mismatch in performance collection!");
warn("** Expecting %d, got %d\n", perfInt32s, numInt32s);
return;
}
perfP = (struct afs_PerfStats *)
(xstat_fs_Results->data.AFS_CollData_val);
my_PrintOverallPerfInfo(perfP, DATA);
hv_store(HOSTINFO, "data", 4, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_fs_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_fs_PrintFullPerfInfo(struct xstat_fs_ProbeResults *xstat_fs_Results, HV *HOSTINFO)
{
/* Correct # int32s to rcv */
static afs_int32 fullPerfInt32s = (sizeof(struct fs_stats_FullPerfStats) >> 2);
/* # int32words received */
afs_int32 numInt32s;
/* Ptr to full perf stats */
struct fs_stats_FullPerfStats *fullPerfP;
HV *DATA = newHV();
numInt32s = xstat_fs_Results->data.AFS_CollData_len;
if (numInt32s != fullPerfInt32s) {
warn("** Data size mismatch in full performance collection!");
warn("** Expecting %d, got %d\n", fullPerfInt32s, numInt32s);
return;
}
fullPerfP = (struct fs_stats_FullPerfStats *)
(xstat_fs_Results->data.AFS_CollData_val);
my_PrintOverallPerfInfo(&(fullPerfP->overall), DATA);
my_PrintDetailedPerfInfo(&(fullPerfP->det), DATA);
hv_store(HOSTINFO, "data", 4, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_fs_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
static char *CbCounterStrings[] = {
"DeleteFiles",
"DeleteCallBacks",
"BreakCallBacks",
"AddCallBack",
"GotSomeSpaces",
"DeleteAllCallBacks",
"nFEs", "nCBs", "nblks",
"CBsTimedOut",
"nbreakers",
"GSS1", "GSS2", "GSS3", "GSS4", "GSS5"
};
/*
* from src/xstat/xstat_fs_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_fs_PrintCbCounters(struct xstat_fs_ProbeResults *xstat_fs_Results, HV *HOSTINFO)
{
int numInt32s = sizeof(CbCounterStrings)/sizeof(char *);
int i;
afs_uint32 *val = xstat_fs_Results->data.AFS_CollData_val;
HV *DATA = newHV();
if (numInt32s > xstat_fs_Results->data.AFS_CollData_len)
numInt32s = xstat_fs_Results->data.AFS_CollData_len;
for (i=0; i<numInt32s; i++) {
hv_store(DATA, CbCounterStrings[i], strlen(CbCounterStrings[i]), newSViv(val[i]), 0);
}
hv_store(HOSTINFO, "CbCounters", 10, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_fs_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_FS_Handler(xstat_fs_Results, xstat_fs_numServers, index, buffer,
argp)
struct xstat_fs_ProbeResults xstat_fs_Results;
int xstat_fs_numServers;
int index;
char *buffer;
va_list argp;
{
AV *RETVAL = va_arg(argp, AV *);
HV *HOSTINFO = newHV();
hv_store(HOSTINFO, "probeOK", 7, newSViv(xstat_fs_Results.probeOK ? 0 : 1),
0);
hv_store(HOSTINFO, "hostName", 8,
newSVpv(xstat_fs_Results.connP->hostName, 0), 0);
hv_store(HOSTINFO, "collectionNumber", 16,
newSViv(xstat_fs_Results.collectionNumber), 0);
hv_store(HOSTINFO, "probeTime", 9, newSViv(xstat_fs_Results.probeTime), 0);
if (xstat_fs_Results.probeOK == 0) {
switch (xstat_fs_Results.collectionNumber) {
case AFS_XSTATSCOLL_CALL_INFO:
my_PrintCallInfo(&xstat_fs_Results, HOSTINFO);
break;
case AFS_XSTATSCOLL_PERF_INFO:
my_PrintPerfInfo(&xstat_fs_Results, HOSTINFO);
break;
case AFS_XSTATSCOLL_FULL_PERF_INFO:
my_fs_PrintFullPerfInfo(&xstat_fs_Results, HOSTINFO);
break;
#ifndef NOAFS_XSTATSCOLL_CBSTATS
case AFS_XSTATSCOLL_CBSTATS:
my_fs_PrintCbCounters(&xstat_fs_Results, HOSTINFO);
break;
#endif
default:
sprintf(buffer, "** Unknown collection: %d",
xstat_fs_Results.collectionNumber);
return (-1);
}
}
av_store(RETVAL, index, newRV_inc((SV *) HOSTINFO));
return (0);
}
/* end of xstat_fs_test helper functions */
/* xstat_cm_test helper functions */
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_print_cmCallStats(struct xstat_cm_ProbeResults *xstat_cm_Results, HV *HOSTINFO)
{
struct afs_CMStats *cmp;
HV *DATA = newHV();
char *data_name;
cmp = (struct afs_CMStats *)(xstat_cm_Results->data.AFSCB_CollData_val);
data_name = "afs_init";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_init), 0);
data_name = "gop_rdwr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_gop_rdwr), 0);
data_name = "aix_gnode_rele";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_aix_gnode_rele), 0);
data_name = "gettimeofday";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_gettimeofday), 0);
data_name = "m_cpytoc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_m_cpytoc), 0);
data_name = "aix_vattr_null";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_aix_vattr_null), 0);
data_name = "afs_gn_frunc";
hv_store(DATA, "afs_gn_ftrunc", strlen("afs_gn_ftrunc"),
newSViv(cmp->callInfo.C_afs_gn_ftrunc), 0);
data_name = "afs_gn_rdwr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_rdwr), 0);
data_name = "afs_gn_ioctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_ioctl), 0);
data_name = "afs_gn_locktl";
hv_store(DATA, "afs_gn_lockctl", strlen("afs_gn_lockctl"),
newSViv(cmp->callInfo.C_afs_gn_lockctl), 0);
data_name = "afs_gn_readlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_readlink), 0);
data_name = "afs_gn_readdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_readdir), 0);
data_name = "afs_gn_select";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_select), 0);
data_name = "afs_gn_strategy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_strategy), 0);
data_name = "afs_gn_symlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_symlink), 0);
data_name = "afs_gn_revoke";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_revoke), 0);
data_name = "afs_gn_link";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_link), 0);
data_name = "afs_gn_mkdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_mkdir), 0);
data_name = "afs_gn_mknod";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_mknod), 0);
data_name = "afs_gn_remove";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_remove), 0);
data_name = "afs_gn_rename";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_rename), 0);
data_name = "afs_gn_rmdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_rmdir), 0);
data_name = "afs_gn_fid";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_fid), 0);
data_name = "afs_gn_lookup";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_lookup), 0);
data_name = "afs_gn_open";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_open), 0);
data_name = "afs_gn_create";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_create), 0);
data_name = "afs_gn_hold";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_hold), 0);
data_name = "afs_gn_rele";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_rele), 0);
data_name = "afs_gn_unmap";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_unmap), 0);
data_name = "afs_gn_access";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_access), 0);
data_name = "afs_gn_getattr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_getattr), 0);
data_name = "afs_gn_setattr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_setattr), 0);
data_name = "afs_gn_fclear";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_fclear), 0);
data_name = "afs_gn_fsync";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gn_fsync), 0);
data_name = "phash";
hv_store(DATA, "pHash", strlen("pHash"), newSViv(cmp->callInfo.C_pHash),
0);
data_name = "DInit";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_DInit), 0);
data_name = "DRead";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_DRead), 0);
data_name = "FixupBucket";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_FixupBucket), 0);
data_name = "afs_newslot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_newslot), 0);
data_name = "DRelease";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_DRelease), 0);
data_name = "DFlush";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_DFlush), 0);
data_name = "DFlushEntry";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_DFlushEntry), 0);
data_name = "DVOffset";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_DVOffset), 0);
data_name = "DZap";
hv_store(DATA, data_name, strlen(data_name), newSViv(cmp->callInfo.C_DZap),
0);
data_name = "DNew";
hv_store(DATA, data_name, strlen(data_name), newSViv(cmp->callInfo.C_DNew),
0);
data_name = "afs_RemoveVCB";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_RemoveVCB), 0);
data_name = "afs_NewVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_NewVCache), 0);
data_name = "afs_FlushActiveVcaches";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FlushActiveVcaches), 0);
data_name = "afs_VerifyVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_VerifyVCache), 0);
data_name = "afs_WriteVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_WriteVCache), 0);
data_name = "afs_GetVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetVCache), 0);
data_name = "afs_StuffVcache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_StuffVcache), 0);
data_name = "afs_FindVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FindVCache), 0);
data_name = "afs_PutDCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PutDCache), 0);
data_name = "afs_PutVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PutVCache), 0);
data_name = "CacheStoreProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_CacheStoreProc), 0);
data_name = "afs_FindDcache";
hv_store(DATA, "afs_FindDCache", strlen("afs_FindDCache"),
newSViv(cmp->callInfo.C_afs_FindDCache), 0);
data_name = "afs_TryToSmush";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_TryToSmush), 0);
data_name = "afs_AdjustSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_AdjustSize), 0);
data_name = "afs_CheckSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckSize), 0);
data_name = "afs_StoreWarn";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_StoreWarn), 0);
data_name = "CacheFetchProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_CacheFetchProc), 0);
data_name = "UFS_CacheStoreProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_UFS_CacheStoreProc), 0);
data_name = "UFS_CacheFetchProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_UFS_CacheFetchProc), 0);
data_name = "afs_GetDCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetDCache), 0);
data_name = "afs_SimpleVStat";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_SimpleVStat), 0);
data_name = "afs_ProcessFS";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ProcessFS), 0);
data_name = "afs_InitCacheInfo";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_InitCacheInfo), 0);
data_name = "afs_InitVolumeInfo";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_InitVolumeInfo), 0);
data_name = "afs_InitCacheFile";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_InitCacheFile), 0);
data_name = "afs_CacheInit";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CacheInit), 0);
data_name = "afs_GetDSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetDSlot), 0);
data_name = "afs_WriteThroughDSlots";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_WriteThroughDSlots), 0);
data_name = "afs_MemGetDSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemGetDSlot), 0);
data_name = "afs_UFSGetDSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_UFSGetDSlot), 0);
data_name = "afs_StoreDCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_StoreDCache), 0);
data_name = "afs_StoreMini";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_StoreMini), 0);
data_name = "afs_StoreAllSegments";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_StoreAllSegments), 0);
data_name = "afs_InvalidateAllSegments";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_InvalidateAllSegments), 0);
data_name = "afs_TruncateAllSegments";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_TruncateAllSegments), 0);
data_name = "afs_CheckVolSync";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckVolSync), 0);
data_name = "afs_wakeup";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_wakeup), 0);
data_name = "afs_CFileOpen";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CFileOpen), 0);
data_name = "afs_CFileTruncate";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CFileTruncate), 0);
data_name = "afs_GetDownD";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetDownD), 0);
data_name = "afs_WriteDCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_WriteDCache), 0);
data_name = "afs_FlushDCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FlushDCache), 0);
data_name = "afs_GetDownDSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetDownDSlot), 0);
data_name = "afs_FlushVCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FlushVCache), 0);
data_name = "afs_GetDownV";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetDownV), 0);
data_name = "afs_QueueVCB";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_QueueVCB), 0);
data_name = "afs_call";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_call), 0);
data_name = "afs_syscall_call";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syscall_call), 0);
data_name = "afs_syscall_icreate";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syscall_icreate), 0);
data_name = "afs_syscall_iopen";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syscall_iopen), 0);
data_name = "afs_syscall_iincdec";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syscall_iincdec), 0);
data_name = "afs_syscall_ireadwrite";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syscall_ireadwrite), 0);
data_name = "afs_syscall";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syscall), 0);
data_name = "lpioctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_lpioctl), 0);
data_name = "lsetpag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_lsetpag), 0);
data_name = "afs_CheckInit";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckInit), 0);
data_name = "ClearCallback";
hv_store(DATA, "ClearCallBack", strlen("ClearCallBack"),
newSViv(cmp->callInfo.C_ClearCallBack), 0);
data_name = "SRXAFSCB_GetCE";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_SRXAFSCB_GetCE), 0);
data_name = "SRXAFSCB_GetLock";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_SRXAFSCB_GetLock), 0);
data_name = "SRXAFSCB_CallBack";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_SRXAFSCB_CallBack), 0);
data_name = "SRXAFSCB_InitCallBackState";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_SRXAFSCB_InitCallBackState), 0);
data_name = "SRXAFSCB_Probe";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_SRXAFSCB_Probe), 0);
data_name = "afs_Chunk";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_Chunk), 0);
data_name = "afs_ChunkBase";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ChunkBase), 0);
data_name = "afs_ChunkOffset";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ChunkOffset), 0);
data_name = "afs_ChunkSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ChunkSize), 0);
data_name = "afs_ChunkToBase";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ChunkToBase), 0);
data_name = "afs_ChunkToSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ChunkToSize), 0);
data_name = "afs_SetChunkSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_SetChunkSize), 0);
data_name = "afs_config";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_config), 0);
data_name = "mem_freebytes";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_mem_freebytes), 0);
data_name = "mem_getbytes";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_mem_getbytes), 0);
data_name = "afs_Daemon";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_Daemon), 0);
data_name = "afs_CheckRootVolume";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckRootVolume), 0);
data_name = "BPath";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_BPath), 0);
data_name = "BPrefetch";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_BPrefetch), 0);
data_name = "BStore";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_BStore), 0);
data_name = "afs_BBusy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_BBusy), 0);
data_name = "afs_BQueue";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_BQueue), 0);
data_name = "afs_BRelease";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_BRelease), 0);
data_name = "afs_BackgroundDaemon";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_BackgroundDaemon), 0);
data_name = "exporter_add";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_exporter_add), 0);
data_name = "exporter_find";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_exporter_find), 0);
data_name = "afs_gfs_kalloc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gfs_kalloc), 0);
data_name = "afs_gfs_kfree";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gfs_kfree), 0);
data_name = "gop_lookupname";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_gop_lookupname), 0);
data_name = "afs_uniqtime";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_uniqtime), 0);
data_name = "gfs_vattr_null";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_gfs_vattr_null), 0);
data_name = "afs_lock";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_lock), 0);
data_name = "afs_unlock";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_unlock), 0);
data_name = "afs_update";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_update), 0);
data_name = "afs_gclose";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gclose), 0);
data_name = "afs_gopen";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gopen), 0);
data_name = "afs_greadlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_greadlink), 0);
data_name = "afs_select";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_select), 0);
data_name = "afs_gbmap";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gbmap), 0);
data_name = "afs_getfsdata";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_getfsdata), 0);
data_name = "afs_gsymlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gsymlink), 0);
data_name = "afs_namei";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_namei), 0);
data_name = "afs_gmount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gmount), 0);
data_name = "afs_gget";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gget), 0);
data_name = "afs_glink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_glink), 0);
data_name = "afs_gmkdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_gmkdir), 0);
data_name = "afs_unlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_unlink), 0);
data_name = "afs_grmdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_grmdir), 0);
data_name = "afs_makenode";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_makenode), 0);
data_name = "afs_grename";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_grename), 0);
data_name = "afs_rele";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_rele), 0);
data_name = "afs_syncgp";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_syncgp), 0);
data_name = "afs_getval";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_getval), 0);
data_name = "afs_trunc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_trunc), 0);
data_name = "afs_rwgp";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_rwgp), 0);
data_name = "afs_stat";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_stat), 0);
data_name = "afsc_link";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afsc_link), 0);
data_name = "afs_vfs_mount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_vfs_mount), 0);
data_name = "afs_uniqtime";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_uniqtime), 0);
data_name = "iopen";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_iopen), 0);
data_name = "idec";
hv_store(DATA, data_name, strlen(data_name), newSViv(cmp->callInfo.C_idec),
0);
data_name = "iinc";
hv_store(DATA, data_name, strlen(data_name), newSViv(cmp->callInfo.C_iinc),
0);
data_name = "ireadwrite";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_ireadwrite), 0);
data_name = "iread";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_iread), 0);
data_name = "iwrite";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_iwrite), 0);
data_name = "iforget";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_iforget), 0);
data_name = "icreate";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_icreate), 0);
data_name = "igetinode";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_igetinode), 0);
data_name = "osi_SleepR";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_SleepR), 0);
data_name = "osi_SleepS";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_SleepS), 0);
data_name = "osi_SleepW";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_SleepW), 0);
data_name = "osi_Sleep";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Sleep), 0);
data_name = "afs_LookupMCE";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_LookupMCE), 0);
data_name = "afs_MemReadBlk";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemReadBlk), 0);
data_name = "afs_MemReadUIO";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemReadUIO), 0);
data_name = "afs_MemWriteBlk";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemWriteBlk), 0);
data_name = "afs_MemWriteUIO";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemWriteUIO), 0);
data_name = "afs_MemCacheStoreProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemCacheStoreProc), 0);
data_name = "afs_MemCacheFetchProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemCacheFetchProc), 0);
data_name = "afs_MemCacheTruncate";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemCacheTruncate), 0);
data_name = "afs_MemCacheStoreProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemCacheStoreProc), 0);
data_name = "afs_GetNfsClientPag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetNfsClientPag), 0);
data_name = "afs_FindNfsClientPag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FindNfsClientPag), 0);
data_name = "afs_PutNfsClientPag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PutNfsClientPag), 0);
data_name = "afs_nfsclient_reqhandler";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nfsclient_reqhandler), 0);
data_name = "afs_nfsclient_GC";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nfsclient_GC), 0);
data_name = "afs_nfsclient_hold";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nfsclient_hold), 0);
data_name = "afs_nfsclient_stats";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nfsclient_stats), 0);
data_name = "afs_nfsclient_sysname";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nfsclient_sysname), 0);
data_name = "afs_rfs_dispatch";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_rfs_dispatch), 0);
data_name = "afs_nfs2afscall";
hv_store(DATA, "Nfs2AfsCall", strlen("Nfs2AfsCall"),
newSViv(cmp->callInfo.C_Nfs2AfsCall), 0);
data_name = "afs_sun_xuntext";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_sun_xuntext), 0);
data_name = "osi_Active";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Active), 0);
data_name = "osi_FlushPages";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_FlushPages), 0);
data_name = "osi_FlushText";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_FlushText), 0);
data_name = "osi_CallProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_CallProc), 0);
data_name = "osi_CancelProc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_CancelProc), 0);
data_name = "osi_Invisible";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Invisible), 0);
data_name = "osi_Time";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Time), 0);
data_name = "osi_Alloc";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Alloc), 0);
data_name = "osi_SetTime";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_SetTime), 0);
data_name = "osi_Dump";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Dump), 0);
data_name = "osi_Free";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Free), 0);
data_name = "osi_UFSOpen";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_UFSOpen), 0);
data_name = "osi_Close";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Close), 0);
data_name = "osi_Stat";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Stat), 0);
data_name = "osi_Truncate";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Truncate), 0);
data_name = "osi_Read";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Read), 0);
data_name = "osi_Write";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Write), 0);
data_name = "osi_MapStrategy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_MapStrategy), 0);
data_name = "osi_AllocLargeSpace";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_AllocLargeSpace), 0);
data_name = "osi_FreeLargeSpace";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_FreeLargeSpace), 0);
data_name = "osi_AllocSmallSpace";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_AllocSmallSpace), 0);
data_name = "osi_FreeSmallSpace";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_FreeSmallSpace), 0);
data_name = "osi_CloseToTheEdge";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_CloseToTheEdge), 0);
data_name = "osi_xgreedy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_xgreedy), 0);
data_name = "osi_FreeSocket";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_FreeSocket), 0);
data_name = "osi_NewSocket";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_NewSocket), 0);
data_name = "osi_NetSend";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_NetSend), 0);
data_name = "WaitHack";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_WaitHack), 0);
data_name = "osi_CancelWait";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_CancelWait), 0);
data_name = "osi_Wakeup";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Wakeup), 0);
data_name = "osi_Wait";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_osi_Wait), 0);
data_name = "dirp_Read";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_dirp_Read), 0);
data_name = "dirp_Cpy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_dirp_Cpy), 0);
data_name = "dirp_Eq";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_dirp_Eq), 0);
data_name = "dirp_Write";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_dirp_Write), 0);
data_name = "dirp_Zap";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_dirp_Zap), 0);
data_name = "afs_ioctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ioctl), 0);
data_name = "handleIoctl";
hv_store(DATA, "HandleIoctl", strlen("HandleIoctl"),
newSViv(cmp->callInfo.C_HandleIoctl), 0);
data_name = "afs_xioctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_xioctl), 0);
data_name = "afs_pioctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_pioctl), 0);
data_name = "HandlePioctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_HandlePioctl), 0);
data_name = "PGetVolumeStatus";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetVolumeStatus), 0);
data_name = "PSetVolumeStatus";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetVolumeStatus), 0);
data_name = "PFlush";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PFlush), 0);
data_name = "PFlushVolumeData";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PFlushVolumeData), 0);
data_name = "PNewStatMount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PNewStatMount), 0);
data_name = "PGetTokens";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetTokens), 0);
data_name = "PSetTokens";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetTokens), 0);
data_name = "PUnlog";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PUnlog), 0);
data_name = "PCheckServers";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PCheckServers), 0);
data_name = "PCheckAuth";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PCheckAuth), 0);
data_name = "PCheckVolNames";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PCheckVolNames), 0);
data_name = "PFindVolume";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PFindVolume), 0);
data_name = "Prefetch";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_Prefetch), 0);
data_name = "PGetCacheSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetCacheSize), 0);
data_name = "PSetCacheSize";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetCacheSize), 0);
data_name = "PSetSysName";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetSysName), 0);
data_name = "PExportAfs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PExportAfs), 0);
data_name = "HandleClientContext";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_HandleClientContext), 0);
data_name = "PViceAccess";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PViceAccess), 0);
data_name = "PRemoveCallBack";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PRemoveCallBack), 0);
data_name = "PRemoveMount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PRemoveMount), 0);
data_name = "PSetVolumeStatus";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetVolumeStatus), 0);
data_name = "PListCells";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PListCells), 0);
data_name = "PNewCell";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PNewCell), 0);
data_name = "PGetUserCell";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetUserCell), 0);
data_name = "PGetCellStatus";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetCellStatus), 0);
data_name = "PSetCellStatus";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetCellStatus), 0);
data_name = "PVenusLogging";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PVenusLogging), 0);
data_name = "PGetAcl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetAcl), 0);
data_name = "PGetFID";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetFID), 0);
data_name = "PSetAcl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetAcl), 0);
data_name = "PGetFileCell";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetFileCell), 0);
data_name = "PGetWSCell";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetWSCell), 0);
data_name = "PGetSPrefs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetSPrefs), 0);
data_name = "PSetSPrefs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetSPrefs), 0);
data_name = "afs_ResetAccessCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ResetAccessCache), 0);
data_name = "afs_FindUser";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FindUser), 0);
data_name = "afs_GetUser";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetUser), 0);
data_name = "afs_GCUserData";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GCUserData), 0);
data_name = "afs_PutUser";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PutUser), 0);
data_name = "afs_SetPrimary";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_SetPrimary), 0);
data_name = "afs_ResetUserConns";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ResetUserConns), 0);
data_name = "afs_RemoveUserConns";
hv_store(DATA, "RemoveUserConns", strlen("RemoveUserConns"),
newSViv(cmp->callInfo.C_RemoveUserConns), 0);
data_name = "afs_ResourceInit";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ResourceInit), 0);
data_name = "afs_GetCell";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetCell), 0);
data_name = "afs_GetCellByIndex";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetCellByIndex), 0);
data_name = "afs_GetCellByName";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetCellByName), 0);
#ifdef GETREALCELLBYINDEX
data_name = "afs_GetRealCellByIndex";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetRealCellByIndex), 0);
#endif
data_name = "afs_NewCell";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_NewCell), 0);
data_name = "CheckVLDB";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_CheckVLDB), 0);
data_name = "afs_GetVolume";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetVolume), 0);
data_name = "afs_PutVolume";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PutVolume), 0);
data_name = "afs_GetVolumeByName";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetVolumeByName), 0);
data_name = "afs_random";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_random), 0);
data_name = "InstallVolumeEntry";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_InstallVolumeEntry), 0);
data_name = "InstallVolumeInfo";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_InstallVolumeInfo), 0);
data_name = "afs_ResetVolumeInfo";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ResetVolumeInfo), 0);
data_name = "afs_FindServer";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FindServer), 0);
data_name = "afs_GetServer";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetServer), 0);
data_name = "afs_SortServers";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_SortServers), 0);
data_name = "afs_CheckServers";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckServers), 0);
data_name = "ServerDown";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_ServerDown), 0);
data_name = "afs_Conn";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_Conn), 0);
data_name = "afs_PutConn";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PutConn), 0);
data_name = "afs_ConnByHost";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ConnByHost), 0);
data_name = "afs_ConnByMHosts";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ConnByMHosts), 0);
data_name = "afs_Analyze";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_Analyze), 0);
data_name = "afs_CheckLocks";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckLocks), 0);
data_name = "CheckVLServer";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_CheckVLServer), 0);
data_name = "afs_CheckCacheResets";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckCacheResets), 0);
data_name = "afs_CheckVolumeNames";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckVolumeNames), 0);
data_name = "afs_CheckCode";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CheckCode), 0);
data_name = "afs_CopyError";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CopyError), 0);
data_name = "afs_FinalizeReq";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FinalizeReq), 0);
data_name = "afs_GetVolCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetVolCache), 0);
data_name = "afs_GetVolSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetVolSlot), 0);
data_name = "afs_UFSGetVolSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_UFSGetVolSlot), 0);
data_name = "afs_MemGetVolSlot";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemGetVolSlot), 0);
data_name = "afs_WriteVolCache";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_WriteVolCache), 0);
data_name = "haveCallbacksfrom";
hv_store(DATA, "HaveCallBacksFrom", strlen("HaveCallBacksFrom"),
newSViv(cmp->callInfo.C_HaveCallBacksFrom), 0);
data_name = "afs_getpage";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_getpage), 0);
data_name = "afs_putpage";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_putpage), 0);
data_name = "afs_nfsrdwr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nfsrdwr), 0);
data_name = "afs_map";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_map), 0);
data_name = "afs_cmp";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_cmp), 0);
data_name = "afs_PageLeft";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_PageLeft), 0);
data_name = "afs_mount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_mount), 0);
data_name = "afs_unmount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_unmount), 0);
data_name = "afs_root";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_root), 0);
data_name = "afs_statfs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_statfs), 0);
data_name = "afs_sync";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_sync), 0);
data_name = "afs_vget";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_vget), 0);
data_name = "afs_index";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_index), 0);
data_name = "afs_setpag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_setpag), 0);
data_name = "genpag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_genpag), 0);
data_name = "getpag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_getpag), 0);
data_name = "genpag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_genpag), 0);
data_name = "afs_GetMariner";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetMariner), 0);
data_name = "afs_AddMarinerName";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_AddMarinerName), 0);
data_name = "afs_open";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_open), 0);
data_name = "afs_close";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_close), 0);
data_name = "afs_closex";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_closex), 0);
data_name = "afs_write";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_write), 0);
data_name = "afs_UFSwrite";
hv_store(DATA, "afs_UFSWrite", strlen("afs_UFSWrite"),
newSViv(cmp->callInfo.C_afs_UFSWrite), 0);
data_name = "afs_Memwrite";
hv_store(DATA, "afs_MemWrite", strlen("afs_MemWrite"),
newSViv(cmp->callInfo.C_afs_MemWrite), 0);
data_name = "afs_rdwr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_rdwr), 0);
data_name = "afs_read";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_read), 0);
data_name = "afs_UFSread";
hv_store(DATA, "afs_UFSRead", strlen("afs_UFSRead"),
newSViv(cmp->callInfo.C_afs_UFSRead), 0);
data_name = "afs_Memread";
hv_store(DATA, "afs_MemRead", strlen("afs_MemRead"),
newSViv(cmp->callInfo.C_afs_MemRead), 0);
data_name = "afs_CopyOutAttrs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_CopyOutAttrs), 0);
data_name = "afs_access";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_access), 0);
data_name = "afs_getattr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_getattr), 0);
data_name = "afs_setattr";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_setattr), 0);
data_name = "afs_VAttrToAS";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_VAttrToAS), 0);
data_name = "EvalMountPoint";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_EvalMountPoint), 0);
data_name = "afs_lookup";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_lookup), 0);
data_name = "afs_create";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_create), 0);
data_name = "afs_LocalHero";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_LocalHero), 0);
data_name = "afs_remove";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_remove), 0);
data_name = "afs_link";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_link), 0);
data_name = "afs_rename";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_rename), 0);
data_name = "afs_InitReq";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_InitReq), 0);
data_name = "afs_mkdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_mkdir), 0);
data_name = "afs_rmdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_rmdir), 0);
data_name = "afs_readdir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_readdir), 0);
data_name = "afs_read1dir";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_read1dir), 0);
data_name = "afs_readdir_move";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_readdir_move), 0);
data_name = "afs_readdir_iter";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_readdir_iter), 0);
data_name = "afs_symlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_symlink), 0);
data_name = "afs_HandleLink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_HandleLink), 0);
data_name = "afs_MemHandleLink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_MemHandleLink), 0);
data_name = "afs_UFSHandleLink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_UFSHandleLink), 0);
data_name = "HandleFlock";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_HandleFlock), 0);
data_name = "afs_readlink";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_readlink), 0);
data_name = "afs_fsync";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_fsync), 0);
data_name = "afs_inactive";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_inactive), 0);
data_name = "afs_ustrategy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_ustrategy), 0);
data_name = "afs_strategy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_strategy), 0);
data_name = "afs_bread";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_bread), 0);
data_name = "afs_brelse";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_brelse), 0);
data_name = "afs_bmap";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_bmap), 0);
data_name = "afs_fid";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_fid), 0);
data_name = "afs_FakeOpen";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FakeOpen), 0);
data_name = "afs_FakeClose";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_FakeClose), 0);
data_name = "afs_StoreOnLastReference";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_StoreOnLastReference), 0);
data_name = "afs_AccessOK";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_AccessOK), 0);
data_name = "afs_GetAccessBits";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_GetAccessBits), 0);
data_name = "afsio_copy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afsio_copy), 0);
data_name = "afsio_trim";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afsio_trim), 0);
data_name = "afsio_skip";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afsio_skip), 0);
data_name = "afs_page_read";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_page_read), 0);
data_name = "afs_page_write";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_page_write), 0);
data_name = "afs_page_read";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_page_read), 0);
data_name = "afs_get_groups_from_pag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_get_groups_from_pag), 0);
data_name = "afs_get_pag_from_groups";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_get_pag_from_groups), 0);
data_name = "AddPag";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_AddPag), 0);
data_name = "PagInCred";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PagInCred), 0);
data_name = "afs_getgroups";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_getgroups), 0);
data_name = "afs_page_in";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_page_in), 0);
data_name = "afs_page_out";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_page_out), 0);
data_name = "afs_AdvanceFD";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_AdvanceFD), 0);
data_name = "afs_lockf";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_lockf), 0);
data_name = "afs_xsetgroups";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_xsetgroups), 0);
data_name = "afs_nlinks";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_nlinks), 0);
data_name = "afs_lockctl";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_lockctl), 0);
data_name = "afs_xflock";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_xflock), 0);
data_name = "PGetCPrefs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PGetCPrefs), 0);
data_name = "PSetCPrefs";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PSetCPrefs), 0);
#ifdef AFS_HPUX_ENV
data_name = "afs_pagein";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_pagein), 0);
data_name = "afs_pageout";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_pageout), 0);
data_name = "afs_hp_strategy";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_afs_hp_strategy), 0);
#endif
data_name = "PFlushMount";
hv_store(DATA, data_name, strlen(data_name),
newSViv(cmp->callInfo.C_PFlushMount), 0);
hv_store(HOSTINFO, "data", 4, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_cm_PrintUpDownStats(struct afs_stats_SrvUpDownInfo *a_upDownP, AV *UPDOWN, int index)
{
HV *INFO = newHV();
AV *DOWNDURATIONS = newAV();
AV *DOWNINCIDENTS = newAV();
int i;
/*
* First, print the simple values.
*/
hv_store(INFO, "numTtlRecords", strlen("numTtlRecords"),
newSViv(a_upDownP->numTtlRecords), 0);
hv_store(INFO, "numUpRecords", strlen("numUpRecords"),
newSViv(a_upDownP->numUpRecords), 0);
hv_store(INFO, "numDownRecords", strlen("numDownRecords"),
newSViv(a_upDownP->numDownRecords), 0);
hv_store(INFO, "sumOfRecordAges", strlen("sumOfRecordAges"),
newSViv(a_upDownP->sumOfRecordAges), 0);
hv_store(INFO, "ageOfYoungestRecord", strlen("ageOfYoungestRecord"),
newSViv(a_upDownP->ageOfYoungestRecord), 0);
hv_store(INFO, "ageOfOldestRecord", strlen("ageOfOldestRecord"),
newSViv(a_upDownP->ageOfOldestRecord), 0);
hv_store(INFO, "numDowntimeIncidents", strlen("numDowntimeIncidents"),
newSViv(a_upDownP->numDowntimeIncidents), 0);
hv_store(INFO, "numRecordsNeverDown", strlen("numRecordsNeverDown"),
newSViv(a_upDownP->numRecordsNeverDown), 0);
hv_store(INFO, "maxDowntimesInARecord", strlen("maxDowntimesInARecord"),
newSViv(a_upDownP->maxDowntimesInARecord), 0);
hv_store(INFO, "sumOfDowntimes", strlen("sumOfDowntimes"),
newSViv(a_upDownP->sumOfDowntimes), 0);
hv_store(INFO, "shortestDowntime", strlen("shortestDowntime"),
newSViv(a_upDownP->shortestDowntime), 0);
hv_store(INFO, "longestDowntime", strlen("longestDowntime"),
newSViv(a_upDownP->longestDowntime), 0);
/*
* Now, print the array values.
*/
for (i = 0; i <= 6; i++) {
av_store(DOWNDURATIONS, i, newSViv(a_upDownP->downDurations[i]));
}
for (i = 0; i <= 5; i++) {
av_store(DOWNINCIDENTS, i, newSViv(a_upDownP->downIncidents[i]));
}
hv_store(INFO, "downDurations", 13, newRV_inc((SV *) DOWNDURATIONS), 0);
hv_store(INFO, "downIncidents", 13, newRV_inc((SV *) DOWNINCIDENTS), 0);
av_store(UPDOWN, index, newRV_inc((SV *) INFO));
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_cm_PrintOverallPerfInfo(struct afs_stats_CMPerf *a_ovP, HV *PERF)
{
char *data_name;
AV *FS_UPDOWN = newAV();
AV *VL_UPDOWN = newAV();
data_name = "numPerfCalls";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->numPerfCalls),
0);
data_name = "epoch";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->epoch), 0);
data_name = "numCellsVisible";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->numCellsVisible), 0);
data_name = "numCellsContacted";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->numCellsContacted), 0);
data_name = "dlocalAccesses";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->dlocalAccesses), 0);
data_name = "vlocalAccesses";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->vlocalAccesses), 0);
data_name = "dremoteAccesses";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->dremoteAccesses), 0);
data_name = "vremoteAccesses";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->vremoteAccesses), 0);
data_name = "cacheNumEntries";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheNumEntries), 0);
data_name = "cacheBlocksTotal";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheBlocksTotal), 0);
data_name = "cacheBlocksInUse";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheBlocksInUse), 0);
data_name = "cacheBlocksOrig";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheBlocksOrig), 0);
data_name = "cacheMaxDirtyChunks";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheMaxDirtyChunks), 0);
data_name = "cacheCurrDirtyChunks";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheCurrDirtyChunks), 0);
data_name = "dcacheHits";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->dcacheHits),
0);
data_name = "vcacheHits";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->vcacheHits),
0);
data_name = "dcacheMisses";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->dcacheMisses),
0);
data_name = "vcacheMisses";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->vcacheMisses),
0);
data_name = "cacheFilesReused";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->cacheFilesReused), 0);
data_name = "vcacheXAllocs";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->vcacheXAllocs),
0);
data_name = "dcacheXAllocs";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->dcacheXAllocs),
0);
data_name = "bufAlloced";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->bufAlloced),
0);
data_name = "bufHits";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->bufHits), 0);
data_name = "bufMisses";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->bufMisses), 0);
data_name = "bufFlushDirty";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->bufFlushDirty),
0);
data_name = "LargeBlocksActive";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->LargeBlocksActive), 0);
data_name = "LargeBlocksAlloced";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->LargeBlocksAlloced), 0);
data_name = "SmallBlocksActive";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->SmallBlocksActive), 0);
data_name = "SmallBlocksAlloced";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->SmallBlocksAlloced), 0);
data_name = "OutStandingMemUsage";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->OutStandingMemUsage), 0);
data_name = "OutStandingAllocs";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->OutStandingAllocs), 0);
data_name = "CallBackAlloced";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->CallBackAlloced), 0);
data_name = "CallBackFlushes";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->CallBackFlushes), 0);
data_name = "CallBackLoops";
hv_store(PERF, "cbloops", strlen("cbloops"), newSViv(a_ovP->cbloops), 0);
data_name = "srvRecords";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->srvRecords),
0);
data_name = "srvNumBuckets";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->srvNumBuckets),
0);
data_name = "srvMaxChainLength";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->srvMaxChainLength), 0);
data_name = "srvMaxChainLengthHWM";
hv_store(PERF, data_name, strlen(data_name),
newSViv(a_ovP->srvMaxChainLengthHWM), 0);
data_name = "srvRecordsHWM";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->srvRecordsHWM),
0);
data_name = "sysName_ID";
hv_store(PERF, data_name, strlen(data_name), newSViv(a_ovP->sysName_ID),
0);
my_cm_PrintUpDownStats(&(a_ovP->fs_UpDown[0]), FS_UPDOWN, 0);
my_cm_PrintUpDownStats(&(a_ovP->fs_UpDown[1]), FS_UPDOWN, 1);
my_cm_PrintUpDownStats(&(a_ovP->vl_UpDown[0]), VL_UPDOWN, 0);
my_cm_PrintUpDownStats(&(a_ovP->vl_UpDown[1]), VL_UPDOWN, 1);
hv_store(PERF, "fs_UpDown", 9, newRV_inc((SV *) FS_UPDOWN), 0);
hv_store(PERF, "vl_UpDown", 9, newRV_inc((SV *) VL_UPDOWN), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_cm_PrintOpTiming(a_opIdx, a_opNames, a_opTimeP, RPCTIMES)
int a_opIdx;
char *a_opNames[];
struct afs_stats_opTimingData *a_opTimeP;
HV *RPCTIMES;
{
HV *TIMES = newHV();
hv_store(TIMES, "numOps", 6, newSViv(a_opTimeP->numOps), 0);
hv_store(TIMES, "numSuccesses", 12, newSViv(a_opTimeP->numSuccesses), 0);
hv_store(TIMES, "sumTime", 7, newSVnv(a_opTimeP->sumTime.tv_sec
+
(a_opTimeP->sumTime.tv_usec /
1000000.0)), 0);
hv_store(TIMES, "sqrTime", 7,
newSVnv(a_opTimeP->sqrTime.tv_sec +
(a_opTimeP->sqrTime.tv_usec / 1000000.0)), 0);
hv_store(TIMES, "minTime", 7,
newSVnv(a_opTimeP->minTime.tv_sec +
(a_opTimeP->minTime.tv_usec / 1000000.0)), 0);
hv_store(TIMES, "maxTime", 7,
newSVnv(a_opTimeP->maxTime.tv_sec +
(a_opTimeP->maxTime.tv_usec / 1000000.0)), 0);
hv_store(RPCTIMES, a_opNames[a_opIdx], strlen(a_opNames[a_opIdx]),
newRV_inc((SV *) TIMES), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_cm_PrintErrInfo(a_opIdx, a_opNames, a_opErrP, RPCERRORS)
int a_opIdx;
char *a_opNames[];
src/Monitor.xs view on Meta::CPAN
void
my_PrintRPCPerfInfo(struct afs_stats_RPCOpInfo *a_rpcP, HV *RPC)
{
int currIdx;
HV *FSRPCTIMES = newHV();
HV *FSRPCERRORS = newHV();
HV *FSXFERTIMES = newHV();
HV *CMRPCTIMES = newHV();
for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++)
my_cm_PrintOpTiming(currIdx, fsOpNames, &(a_rpcP->fsRPCTimes[currIdx]),
FSRPCTIMES);
hv_store(RPC, "fsRPCTimes", 10, newRV_inc((SV *) FSRPCTIMES), 0);
for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_RPC_OPS; currIdx++)
my_cm_PrintErrInfo(currIdx, fsOpNames, &(a_rpcP->fsRPCErrors[currIdx]),
FSRPCERRORS);
hv_store(RPC, "fsRPCErrors", 11, newRV_inc((SV *) FSRPCERRORS), 0);
for (currIdx = 0; currIdx < AFS_STATS_NUM_FS_XFER_OPS; currIdx++)
my_cm_PrintXferTiming(currIdx, xferOpNames,
&(a_rpcP->fsXferTimes[currIdx]), FSXFERTIMES);
hv_store(RPC, "fsXferTimes", 11, newRV_inc((SV *) FSXFERTIMES), 0);
for (currIdx = 0; currIdx < AFS_STATS_NUM_CM_RPC_OPS; currIdx++)
my_cm_PrintOpTiming(currIdx, cmOpNames, &(a_rpcP->cmRPCTimes[currIdx]),
CMRPCTIMES);
hv_store(RPC, "cmRPCTimes", 10, newRV_inc((SV *) CMRPCTIMES), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_cm_PrintFullPerfInfo(struct xstat_cm_ProbeResults *xstat_cm_Results, HV *HOSTINFO)
{
/*Ptr to authentication stats */
struct afs_stats_AuthentInfo *authentP;
/*Ptr to access stats */
struct afs_stats_AccessInfo *accessinfP;
/*Correct #int32s */
static afs_int32 fullPerfInt32s = (sizeof(struct afs_stats_CMFullPerf) >> 2);
/*# int32s actually received */
afs_int32 numInt32s;
struct afs_stats_CMFullPerf *fullP;
HV *DATA = newHV();
HV *PERF = newHV();
HV *RPC = newHV();
HV *AUTHENT = newHV();
HV *ACCESSINF = newHV();
numInt32s = xstat_cm_Results->data.AFSCB_CollData_len;
if (numInt32s != fullPerfInt32s) {
warn("** Data size mismatch in performance collection!");
warn("** Expecting %d, got %d\n", fullPerfInt32s, numInt32s);
warn("** Version mismatch with Cache Manager\n");
return;
}
fullP = (struct afs_stats_CMFullPerf *)
(xstat_cm_Results->data.AFSCB_CollData_val);
my_cm_PrintOverallPerfInfo(&(fullP->perf), PERF);
hv_store(DATA, "perf", 4, newRV_inc((SV *) PERF), 0);
my_PrintRPCPerfInfo(&(fullP->rpc), RPC);
hv_store(DATA, "rpc", 3, newRV_inc((SV *) RPC), 0);
authentP = &(fullP->authent);
hv_store(AUTHENT, "curr_PAGs", 9, newSViv(authentP->curr_PAGs), 0);
hv_store(AUTHENT, "curr_Records", 12, newSViv(authentP->curr_Records), 0);
hv_store(AUTHENT, "curr_AuthRecords", 16,
newSViv(authentP->curr_AuthRecords), 0);
hv_store(AUTHENT, "curr_UnauthRecords", 18,
newSViv(authentP->curr_UnauthRecords), 0);
hv_store(AUTHENT, "curr_MaxRecordsInPAG", 20,
newSViv(authentP->curr_MaxRecordsInPAG), 0);
hv_store(AUTHENT, "curr_LongestChain", 17,
newSViv(authentP->curr_LongestChain), 0);
hv_store(AUTHENT, "PAGCreations", 12, newSViv(authentP->PAGCreations), 0);
hv_store(AUTHENT, "TicketUpdates", 13, newSViv(authentP->TicketUpdates),
0);
hv_store(AUTHENT, "HWM_PAGs", 8, newSViv(authentP->HWM_PAGs), 0);
hv_store(AUTHENT, "HWM_Records", 11, newSViv(authentP->HWM_Records), 0);
hv_store(AUTHENT, "HWM_MaxRecordsInPAG", 19,
newSViv(authentP->HWM_MaxRecordsInPAG), 0);
hv_store(AUTHENT, "HWM_LongestChain", 16,
newSViv(authentP->HWM_LongestChain), 0);
hv_store(DATA, "authent", 7, newRV_inc((SV *) AUTHENT), 0);
accessinfP = &(fullP->accessinf);
hv_store(ACCESSINF, "unreplicatedRefs", 16,
newSViv(accessinfP->unreplicatedRefs), 0);
hv_store(ACCESSINF, "replicatedRefs", 14,
newSViv(accessinfP->replicatedRefs), 0);
hv_store(ACCESSINF, "numReplicasAccessed", 19,
newSViv(accessinfP->numReplicasAccessed), 0);
hv_store(ACCESSINF, "maxReplicasPerRef", 17,
newSViv(accessinfP->maxReplicasPerRef), 0);
hv_store(ACCESSINF, "refFirstReplicaOK", 17,
newSViv(accessinfP->refFirstReplicaOK), 0);
hv_store(DATA, "accessinf", 9, newRV_inc((SV *) ACCESSINF), 0);
hv_store(HOSTINFO, "data", 4, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
void
my_cm_PrintPerfInfo(struct xstat_cm_ProbeResults *xstat_cm_Results, HV *HOSTINFO)
{
/*Correct # int32s to rcv */
static afs_int32 perfInt32s = (sizeof(struct afs_stats_CMPerf) >> 2);
/*# int32words received */
afs_int32 numInt32s;
/*Ptr to performance stats */
struct afs_stats_CMPerf *perfP;
HV *DATA = newHV();
numInt32s = xstat_cm_Results->data.AFSCB_CollData_len;
if (numInt32s != perfInt32s) {
warn("** Data size mismatch in performance collection!");
warn("** Expecting %d, got %d\n", perfInt32s, numInt32s);
warn("** Version mismatch with Cache Manager\n");
return;
}
perfP = (struct afs_stats_CMPerf *)
(xstat_cm_Results->data.AFSCB_CollData_val);
my_cm_PrintOverallPerfInfo(perfP, DATA);
hv_store(HOSTINFO, "data", 4, newRV_inc((SV *) DATA), 0);
}
/*
* from src/xstat/xstat_cm_test.c
* ("$Header: /afs/slac/g/scs/slur/Repository/AFSDebug/Debug/src/Monitor.xs,v 1.2 2006/07/05 22:25:10 alfw Exp $");
*/
int
my_xstat_CM_Handler(xstat_cm_Results, xstat_cm_numServers, index, buffer,
argp)
struct xstat_cm_ProbeResults xstat_cm_Results;
int xstat_cm_numServers;
int index;
char *buffer;
va_list argp;
{
AV *RETVAL = va_arg(argp, AV *);
HV *HOSTINFO = newHV();
hv_store(HOSTINFO, "probeOK", 7, newSViv(xstat_cm_Results.probeOK ? 0 : 1),
0);
hv_store(HOSTINFO, "hostName", 8,
newSVpv(xstat_cm_Results.connP->hostName, 0), 0);
hv_store(HOSTINFO, "collectionNumber", 16,
newSViv(xstat_cm_Results.collectionNumber), 0);
hv_store(HOSTINFO, "probeTime", 9, newSViv(xstat_cm_Results.probeTime), 0);
if (xstat_cm_Results.probeOK == 0) {
switch (xstat_cm_Results.collectionNumber) {
/* Why are so many things commented out? -EC */
case AFSCB_XSTATSCOLL_CALL_INFO:
/* Why was this commented out in 3.3 ? */
/* PrintCallInfo(); */
my_print_cmCallStats(&xstat_cm_Results, HOSTINFO);
break;
case AFSCB_XSTATSCOLL_PERF_INFO:
/* we will do nothing here */
/* PrintPerfInfo(); */
my_cm_PrintPerfInfo(&xstat_cm_Results, HOSTINFO);
break;
case AFSCB_XSTATSCOLL_FULL_PERF_INFO:
my_cm_PrintFullPerfInfo(&xstat_cm_Results, HOSTINFO);
break;
default:
sprintf(buffer, "** Unknown collection: %d",
xstat_cm_Results.collectionNumber);
return (-1);
}
}
av_store(RETVAL, index, newRV_inc((SV *) HOSTINFO));
return (0);
}
( run in 1.723 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )