public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Sascha Westermann via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Sascha Westermann <sascha.westermann@hl-services.de>
Subject: [pve-devel] [PATCH pve-common 1/3] Fix #5708: Add CPU raw counters
Date: Tue, 17 Sep 2024 07:50:18 +0200	[thread overview]
Message-ID: <mailman.10.1726728980.332.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20240917055020.10507-1-sascha.westermann@hl-services.de>

[-- Attachment #1: Type: message/rfc822, Size: 11805 bytes --]

From: Sascha Westermann <sascha.westermann@hl-services.de>
To: pve-devel@lists.proxmox.com
Cc: Sascha Westermann <sascha.westermann@hl-services.de>
Subject: [PATCH pve-common 1/3] Fix #5708: Add CPU raw counters
Date: Tue, 17 Sep 2024 07:50:18 +0200
Message-ID: <20240917055020.10507-2-sascha.westermann@hl-services.de>

Add "guest_time" (43) from /proc/<pid>/stat.

Signed-off-by: Sascha Westermann <sascha.westermann@hl-services.de>
---
 src/PVE/ProcFSTools.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index 3826fcc..5b0062e 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -239,7 +239,7 @@ sub read_proc_pid_stat {
 
     my $statstr = PVE::Tools::file_read_firstline("/proc/$pid/stat");
 
-    if ($statstr && $statstr =~ m/^$pid \(.*\) (\S) (-?\d+) -?\d+ -?\d+ -?\d+ -?\d+ \d+ \d+ \d+ \d+ \d+ (\d+) (\d+) (-?\d+) (-?\d+) -?\d+ -?\d+ -?\d+ 0 (\d+) (\d+) (-?\d+) \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ -?\d+ -?\d+ \d+ \d+ \d+/) {
+    if ($statstr && $statstr =~ m/^$pid \(.*\) (\S) (-?\d+) -?\d+ -?\d+ -?\d+ -?\d+ \d+ \d+ \d+ \d+ \d+ (\d+) (\d+) (-?\d+) (-?\d+) -?\d+ -?\d+ -?\d+ 0 (\d+) (\d+) (-?\d+) \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ -?\d+ -?\d+ \d+ \d+ \d+ (\d+)/) {
 	return {
 	    status => $1,
 	    ppid => $2,
@@ -248,6 +248,7 @@ sub read_proc_pid_stat {
 	    starttime => $7,
 	    vsize => $8,
 	    rss => $9 * 4096,
+	    guest_time => $10,
 	};
     }
 
-- 
2.46.0



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

       reply	other threads:[~2024-09-19  6:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240917055020.10507-1-sascha.westermann@hl-services.de>
2024-09-17  5:50 ` Sascha Westermann via pve-devel [this message]
2024-09-17  5:50 ` [pve-devel] [PATCH pve-manager 2/3] " Sascha Westermann via pve-devel
2024-09-17  5:50 ` [pve-devel] [PATCH qemu-server 3/3] " Sascha Westermann via pve-devel

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.10.1726728980.332.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=sascha.westermann@hl-services.de \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal