From: Eli Zaretskii <eliz@gnu.org>
To: Scott Zimmermann <sczimmer@gmail.com>,
Paul Eggert <eggert@cs.ucla.edu>,
Andreas Schwab <schwab@linux-m68k.org>
Cc: 63496@debbugs.gnu.org
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 [thread overview]
Message-ID: <834jo9x5a4.fsf@gnu.org> (raw)
In-Reply-To: <0f761478-aeb5-d65c-2c92-67dba69076d1@gmail.com> (message from Scott Zimmermann on Sat, 13 May 2023 19:57:08 +0200)
> 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.
next prev parent reply other threads:[~2023-05-18 11:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-13 17:57 bug#63496: process-attributes returns incorrect start, etime, and pcpu attributes when run inside a lxc container Scott Zimmermann
2023-05-18 11:12 ` Eli Zaretskii [this message]
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=834jo9x5a4.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=63496@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=schwab@linux-m68k.org \
--cc=sczimmer@gmail.com \
/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).