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: Scott Zimmermann
Subject: bug#63496: process-attributes returns incorrect start, etime, and pcpu attributes when run inside a lxc container
Date: Sat, 13 May 2023 19:57:08 +0200
User-agent: curl/7.5.1

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.





reply via email to

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