summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-02-17 20:52:07 -0200
committerHisham Muhammad <hisham@gobolinux.org>2018-02-17 20:52:46 -0200
commit6dda8d2586d76e4c3f9c409a30d3dd18c22fe6be (patch)
tree32857bb6106c8a2e4ac373563d0386479bdd90d0 /linux
parent5fca258f33e08cd7733940391edbf9e22208de83 (diff)
linux/LinuxProcessList.c: Fix indentation.
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcessList.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 23077025..c8ba89d2 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -595,36 +595,36 @@ static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirn
static int handleNetlinkMsg(struct nl_msg *nlmsg, void *linuxProcess) {
struct nlmsghdr *nlhdr;
- struct nlattr *nlattrs[TASKSTATS_TYPE_MAX + 1];
- struct nlattr *nlattr;
- struct taskstats *stats;
- int rem;
- unsigned long long int timeDelta;
- LinuxProcess* lp = (LinuxProcess*) linuxProcess;
+ struct nlattr *nlattrs[TASKSTATS_TYPE_MAX + 1];
+ struct nlattr *nlattr;
+ struct taskstats *stats;
+ int rem;
+ unsigned long long int timeDelta;
+ LinuxProcess* lp = (LinuxProcess*) linuxProcess;
- nlhdr = nlmsg_hdr(nlmsg);
+ nlhdr = nlmsg_hdr(nlmsg);
if (genlmsg_parse(nlhdr, 0, nlattrs, TASKSTATS_TYPE_MAX, NULL) < 0) {
return NL_SKIP;
- }
-
- if ((nlattr = nlattrs[TASKSTATS_TYPE_AGGR_PID]) || (nlattr = nlattrs[TASKSTATS_TYPE_NULL])) {
- stats = nla_data(nla_next(nla_data(nlattr), &rem));
- assert(lp->super.pid == stats->ac_pid);
- timeDelta = (stats->ac_etime*1000 - lp->delay_read_time);
- #define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x;
- #define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100);
- 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->swapin_delay_percent = DELTAPERC(stats->swapin_delay_total, lp->swapin_delay_total);
- #undef DELTAPERC
- #undef BOUNDS
- lp->swapin_delay_total = stats->swapin_delay_total;
- lp->blkio_delay_total = stats->blkio_delay_total;
- lp->cpu_delay_total = stats->cpu_delay_total;
- lp->delay_read_time = stats->ac_etime*1000;
- }
- return NL_OK;
+ }
+
+ if ((nlattr = nlattrs[TASKSTATS_TYPE_AGGR_PID]) || (nlattr = nlattrs[TASKSTATS_TYPE_NULL])) {
+ stats = nla_data(nla_next(nla_data(nlattr), &rem));
+ assert(lp->super.pid == stats->ac_pid);
+ timeDelta = (stats->ac_etime*1000 - lp->delay_read_time);
+ #define BOUNDS(x) isnan(x) ? 0.0 : (x > 100) ? 100.0 : x;
+ #define DELTAPERC(x,y) BOUNDS((float) (x - y) / timeDelta * 100);
+ 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->swapin_delay_percent = DELTAPERC(stats->swapin_delay_total, lp->swapin_delay_total);
+ #undef DELTAPERC
+ #undef BOUNDS
+ lp->swapin_delay_total = stats->swapin_delay_total;
+ lp->blkio_delay_total = stats->blkio_delay_total;
+ lp->cpu_delay_total = stats->cpu_delay_total;
+ lp->delay_read_time = stats->ac_etime*1000;
+ }
+ return NL_OK;
}
static void LinuxProcessList_readDelayAcctData(LinuxProcessList* this, LinuxProcess* process) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy