Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
61bb649e
Commit
61bb649e
authored
Mar 27, 2018
by
Guy M. Broome
Committed by
Hisham Muhammad
Apr 06, 2018
Browse files
Solaris: remove unneeded accumulators for process and thread counting
parent
b8ec1c03
Changes
1
Show whitespace changes
Inline
Side-by-side
solaris/SolarisProcessList.c
View file @
61bb649e
...
@@ -381,8 +381,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -381,8 +381,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
prusage_t
_prusage
;
prusage_t
_prusage
;
char
filename
[
MAX_NAME
+
1
];
char
filename
[
MAX_NAME
+
1
];
FILE
*
fp
=
NULL
;
FILE
*
fp
=
NULL
;
uint64_t
addRunning
=
0
;
uint64_t
addTotal
=
0
;
struct
timeval
tv
;
struct
timeval
tv
;
struct
tm
date
;
struct
tm
date
;
...
@@ -397,8 +395,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -397,8 +395,6 @@ void ProcessList_goThroughEntries(ProcessList* this) {
// We always count the scheduler
// We always count the scheduler
this
->
kernelThreads
=
1
;
this
->
kernelThreads
=
1
;
while
((
entry
=
readdir
(
dir
))
!=
NULL
)
{
while
((
entry
=
readdir
(
dir
))
!=
NULL
)
{
addRunning
=
0
;
addTotal
=
0
;
name
=
entry
->
d_name
;
name
=
entry
->
d_name
;
pid
=
atoi
(
name
);
pid
=
atoi
(
name
);
proc
=
ProcessList_getProcess
(
this
,
pid
,
&
preExisting
,
(
Process_New
)
SolarisProcess_new
);
proc
=
ProcessList_getProcess
(
this
,
pid
,
&
preExisting
,
(
Process_New
)
SolarisProcess_new
);
...
@@ -497,6 +493,7 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -497,6 +493,7 @@ void ProcessList_goThroughEntries(ProcessList* this) {
sproc
->
poolid
=
_psinfo
.
pr_poolid
;
sproc
->
poolid
=
_psinfo
.
pr_poolid
;
sproc
->
contid
=
_psinfo
.
pr_contract
;
sproc
->
contid
=
_psinfo
.
pr_contract
;
}
}
if
(
proc
->
nlwp
>
1
)
{
if
(
proc
->
nlwp
>
1
)
{
ProcessList_enumerateLWPs
(
proc
,
name
,
this
,
tv
);
ProcessList_enumerateLWPs
(
proc
,
name
,
this
,
tv
);
}
}
...
@@ -505,22 +502,23 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -505,22 +502,23 @@ void ProcessList_goThroughEntries(ProcessList* this) {
if
(
sproc
->
kernel
&&
!
this
->
settings
->
hideKernelThreads
)
{
if
(
sproc
->
kernel
&&
!
this
->
settings
->
hideKernelThreads
)
{
this
->
kernelThreads
+=
proc
->
nlwp
;
this
->
kernelThreads
+=
proc
->
nlwp
;
addTotal
=
proc
->
nlwp
+
1
;
this
->
totalTasks
+
=
proc
->
nlwp
+
1
;
if
(
proc
->
state
==
'O'
)
addR
unning
++
;
if
(
proc
->
state
==
'O'
)
this
->
r
unning
Tasks
++
;
}
else
if
(
!
sproc
->
kernel
)
{
}
else
if
(
!
sproc
->
kernel
)
{
if
(
proc
->
state
==
'O'
)
addR
unning
++
;
if
(
proc
->
state
==
'O'
)
this
->
r
unning
Tasks
++
;
if
(
this
->
settings
->
hideUserlandThreads
)
{
if
(
this
->
settings
->
hideUserlandThreads
)
{
addTotal
++
;
this
->
totalTasks
++
;
}
else
{
}
else
{
this
->
userlandThreads
+=
proc
->
nlwp
;
this
->
userlandThreads
+=
proc
->
nlwp
;
addTotal
=
proc
->
nlwp
+
1
;
this
->
totalTasks
+
=
proc
->
nlwp
+
1
;
}
}
}
}
this
->
runningTasks
+=
addRunning
;
this
->
totalTasks
+=
addTotal
;
proc
->
updated
=
true
;
proc
->
updated
=
true
;
}
// while ((entry = readdir(dir)) != NULL)
}
// while ((entry = readdir(dir)) != NULL)
closedir
(
dir
);
closedir
(
dir
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment