Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
if (r)
goto ERROR;
+ struct pakfire_cgroup_cpustat cpustat;
+
+ // Fetch CPU usage stats
+ r = pakfire_cgroup_cpustat(pakfire, env.cgroup, &cpustat);
+ if (r) {
+ ERROR(pakfire, "Could not read CPU usage stats: %s\n", strerror(errno));
+ r = -1;
+ goto ERROR;
+ }
+
+ // Log CPU usage stats
+ DEBUG(pakfire, "cgroup %s used %.4fs of CPU time\n", env.cgroup,
+ (double)(cpustat.usage.tv_sec) + ((double)cpustat.usage.tv_usec / 1000000));
+
// Return the exit code of the application
r = exit;