bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63496: process-attributes returns incorrect start, etime, and pcpu a


From: Eli Zaretskii
Subject: bug#63496: process-attributes returns incorrect start, etime, and pcpu attributes when run inside a lxc container
Date: Thu, 18 May 2023 14:12:03 +0300

> Date: Sat, 13 May 2023 19:57:08 +0200
> From: Scott Zimmermann <sczimmer@gmail.com>
> 
> in src/sysdep.c line 3475:
> Lisp_Object boot = Ftime_subtract (now, uptime);
> 
> it calculates the boot time for linux based on the uptime. Inside lxc 
> containers, /proc/uptime is the uptime of the container rather than of 
> the host system. However in /proc/[PID]/stat, starttime is the time 
> since system boot, of the host system, not since the container started. 
> This leads to emacs computing incorrect values for start, etime, and 
> pcpu for processes.
> 
> I think it should get the boot time from "btime" in /proc/stat, this is 
> what ps does, which shows correct times for processes inside the 
> container. If this sounds like an appropriate fix I'm happy to write and 
> test a patch for it.

Paul and Andreas, any comments?

Patches to implement the change would be welcome, of course.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]