Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
e0209da8
Commit
e0209da8
authored
11 years ago
by
Hisham Muhammad
Browse files
Options
Download
Email Patches
Plain Diff
Support pagefaults stats. Closes #45.
parent
4e2c2d79
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ChangeLog
+1
-0
ChangeLog
Process.c
+6
-2
Process.c
Process.h
+1
-1
Process.h
ProcessList.c
+8
-4
ProcessList.c
with
16 additions
and
7 deletions
+16
-7
ChangeLog
View file @
e0209da8
...
...
@@ -10,6 +10,7 @@ What's new in version 1.0.3
of IO data depending on selected fields.
* Better consistency in coloring.
* Increase limit of buffer when tracing a deep nested process tree.
* Display pagefault stats.
* BUGFIX: Fix crash when adding meters and toggling detailed CPU time.
(thanks to Dawid Gajownik)
* Add column to track the OOM-killer score of processes
...
...
This diff is collapsed.
Click to expand it.
Process.c
View file @
e0209da8
...
...
@@ -168,11 +168,11 @@ typedef struct Process_ {
int basenameOffset;
bool updated;
#ifdef DEBUG
unsigned long int minflt;
unsigned long int cminflt;
unsigned long int majflt;
unsigned long int cmajflt;
#ifdef DEBUG
long int itrealvalue;
unsigned long int vsize;
long int rss;
...
...
@@ -254,7 +254,7 @@ const int Process_fieldFlags[] = {
const
char
*
Process_fieldTitles
[]
=
{
""
,
" PID "
,
"Command "
,
"S "
,
" PPID "
,
" PGRP "
,
" SESN "
,
" TTY "
,
" TPGID "
,
"- "
,
"
- "
,
"- "
,
"- "
,
"-
"
,
" TTY "
,
" TPGID "
,
"- "
,
"
MINFLT "
,
" CMINFLT "
,
" MAJFLT "
,
" CMAJFLT
"
,
" UTIME+ "
,
" STIME+ "
,
" CUTIME+ "
,
" CSTIME+ "
,
"PRI "
,
" NI "
,
"- "
,
"START "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
"- "
,
...
...
@@ -483,6 +483,10 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
case
TTY_NR
:
snprintf
(
buffer
,
n
,
"%5u "
,
this
->
tty_nr
);
break
;
case
TGID
:
snprintf
(
buffer
,
n
,
Process_pidFormat
,
this
->
tgid
);
break
;
case
TPGID
:
snprintf
(
buffer
,
n
,
Process_tpgidFormat
,
this
->
tpgid
);
break
;
case
MINFLT
:
Process_colorNumber
(
str
,
this
->
minflt
,
coloring
);
return
;
case
CMINFLT
:
Process_colorNumber
(
str
,
this
->
cminflt
,
coloring
);
return
;
case
MAJFLT
:
Process_colorNumber
(
str
,
this
->
majflt
,
coloring
);
return
;
case
CMAJFLT
:
Process_colorNumber
(
str
,
this
->
cmajflt
,
coloring
);
return
;
case
PROCESSOR
:
snprintf
(
buffer
,
n
,
"%3d "
,
ProcessList_cpuId
(
this
->
pl
,
this
->
processor
));
break
;
case
NLWP
:
snprintf
(
buffer
,
n
,
"%4ld "
,
this
->
nlwp
);
break
;
case
COMM
:
{
...
...
This diff is collapsed.
Click to expand it.
Process.h
View file @
e0209da8
...
...
@@ -147,11 +147,11 @@ typedef struct Process_ {
int
basenameOffset
;
bool
updated
;
#ifdef DEBUG
unsigned
long
int
minflt
;
unsigned
long
int
cminflt
;
unsigned
long
int
majflt
;
unsigned
long
int
cmajflt
;
#ifdef DEBUG
long
int
itrealvalue
;
unsigned
long
int
vsize
;
long
int
rss
;
...
...
This diff is collapsed.
Click to expand it.
ProcessList.c
View file @
e0209da8
...
...
@@ -444,10 +444,14 @@ static bool ProcessList_readStatFile(Process *process, const char* dirname, cons
location
+=
1
;
process
->
flags
=
strtoul
(
location
,
&
location
,
10
);
location
+=
1
;
location
=
strchr
(
location
,
' '
)
+
1
;
location
=
strchr
(
location
,
' '
)
+
1
;
location
=
strchr
(
location
,
' '
)
+
1
;
location
=
strchr
(
location
,
' '
)
+
1
;
process
->
minflt
=
strtoull
(
location
,
&
location
,
10
);
location
+=
1
;
process
->
cminflt
=
strtoull
(
location
,
&
location
,
10
);
location
+=
1
;
process
->
majflt
=
strtoull
(
location
,
&
location
,
10
);
location
+=
1
;
process
->
cmajflt
=
strtoull
(
location
,
&
location
,
10
);
location
+=
1
;
process
->
utime
=
strtoull
(
location
,
&
location
,
10
);
location
+=
1
;
process
->
stime
=
strtoull
(
location
,
&
location
,
10
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help