[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 67d08daa97: Make VSIZE and RSS human-readable in Proced buffers
From: |
Eli Zaretskii |
Subject: |
master 67d08daa97: Make VSIZE and RSS human-readable in Proced buffers |
Date: |
Thu, 17 Nov 2022 04:55:05 -0500 (EST) |
branch: master
commit 67d08daa97019ae11f5a85fc40cf95138e4837dc
Author: Laurence Warne <laurencewarne@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>
Make VSIZE and RSS human-readable in Proced buffers
* lisp/proced.el (proced-format-memory): New function.
(proced-grammar-alist): Use proced-format-memory to format
VSIZE and RSS. (Bug#59272)
---
lisp/proced.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/proced.el b/lisp/proced.el
index a774f2dd1e..a6f1a71778 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -140,8 +140,8 @@ the external command (usually \"kill\")."
(nice "Ni" "%3d" 3 proced-< t (nice pid) (t t nil))
(thcount "THCount" "%d" right proced-< t (thcount pid) (nil t t))
(start "Start" proced-format-start 6 proced-time-lessp nil (start pid)
(t t nil))
- (vsize "VSize" "%d" right proced-< t (vsize pid) (nil t t))
- (rss "RSS" "%d" right proced-< t (rss pid) (nil t t))
+ (vsize "VSize" proced-format-memory right proced-< t (vsize pid) (nil
t t))
+ (rss "RSS" proced-format-memory right proced-< t (rss pid) (nil t
t))
(etime "ETime" proced-format-time right proced-time-lessp t (etime
pid) (nil t t))
(pcpu "%CPU" "%.1f" right proced-< t (pcpu pid) (nil t t))
(pmem "%Mem" "%.1f" right proced-< t (pmem pid) (nil t t))
@@ -1425,6 +1425,10 @@ The return string is always 6 characters wide."
Replace newline characters by \"^J\" (two characters)."
(string-replace "\n" "^J" args))
+(defun proced-format-memory (kilobytes)
+ "Format KILOBYTES in a human readable format."
+ (funcall byte-count-to-string-function (* 1024 kilobytes)))
+
(defun proced-format (process-alist format)
"Display PROCESS-ALIST using FORMAT."
(if (symbolp format)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 67d08daa97: Make VSIZE and RSS human-readable in Proced buffers,
Eli Zaretskii <=