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
45de5694
Commit
45de5694
authored
Oct 30, 2010
by
Hisham Muhammad
Browse files
no need to pad values; provide a default on machines without cgroup
parent
84ed4c01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Process.h
View file @
45de5694
...
...
@@ -65,6 +65,9 @@ typedef enum ProcessField_ {
#ifdef HAVE_TASKSTATS
RCHAR
,
WCHAR
,
SYSCR
,
SYSCW
,
RBYTES
,
WBYTES
,
CNCLWB
,
IO_READ_RATE
,
IO_WRITE_RATE
,
IO_RATE
,
#endif
#ifdef HAVE_CGROUP
CGROUP
,
#endif
LAST_PROCESSFIELD
}
ProcessField
;
...
...
@@ -155,6 +158,9 @@ typedef struct Process_ {
double
io_rate_write_bps
;
unsigned
long
long
io_rate_write_time
;
#endif
#ifdef HAVE_CGROUP
char
*
cgroup
;
#endif
}
Process
;
...
...
ProcessList.c
View file @
45de5694
...
...
@@ -653,12 +653,12 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
char
**
fields
=
String_split
(
trimmed
,
':'
);
free
(
trimmed
);
char
*
value
=
S
tr
ing_cat
(
fields
[
2
]
,
" "
);
process
->
cgroup
=
s
tr
ndup
(
fields
[
2
]
+
1
,
10
);
String_freeArray
(
fields
);
process
->
cgroup
=
strndup
(
value
+
1
,
10
);
free
(
value
);
}
fclose
(
status
);
}
else
{
process
->
cgroup
=
strdup
(
""
);
}
#endif
...
...
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