From patchwork Wed Jun 24 13:40:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 6667781 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 711A09F1C1 for ; Wed, 24 Jun 2015 13:40:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75AA2206D2 for ; Wed, 24 Jun 2015 13:40:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 31816206A7 for ; Wed, 24 Jun 2015 13:40:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EAEB26E3FB; Wed, 24 Jun 2015 06:40:16 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id AAFAE6E3FB for ; Wed, 24 Jun 2015 06:40:15 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 24 Jun 2015 06:40:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,671,1427785200"; d="scan'208";a="593920275" Received: from michelth-linux2.isw.intel.com ([10.102.226.189]) by orsmga003.jf.intel.com with ESMTP; 24 Jun 2015 06:40:14 -0700 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Wed, 24 Jun 2015 14:40:13 +0100 Message-Id: <1435153213-19527-1-git-send-email-michel.thierry@intel.com> X-Mailer: git-send-email 2.4.4 Subject: [Intel-gfx] [PATCH igt] Put thousands separators in %llu outputs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After Chris' "Enable locale dependent output to a terminal" patch, we can put thousand separators into these long long outputs. sed "s/%ll/%'ll/g" Signed-off-by: Michel Thierry --- lib/intel_os.c | 4 ++-- overlay/cpu-top.c | 2 +- overlay/overlay.c | 4 ++-- tests/gem_exec_big.c | 4 ++-- tools/intel_gpu_top.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/intel_os.c b/lib/intel_os.c index 3321a8d..f82847f 100644 --- a/lib/intel_os.c +++ b/lib/intel_os.c @@ -225,7 +225,7 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode) required *= size + KERNEL_BO_OVERHEAD; required = ALIGN(required, 4096); - igt_debug("Checking %u surfaces of size %u bytes (total %llu) against %s%s\n", + igt_debug("Checking %u surfaces of size %u bytes (total %'llu) against %s%s\n", count, size, (long long)required, mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "", mode & CHECK_SWAP ? " + swap": ""); @@ -238,7 +238,7 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode) total *= 1024 * 1024; igt_skip_on_f(total <= required, - "Estimated that we need %llu bytes for the test, but only have %llu bytes available (%s%s)\n", + "Estimated that we need %'llu bytes for the test, but only have %'llu bytes available (%s%s)\n", (long long)required, (long long)total, mode & (CHECK_RAM | CHECK_SWAP) ? "RAM" : "", mode & CHECK_SWAP ? " + swap": ""); diff --git a/overlay/cpu-top.c b/overlay/cpu-top.c index 13ae70d..acc85af 100644 --- a/overlay/cpu-top.c +++ b/overlay/cpu-top.c @@ -63,7 +63,7 @@ int cpu_top_update(struct cpu_top *cpu) sscanf(buf, "cpu %lu %lu %lu %lu", &s->user, &s->nice, &s->sys, &s->idle); #else - sscanf(buf, "cpu %llu %llu %llu %llu", + sscanf(buf, "cpu %'llu %'llu %'llu %'llu", &s->user, &s->nice, &s->sys, &s->idle); #endif diff --git a/overlay/overlay.c b/overlay/overlay.c index 7759c2b..d146149 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -697,7 +697,7 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq * } if (has_power) { - sprintf(buf, "Power: %llumW", (long long unsigned)gf->power.power_mW); + sprintf(buf, "Power: %'llumW", (long long unsigned)gf->power.power_mW); cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1); cairo_move_to(ctx->cr, PAD, y); cairo_show_text(ctx->cr, buf); @@ -705,7 +705,7 @@ static void show_gpu_freq(struct overlay_context *ctx, struct overlay_gpu_freq * } if (has_irqs) { - sprintf(buf, "Interrupts: %llu", (long long unsigned)gf->irqs.delta); + sprintf(buf, "Interrupts: %'llu", (long long unsigned)gf->irqs.delta); cairo_set_source_rgba(ctx->cr, 1, 1, 1, 1); cairo_move_to(ctx->cr, PAD, y); cairo_show_text(ctx->cr, buf); diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c index 171fd81..7442578 100644 --- a/tests/gem_exec_big.c +++ b/tests/gem_exec_big.c @@ -213,13 +213,13 @@ igt_simple_main ptr = NULL; for (reloc_ofs = 4096; reloc_ofs < batch_size; reloc_ofs += 4096) { - igt_debug("batch_size %llu, reloc_ofs %llu\n", + igt_debug("batch_size %'llu, reloc_ofs %'llu\n", (long long)batch_size, (long long)reloc_ofs); exec1(fd, handle, reloc_ofs, 0, ptr); exec1(fd, handle, reloc_ofs, I915_EXEC_SECURE, ptr); } - igt_debug("batch_size %llu, all %ld relocs\n", + igt_debug("batch_size %'llu, all %ld relocs\n", (long long)batch_size, (long)(batch_size >> 12)); execN(fd, handle, batch_size, 0, ptr); execN(fd, handle, batch_size, I915_EXEC_SECURE, ptr); diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c index b5cfda0..1e3bd56 100644 --- a/tools/intel_gpu_top.c +++ b/tools/intel_gpu_top.c @@ -637,7 +637,7 @@ int main(int argc, char **argv) } if (i < STATS_COUNT && HAS_STATS_REGS(devid)) { - printf("%13s: %llu (%lld/sec)", + printf("%13s: %'llu (%'lld/sec)", stats_reg_names[i], (long long)stats[i], (long long)(stats[i] - last_stats[i]));