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
6dda8d25
Commit
6dda8d25
authored
Feb 17, 2018
by
Hisham Muhammad
Browse files
linux/LinuxProcessList.c: Fix indentation.
parent
5fca258f
Changes
1
Hide whitespace changes
Inline
Side-by-side
linux/LinuxProcessList.c
View file @
6dda8d25
...
@@ -595,36 +595,36 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn
...
@@ -595,36 +595,36 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn
static
int
handleNetlinkMsg
(
struct
nl_msg
*
nlmsg
,
void
*
linuxProcess
)
{
static
int
handleNetlinkMsg
(
struct
nl_msg
*
nlmsg
,
void
*
linuxProcess
)
{
struct
nlmsghdr
*
nlhdr
;
struct
nlmsghdr
*
nlhdr
;
struct
nlattr
*
nlattrs
[
TASKSTATS_TYPE_MAX
+
1
];
struct
nlattr
*
nlattrs
[
TASKSTATS_TYPE_MAX
+
1
];
struct
nlattr
*
nlattr
;
struct
nlattr
*
nlattr
;
struct
taskstats
*
stats
;
struct
taskstats
*
stats
;
int
rem
;
int
rem
;
unsigned
long
long
int
timeDelta
;
unsigned
long
long
int
timeDelta
;
LinuxProcess
*
lp
=
(
LinuxProcess
*
)
linuxProcess
;
LinuxProcess
*
lp
=
(
LinuxProcess
*
)
linuxProcess
;
nlhdr
=
nlmsg_hdr
(
nlmsg
);
nlhdr
=
nlmsg_hdr
(
nlmsg
);
if
(
genlmsg_parse
(
nlhdr
,
0
,
nlattrs
,
TASKSTATS_TYPE_MAX
,
NULL
)
<
0
)
{
if
(
genlmsg_parse
(
nlhdr
,
0
,
nlattrs
,
TASKSTATS_TYPE_MAX
,
NULL
)
<
0
)
{
return
NL_SKIP
;
return
NL_SKIP
;
}
}
if
((
nlattr
=
nlattrs
[
TASKSTATS_TYPE_AGGR_PID
])
||
(
nlattr
=
nlattrs
[
TASKSTATS_TYPE_NULL
]))
{
if
((
nlattr
=
nlattrs
[
TASKSTATS_TYPE_AGGR_PID
])
||
(
nlattr
=
nlattrs
[
TASKSTATS_TYPE_NULL
]))
{
stats
=
nla_data
(
nla_next
(
nla_data
(
nlattr
),
&
rem
));
stats
=
nla_data
(
nla_next
(
nla_data
(
nlattr
),
&
rem
));
assert
(
lp
->
super
.
pid
==
stats
->
ac_pid
);
assert
(
lp
->
super
.
pid
==
stats
->
ac_pid
);
timeDelta
=
(
stats
->
ac_etime
*
1000
-
lp
->
delay_read_time
);
timeDelta
=
(
stats
->
ac_etime
*
1000
-
lp
->
delay_read_time
);
#define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x;
#define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x;
#define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100);
#define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100);
lp
->
cpu_delay_percent
=
DELTAPERC
(
stats
->
cpu_delay_total
,
lp
->
cpu_delay_total
);
lp
->
cpu_delay_percent
=
DELTAPERC
(
stats
->
cpu_delay_total
,
lp
->
cpu_delay_total
);
lp
->
blkio_delay_percent
=
DELTAPERC
(
stats
->
blkio_delay_total
,
lp
->
blkio_delay_total
);
lp
->
blkio_delay_percent
=
DELTAPERC
(
stats
->
blkio_delay_total
,
lp
->
blkio_delay_total
);
lp
->
swapin_delay_percent
=
DELTAPERC
(
stats
->
swapin_delay_total
,
lp
->
swapin_delay_total
);
lp
->
swapin_delay_percent
=
DELTAPERC
(
stats
->
swapin_delay_total
,
lp
->
swapin_delay_total
);
#undef DELTAPERC
#undef DELTAPERC
#undef BOUNDS
#undef BOUNDS
lp
->
swapin_delay_total
=
stats
->
swapin_delay_total
;
lp
->
swapin_delay_total
=
stats
->
swapin_delay_total
;
lp
->
blkio_delay_total
=
stats
->
blkio_delay_total
;
lp
->
blkio_delay_total
=
stats
->
blkio_delay_total
;
lp
->
cpu_delay_total
=
stats
->
cpu_delay_total
;
lp
->
cpu_delay_total
=
stats
->
cpu_delay_total
;
lp
->
delay_read_time
=
stats
->
ac_etime
*
1000
;
lp
->
delay_read_time
=
stats
->
ac_etime
*
1000
;
}
}
return
NL_OK
;
return
NL_OK
;
}
}
static
void
LinuxProcessList_readDelayAcctData
(
LinuxProcessList
*
this
,
LinuxProcess
*
process
)
{
static
void
LinuxProcessList_readDelayAcctData
(
LinuxProcessList
*
this
,
LinuxProcess
*
process
)
{
...
...
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