From patchwork Thu Jun 7 06:54:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 926178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 411brp1kYPz9s1b for ; Thu, 7 Jun 2018 16:55:06 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 411brp0SJ5zF32h for ; Thu, 7 Jun 2018 16:55:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 411brL3Y9lzF32l for ; Thu, 7 Jun 2018 16:54:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 411brK6K9zz9s7G; Thu, 7 Jun 2018 16:54:41 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 9A5A7EE7923; Thu, 7 Jun 2018 16:54:41 +1000 (AEST) From: Michael Neuling To: alistair@popple.id.au Date: Thu, 7 Jun 2018 16:54:36 +1000 Message-Id: <20180607065438.18257-9-mikey@neuling.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180607065438.18257-1-mikey@neuling.org> References: <20180607065438.18257-1-mikey@neuling.org> Subject: [Pdbg] [PATCH 09/11] htm: Cleanup status output X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pdbg@lists.ozlabs.org MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Actually print something in status output. Drop some of the more esoteric details to PR_INFO() Signed-off-by: Michael Neuling --- libpdbg/htm.c | 41 ++++++++++++++++++++--------------------- src/htm.c | 3 +-- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 3a6187e0b2..7009c40081 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -789,18 +789,16 @@ static int do_htm_status(struct htm *htm) if (dt_node_is_compatible(&htm->target, "ibm,power9-nhtm")) regs++; - PR_DEBUG("HTM register dump:\n"); + PR_INFO("HTM register dump:\n"); for (i = 0; i < regs; i++) { if (HTM_ERR(pib_read(&htm->target, i, &val))) { PR_ERROR("Couldn't read HTM reg: %d\n", i); continue; } - PR_DEBUG(" %d: 0x%016" PRIx64 "\n", i, val); + PR_INFO(" %d: 0x%016" PRIx64 "\n", i, val); } - putchar('\n'); - PR_INFO("* Checking HTM status...\n"); if (HTM_ERR(get_status(htm, &status))) return -1; @@ -815,47 +813,48 @@ static int do_htm_status(struct htm *htm) } PR_DEBUG("HTM status : 0x%016" PRIx64 "\n", status.raw); - PR_INFO("State: "); + printf("State: "); switch (status.state) { case INIT: - PR_INFO("INIT"); + printf("INIT"); break; case PREREQ: - PR_INFO("PREREQ"); + printf("PREREQ"); break; case READY: - PR_INFO("READY"); + printf("READY"); break; case TRACING: - PR_INFO("TRACING"); + printf("TRACING"); break; case PAUSED: - PR_INFO("PAUSED"); + printf("PAUSED"); break; case FLUSH: - PR_INFO("FLUSH"); + printf("FLUSH"); break; case COMPLETE: - PR_INFO("COMPLETE"); + printf("COMPLETE"); break; case ENABLE: - PR_INFO("ENABLE"); + printf("ENABLE"); break; case STAMP: - PR_INFO("STAMP"); + printf("STAMP"); break; default: - PR_INFO("UNINITIALIZED"); + printf("UNINITIALIZED"); } - PR_INFO("\n"); + printf("\n"); - PR_INFO("HTM base addr : 0x%016" PRIx64 ", size: 0x%016" PRIx64 " ", - status.mem_base, total << 20); + printf("addr:0x%016" PRIx64 "\n", status.mem_base); + printf("size:0x%016" PRIx64 " ", total << 20); if (total > 512) - PR_INFO("[ %" PRIu64 "GB ]", total >> 10); + printf("[ %" PRIu64 "GB ]", total >> 10); else - PR_INFO("[ %" PRIu64 "MB ]", total); - PR_INFO("\n"); + printf("[ %" PRIu64 "MB ]", total); + printf("\n"); + printf("curr:0x%016" PRIx64 "\n", status.mem_last); return 1; } diff --git a/src/htm.c b/src/htm.c index 80cdec27b1..62b8569259 100644 --- a/src/htm.c +++ b/src/htm.c @@ -141,14 +141,13 @@ static int run_status(enum htm_type type, int optind, int argc, char *argv[]) if (target_is_disabled(target)) continue; - printf("HTM@"); + printf("Status HTM@"); print_htm_address(type, target); if (htm_status(target) != 1) { printf("Couldn't get HTM@"); print_htm_address(type, target); } rc++; - printf("\n\n"); } return rc;