Skip to content

Commit 126d795

Browse files
committed
Chase -CURRENT P_KTHREAD -> P_KPROC rename
1 parent 840de1c commit 126d795

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

photoproc.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ static const char rcsid[] = "$Id: photoproc.c,v 1.33 2010/04/23 12:19:35 gerlof
151151
#include <sys/user.h>
152152
extern kvm_t *kd;
153153
extern char filterkernel;
154+
155+
#if __FreeBSD_version < 1100097
156+
#define P_KPROC P_KTHREAD
157+
#endif
154158
#endif
155159

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

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

463467
if(pbase->ki_pid) {
464-
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KTHREAD)))
468+
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KPROC)))
465469
continue;
466470

467471
/*
@@ -574,7 +578,7 @@ countprocs(void)
574578
pbase = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc_all);
575579
for (i = nproc_all; --i >= 0; ++pbase) {
576580
if(pbase->ki_pid) {
577-
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KTHREAD)))
581+
if (filterkernel && ((pbase->ki_flag & P_SYSTEM ) || (pbase->ki_flag & P_KPROC)))
578582
continue;
579583
nr++;
580584
}
@@ -671,7 +675,7 @@ static int
671675
procstat(struct tstat *curtask, unsigned long long bootepoch, char isproc, struct kinfo_proc *pp)
672676
{
673677
if (isproc){
674-
if ((pp->ki_flag & P_SYSTEM ) || (pp->ki_flag & P_KTHREAD))
678+
if ((pp->ki_flag & P_SYSTEM ) || (pp->ki_flag & P_KPROC))
675679
/* kernel process, show with {name} */
676680
snprintf(curtask->gen.name,PNAMLEN-1, "{%s}", pp->ki_comm);
677681
else
@@ -687,11 +691,11 @@ procstat(struct tstat *curtask, unsigned long long bootepoch, char isproc, struc
687691
*/
688692
switch (PRI_BASE(pp->ki_pri.pri_class)) {
689693
case PRI_REALTIME:
690-
curtask->cpu.rtprio = ((pp->ki_flag & P_KTHREAD) ? pp->ki_pri.pri_native :
694+
curtask->cpu.rtprio = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native :
691695
pp->ki_pri.pri_user) - PRI_MIN_REALTIME;
692696
break;
693697
case PRI_IDLE:
694-
curtask->cpu.rtprio = ((pp->ki_flag & P_KTHREAD) ? pp->ki_pri.pri_native :
698+
curtask->cpu.rtprio = ((pp->ki_flag & P_KPROC) ? pp->ki_pri.pri_native :
695699
pp->ki_pri.pri_user) - PRI_MIN_IDLE;
696700
break;
697701
default:

0 commit comments

Comments
 (0)