Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add NRCORE/NRSIGKILL for container #270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deviate.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ deviattask(struct tstat *curtpres, unsigned long ntaskpres,
devstat->gen.excode |= ~(INT_MAX);

strcpy(devstat->gen.cmdline, prestat.gen.cmdline);
strcpy(devstat->gen.container, prestat.gen.container);

devstat->cpu.curcpu = -1;

Expand Down
8 changes: 8 additions & 0 deletions showgeneric.c
Original file line number Diff line number Diff line change
Expand Up @@ -2586,6 +2586,14 @@ accumulate(struct tstat *curproc, struct tstat *curstat)
curstat->gpu.nrgpus++;
}
}
} else {
if (curproc->gen.excode & 0xff)
{
if (curproc->gen.excode & 0x80)
curstat->gen.nthrslpi++; // coredump
else if ((curproc->gen.excode & 0x7f) == 9 )
curstat->gen.nthrslpu++; // sigkill
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion showlinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ proc_printdef *allprocpdefs[]=
&procprt_S,
&procprt_COMMAND_LINE,
&procprt_NPROCS,
&procprt_NRSIGKILL,
&procprt_NRCORE,
&procprt_RDDSK,
&procprt_WRDSK,
&procprt_CWRDSK,
Expand Down Expand Up @@ -1331,7 +1333,7 @@ priphead(int curlist, int totlist, char *showtype, char *showorder,
make_proc_prints(totconts, MAXITEMS,
"NPROCS:10 SYSCPU:9 USRCPU:9 VSIZE:6 "
"RSIZE:8 PSIZE:8 LOCKSZ:3 SWAPSZ:5 RDDSK:7 CWRDSK:7 "
"RNET:6 SNET:6 SORTITEM:10 CID:10",
"RNET:6 SNET:6 NRSIGKILL:8 NRCORE:8 SORTITEM:10 CID:10",
"built-in totconts");
}

Expand Down
2 changes: 2 additions & 0 deletions showlinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ extern proc_printdef procprt_CGRMEMMAX;
extern proc_printdef procprt_CGRMEMMAXR;
extern proc_printdef procprt_CGRSWPMAX;
extern proc_printdef procprt_CGRSWPMAXR;
extern proc_printdef procprt_NRSIGKILL;
extern proc_printdef procprt_NRCORE;


//extern char *procprt_NRDDSK_ae(struct tstat *, int, int);
Expand Down
26 changes: 26 additions & 0 deletions showprocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ char *procprt_CGRSWPMAX_e(struct tstat *, int, int);
char *procprt_CGRSWPMAXR_a(struct tstat *, int, int);
char *procprt_CGRSWPMAXR_e(struct tstat *, int, int);
char *procprt_SORTITEM_ae(struct tstat *, int, int);
char *procprt_NRSIGKILL_ae(struct tstat *, int, int);
char *procprt_NRCORE_ae(struct tstat *, int, int);


static char *columnhead[] = {
Expand Down Expand Up @@ -2528,3 +2530,27 @@ procprt_SORTITEM_ae(struct tstat *curstat, int avgval, int nsecs)

proc_printdef procprt_SORTITEM = // width is dynamically defined!
{ 0, "SORTITEM", procprt_SORTITEM_ae, procprt_SORTITEM_ae, 4};
/***************************************************************/
char *
procprt_NRSIGKILL_ae(struct tstat *curstat, int avgval, int nsecs)
{
static char buf[10];

val2valstr(curstat->gen.nthrslpu, buf, 6, 0, 0); // pid abused as proc counter
return buf;
}

proc_printdef procprt_NRSIGKILL = // width is dynamically defined!
{"NRSIGKILL", "NRSIGKILL", procprt_NRSIGKILL_ae, procprt_NRSIGKILL_ae, 4};
/***************************************************************/
char *
procprt_NRCORE_ae(struct tstat *curstat, int avgval, int nsecs)
{
static char buf[10];

val2valstr(curstat->gen.nthrslpi, buf, 6, 0, 0); // pid abused as proc counter
return buf;
}

proc_printdef procprt_NRCORE = // width is dynamically defined!
{"NRCORE", "NRCORE", procprt_NRCORE_ae, procprt_NRCORE_ae, 4};