mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Rientjes <rientjes@google.com>
Cc: Borislav Petkov <bp@alien8.de>,
	Prarit Bhargava <prarit@redhat.com>,
	linux-kernel@vger.kernel.org, lszubowi@redhat.com,
	Matt Fleming <matt.fleming@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-efi@vger.kernel.org
Subject: Re: [PATCH] x86, efi: print debug values in Kib not MB
Date: Tue, 29 Jul 2014 16:07:35 -0700	[thread overview]
Message-ID: <1406675255.12100.22.camel@joe-AO725> (raw)
In-Reply-To: <alpine.DEB.2.02.1407291541480.20991@chino.kir.corp.google.com>

On Tue, 2014-07-29 at 15:42 -0700, David Rientjes wrote:
> On Wed, 30 Jul 2014, Borislav Petkov wrote:
> 
> > On Tue, Jul 29, 2014 at 06:32:56PM -0400, Prarit Bhargava wrote:
> > > and it was best to keep the code simple with a KiB.
> > 
> > You're missing the point - the output doesn't get simple with KiB. Read
> > the example I just gave you!
> > 
> > (13893632kiB) is actively *not* helping when one looks at it!
> > 
> 
> /proc/meminfo must be frustrating then, too.
> 
> If Prarit is going to implement this suggested reverse memparse() then it 
> would be nice to also have it as a generic function that others can use.

Maybe yet another vsprintf extension?

Maybe %pH<vartype> where vartype is one of [hh, h, u, ul, ull]
with something like
	u64 t1 = (u64)*(appropriate cast)vartype;
	u64 t2 = t1;
	int index = 0;
	while ((t1 >>= 10)) {
		index++;
		t2 >>= 10;
	}
	
to output the equivalent of
	%llu%s, t2, "bkmgtpezy"[index]
ala dump_pagetables



  parent reply	other threads:[~2014-07-29 23:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 17:09 Prarit Bhargava
2014-07-29 20:29 ` David Rientjes
2014-07-29 22:02   ` Joe Perches
2014-07-29 22:05     ` Prarit Bhargava
2014-07-29 22:05   ` Prarit Bhargava
2014-07-29 22:29 ` Borislav Petkov
2014-07-29 22:32   ` Prarit Bhargava
2014-07-29 22:36     ` Borislav Petkov
2014-07-29 22:42       ` David Rientjes
2014-07-29 23:01         ` Borislav Petkov
2014-07-29 23:03           ` Prarit Bhargava
2014-07-29 23:07         ` Joe Perches [this message]
2014-07-29 23:44           ` David Rientjes
2014-07-29 22:54       ` Prarit Bhargava
2014-07-30  3:25         ` Steven Noonan
2014-07-30 14:48   ` Matt Fleming
2014-07-30 15:05     ` Colin Ian King
2014-07-30 17:04       ` Prarit Bhargava
2014-07-30 17:10         ` Randy Dunlap
2014-07-30 17:21           ` H. Peter Anvin
2014-07-30 19:58             ` Borislav Petkov
2014-07-30 20:43               ` Randy Dunlap

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=1406675255.12100.22.camel@joe-AO725 \
    --to=joe@perches.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lszubowi@redhat.com \
    --cc=matt.fleming@intel.com \
    --cc=mingo@redhat.com \
    --cc=prarit@redhat.com \
    --cc=rientjes@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®