From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Laurence Warne Newsgroups: gmane.emacs.bugs Subject: bug#59272: [PATCH] Make Memory Human Readable in proced Buffers Date: Tue, 15 Nov 2022 09:51:53 +0000 Message-ID: References: <87a64sew18.fsf@gmail.com> <86h6z0zl6w.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f7234a05ed7f4ea8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24438"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59272@debbugs.gnu.org, Visuwesh , Juri Linkov To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 15 10:53:56 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ousdg-0006BQ-Gb for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Nov 2022 10:53:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ousd8-0007FB-69; Tue, 15 Nov 2022 04:53:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ousco-0006Ts-Aj for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2022 04:53:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ouscn-0003zl-QQ for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2022 04:53:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ouscn-0002Oc-N0 for bug-gnu-emacs@gnu.org; Tue, 15 Nov 2022 04:53:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Laurence Warne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Nov 2022 09:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59272 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59272-submit@debbugs.gnu.org id=B59272.16685059339150 (code B ref 59272); Tue, 15 Nov 2022 09:53:01 +0000 Original-Received: (at 59272) by debbugs.gnu.org; 15 Nov 2022 09:52:13 +0000 Original-Received: from localhost ([127.0.0.1]:52994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ousc0-0002NW-TV for submit@debbugs.gnu.org; Tue, 15 Nov 2022 04:52:13 -0500 Original-Received: from mail-ua1-f53.google.com ([209.85.222.53]:45568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ousby-0002NI-MX for 59272@debbugs.gnu.org; Tue, 15 Nov 2022 04:52:11 -0500 Original-Received: by mail-ua1-f53.google.com with SMTP id v8so4739157uap.12 for <59272@debbugs.gnu.org>; Tue, 15 Nov 2022 01:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ubLJ8qlUecEGiJc0Mebg9DPfeYi9dmrBWyR6rclMHFY=; b=MPppn6i/eY32rwPyf4Sd4HAsSh00ho//7fteSxQQjQi5zXZPvbnx2I2YzPXnXQ0FTX H5vy/3ZSUcHm99aHfKK1VJJrnnxGANTuYSrmu9wMeJy4Ix6YxPbQem2TKksEMWA+SEn5 vL95cVBrA8kMopvIekNwUdioifkVshd5XJ8sZxmY52hcC3GYQrMpX8qdo8lEPl+8LPrj ZbqDuNBTF38utHAJDRC9oeUdz0A5ej/ltzIx/+FuG9ZWMJ2UQ3c5hHxwmfGzs8Q/qX3I rjitvUqUcBHofkGCnOK6miPYKfWW6SMgjsy3I84jP9C+373zuHxFj0dr7BTCDWBKzOz0 SJLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ubLJ8qlUecEGiJc0Mebg9DPfeYi9dmrBWyR6rclMHFY=; b=qvKrUR/N3TyzVog6OcnYkuP78rUmfMEV/HktKnugKyJQwYZTp2dGv7MzIzLoaZYIF+ GH71hJlupwc95o76P4iX5ysMlHAoh5UoRBB0ZOxk7DTcDo846/pNv5tCPOatNV7+QI6M 5AoicaFcHEv7e4eD90FVim+WM2RtJpnZKOCn4N4IGgO8cLMiTEXx97oYmooJ6ptZzV0G f81d/elU5uL9MiVmfXU9cP/8Gh72vP1awHjo5k6QQ16ypbeJ3sqMDrqldciW9kwcMEk/ qnpGpowZNBoKohw3a6S9ikYVhCO3ogAPIjA5H5n9I3AbPMw9f3jXL1/qezE+Z/YRgzPj JP5A== X-Gm-Message-State: ANoB5pkSWs0FaAvD1wM1WrsVRXIl7b+sM/2oRIRqiQ54yomEXGMzjibM B7B746z8ODmJhckJB/fQrDmcx0PRMoLuWTQvvhU= X-Google-Smtp-Source: AA0mqf7PichBTorZrgeRHi0jaB6EeFnoo7Ot6M2f+CG9BEz+3iO1bYXWeHBGadxoYXQGyD+7gYR8oHbtjcj8A7IF30Y= X-Received: by 2002:a9f:3ecb:0:b0:414:4bb5:3e54 with SMTP id n11-20020a9f3ecb000000b004144bb53e54mr8909005uaj.121.1668505925000; Tue, 15 Nov 2022 01:52:05 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247929 Archived-At: --000000000000f7234a05ed7f4ea8 Content-Type: text/plain; charset="UTF-8" I think the suggestion to use a custom variable (or just use byte-count-to-string) is a good one, but AFAICS the argument to file-size-human-readable should be bytes, but proced gets rss and vsize from 'process-attributes' which uses kilobytes. So we're still stuck with having to choose one of: (funcall #'byte-count-to-string-function (* 1000 kilobytes)) (funcall #'byte-count-to-string-function (* 1024 kilobytes)) I'm not really familiar with c, so I can't tell from process.c On Tue, Nov 15, 2022 at 8:59 AM Stefan Kangas wrote: > Juri Linkov writes: > > > Maybe the default should be the same as in byte-count-to-string-function? > > Make sense to me. Or maybe we should just use that variable? > --000000000000f7234a05ed7f4ea8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think the suggestion to use a custom variable (or j= ust use byte-count-to-string) is a good one, but AFAICS the argument to fil= e-size-human-readable should be bytes, but proced gets rss and vsize from &= #39;process-attributes' which uses kilobytes.=C2=A0 So we're still = stuck with having to choose one of:

(funcall #= 'byte-count-to-string-function (* 1000 kilobytes))
(funcall #= 'byte-count-to-string-function (* 1024 kilobytes))

=
I'm not really familiar with c, so I can't tell from process.c=

On Tue, Nov 15, 2022 at 8:59 AM Stefan Kangas <stefankangas@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Juri Linkov <juri@linkov.net> writes:<= br>
> Maybe the default should be the same as in byte-count-to-string-functi= on?

Make sense to me.=C2=A0 Or maybe we should just use that variable?
--000000000000f7234a05ed7f4ea8--