Skip to content

Commit

Permalink
Chase -CURRENT P_KTHREAD -> P_KPROC rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Apr 13, 2016
1 parent 840de1c commit 126d795
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions photoproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ static const char rcsid[] = "$Id: photoproc.c,v 1.33 2010/04/23 12:19:35 gerlof
#include <sys/user.h>
extern kvm_t *kd;
extern char filterkernel;

#if __FreeBSD_version < 1100097
#define P_KPROC P_KTHREAD
#endif
#endif

#include "atop.h"
Expand Down Expand Up @@ -394,7 +398,7 @@ proccmd(struct tstat *curtask, struct kinfo_proc *pp){

// enable display of long kernel processes
if (!strlen(string) &&
((pp->ki_flag & P_SYSTEM ) || (pp->ki_flag & P_KTHREAD)))
((pp->ki_flag & P_SYSTEM ) || (pp->ki_flag & P_KPROC)))
/* kernel process, show with {name} */
snprintf(curtask->gen.cmdline, CMDLEN-1, "{%s}", pp->ki_comm);
else
Expand Down Expand Up @@ -461,7 +465,7 @@ photoproc(struct tstat *tasklist, int maxtask)
for (i = nproc; --i >= 0; ++pbase) {

if(pbase->ki_pid) {
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KTHREAD)))
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KPROC)))
continue;

/*
Expand Down Expand Up @@ -574,7 +578,7 @@ countprocs(void)
pbase = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc_all);
for (i = nproc_all; --i >= 0; ++pbase) {
if(pbase->ki_pid) {
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KTHREAD)))
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KPROC)))
continue;
nr++;
}
Expand Down Expand Up @@ -671,7 +675,7 @@ static int
procstat(struct tstat *curtask, unsigned long long bootepoch, char isproc, struct kinfo_proc *pp)
{
if (isproc){
if ((pp->ki_flag & P_SYSTEM ) || (pp->ki_flag & P_KTHREAD))
if ((pp->ki_flag & P_SYSTEM ) || (pp->ki_flag & P_KPROC))
/* kernel process, show with {name} */
snprintf(curtask->gen.name,PNAMLEN-1, "{%s}", pp->ki_comm);
else
Expand All @@ -687,11 +691,11 @@ procstat(struct tstat *curtask, unsigned long long bootepoch, char isproc, struc
*/
switch (PRI_BASE(pp->ki_pri.pri_class)) {
case PRI_REALTIME:
curtask->cpu.rtprio = ((pp->ki_flag & P_KTHREAD) ? pp->ki_pri.pri_native :
curtask->cpu.rtprio = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native :
pp->ki_pri.pri_user) - PRI_MIN_REALTIME;
break;
case PRI_IDLE:
curtask->cpu.rtprio = ((pp->ki_flag & P_KTHREAD) ? pp->ki_pri.pri_native :
curtask->cpu.rtprio = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native :
pp->ki_pri.pri_user) - PRI_MIN_IDLE;
break;
default:
Expand Down

0 comments on commit 126d795

Please sign in to comment.