mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
stats: add etherovf value (hw and software overflows on input queue)
This commit is contained in:
parent
22d3ade384
commit
c6a91038b1
1 changed files with 21 additions and 3 deletions
|
@ -56,6 +56,8 @@ enum
|
||||||
Link,
|
Link,
|
||||||
Out,
|
Out,
|
||||||
Err0,
|
Err0,
|
||||||
|
Overflows,
|
||||||
|
Soverflows,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Machine
|
struct Machine
|
||||||
|
@ -76,8 +78,8 @@ struct Machine
|
||||||
uvlong prevsysstat[10];
|
uvlong prevsysstat[10];
|
||||||
int nproc;
|
int nproc;
|
||||||
int lgproc;
|
int lgproc;
|
||||||
uvlong netetherstats[8];
|
uvlong netetherstats[9];
|
||||||
uvlong prevetherstats[8];
|
uvlong prevetherstats[9];
|
||||||
uvlong batterystats[2];
|
uvlong batterystats[2];
|
||||||
uvlong temp[10];
|
uvlong temp[10];
|
||||||
|
|
||||||
|
@ -114,6 +116,7 @@ enum Menu2
|
||||||
Methererr,
|
Methererr,
|
||||||
Metherin,
|
Metherin,
|
||||||
Metherout,
|
Metherout,
|
||||||
|
Metherovf,
|
||||||
Mfault,
|
Mfault,
|
||||||
Midle,
|
Midle,
|
||||||
Minintr,
|
Minintr,
|
||||||
|
@ -138,6 +141,7 @@ char *menu2str[Nmenu2+1] = {
|
||||||
"add ethererr",
|
"add ethererr",
|
||||||
"add etherin ",
|
"add etherin ",
|
||||||
"add etherout",
|
"add etherout",
|
||||||
|
"add etherovf",
|
||||||
"add fault ",
|
"add fault ",
|
||||||
"add idle ",
|
"add idle ",
|
||||||
"add inintr ",
|
"add inintr ",
|
||||||
|
@ -159,6 +163,7 @@ char *menu2str[Nmenu2+1] = {
|
||||||
void contextval(Machine*, uvlong*, uvlong*, int),
|
void contextval(Machine*, uvlong*, uvlong*, int),
|
||||||
etherval(Machine*, uvlong*, uvlong*, int),
|
etherval(Machine*, uvlong*, uvlong*, int),
|
||||||
ethererrval(Machine*, uvlong*, uvlong*, int),
|
ethererrval(Machine*, uvlong*, uvlong*, int),
|
||||||
|
etherovfval(Machine*, uvlong*, uvlong*, int),
|
||||||
etherinval(Machine*, uvlong*, uvlong*, int),
|
etherinval(Machine*, uvlong*, uvlong*, int),
|
||||||
etheroutval(Machine*, uvlong*, uvlong*, int),
|
etheroutval(Machine*, uvlong*, uvlong*, int),
|
||||||
faultval(Machine*, uvlong*, uvlong*, int),
|
faultval(Machine*, uvlong*, uvlong*, int),
|
||||||
|
@ -186,6 +191,7 @@ void (*newvaluefn[Nmenu2])(Machine*, uvlong*, uvlong*, int init) = {
|
||||||
ethererrval,
|
ethererrval,
|
||||||
etherinval,
|
etherinval,
|
||||||
etheroutval,
|
etheroutval,
|
||||||
|
etherovfval,
|
||||||
faultval,
|
faultval,
|
||||||
idleval,
|
idleval,
|
||||||
inintrval,
|
inintrval,
|
||||||
|
@ -796,7 +802,7 @@ needstat(int init)
|
||||||
int
|
int
|
||||||
needether(int init)
|
needether(int init)
|
||||||
{
|
{
|
||||||
return init | present[Mether] | present[Metherin] | present[Metherout] | present[Methererr];
|
return init | present[Mether] | present[Metherin] | present[Metherout] | present[Methererr] | present[Metherovf];
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1049,6 +1055,17 @@ ethererrval(Machine *m, uvlong *v, uvlong *vmax, int)
|
||||||
*vmax = (sleeptime/1000)*10;
|
*vmax = (sleeptime/1000)*10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
etherovfval(Machine *m, uvlong *v, uvlong *vmax, int)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
*v = 0;
|
||||||
|
for(i=Overflows; i<=Soverflows; i++)
|
||||||
|
*v += m->netetherstats[i]-m->prevetherstats[i];
|
||||||
|
*vmax = (sleeptime/1000)*10;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
batteryval(Machine *m, uvlong *v, uvlong *vmax, int)
|
batteryval(Machine *m, uvlong *v, uvlong *vmax, int)
|
||||||
{
|
{
|
||||||
|
@ -1413,6 +1430,7 @@ main(int argc, char *argv[])
|
||||||
addgraph(Metherin);
|
addgraph(Metherin);
|
||||||
addgraph(Metherout);
|
addgraph(Metherout);
|
||||||
addgraph(Methererr);
|
addgraph(Methererr);
|
||||||
|
addgraph(Metherovf);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
addgraph(Mtlbpurge);
|
addgraph(Mtlbpurge);
|
||||||
|
|
Loading…
Reference in a new issue