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
219bb9cc
Commit
219bb9cc
authored
Mar 28, 2011
by
Hisham Muhammad
Browse files
handle large values for process time
parent
391eab28
Changes
4
Hide whitespace changes
Inline
Side-by-side
Process.c
View file @
219bb9cc
...
...
@@ -103,10 +103,10 @@ typedef struct Process_ {
unsigned long int majflt;
unsigned long int cmajflt;
#endif
unsigned long int utime;
unsigned long int stime;
long int cutime;
long int cstime;
unsigned long
long
int utime;
unsigned long
long
int stime;
unsigned long
long int cutime;
unsigned long
long int cstime;
long int priority;
long int nice;
long int nlwp;
...
...
@@ -263,7 +263,7 @@ static void Process_printLargeNumber(Process* this, RichString* str, unsigned lo
static
double
jiffy
=
0
.
0
;
static
void
Process_printTime
(
RichString
*
str
,
unsigned
long
t
)
{
static
void
Process_printTime
(
RichString
*
str
,
unsigned
long
long
t
)
{
if
(
jiffy
==
0
.
0
)
jiffy
=
sysconf
(
_SC_CLK_TCK
);
double
jiffytime
=
1
.
0
/
jiffy
;
...
...
Process.h
View file @
219bb9cc
...
...
@@ -105,10 +105,10 @@ typedef struct Process_ {
unsigned
long
int
majflt
;
unsigned
long
int
cmajflt
;
#endif
unsigned
long
int
utime
;
unsigned
long
int
stime
;
long
int
cutime
;
long
int
cstime
;
unsigned
long
long
int
utime
;
unsigned
long
long
int
stime
;
unsigned
long
long
int
cutime
;
unsigned
long
long
int
cstime
;
long
int
priority
;
long
int
nice
;
long
int
nlwp
;
...
...
ProcessList.c
View file @
219bb9cc
...
...
@@ -344,7 +344,7 @@ static bool ProcessList_readStatFile(Process *process, const char* dirname, cons
"%c %d %u %u %u "
"%d %lu "
"%*u %*u %*u %*u "
"%lu %lu %l
d
%l
d
"
"%
l
lu %
l
lu %l
lu
%l
lu
"
"%ld %ld %ld "
"%*d %*u %*u %*d %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*u "
"%d %d"
,
...
...
htop.c
View file @
219bb9cc
...
...
@@ -427,8 +427,9 @@ int main(int argc, char** argv) {
refreshTimeout
--
;
if
(
prev
==
ch
&&
!
recalculate
)
{
closeTimeout
++
;
if
(
closeTimeout
==
10
)
if
(
closeTimeout
==
10
0
)
{
break
;
}
}
else
closeTimeout
=
0
;
continue
;
...
...
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