From: Scott Zimmermann <sczimmer@gmail.com>
To: 63496@debbugs.gnu.org
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 [thread overview]
Message-ID: <0f761478-aeb5-d65c-2c92-67dba69076d1@gmail.com> (raw)
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.
next reply other threads:[~2023-05-13 17:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-13 17:57 Scott Zimmermann [this message]
2023-05-18 11:12 ` bug#63496: process-attributes returns incorrect start, etime, and pcpu attributes when run inside a lxc container Eli Zaretskii
2023-05-18 21:17 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f761478-aeb5-d65c-2c92-67dba69076d1@gmail.com \
--to=sczimmer@gmail.com \
--cc=63496@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).