From patchwork Tue May 31 09:14:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1637266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=LkFuORN3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LC67c4mK0z9s1l for ; Tue, 31 May 2022 19:15:24 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LC67c3Zvbz3bkR for ; Tue, 31 May 2022 19:15:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=LkFuORN3; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::62c; helo=mail-pl1-x62c.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=LkFuORN3; dkim-atps=neutral Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LC67Y3CNZz3bkp for ; Tue, 31 May 2022 19:15:21 +1000 (AEST) Received: by mail-pl1-x62c.google.com with SMTP id s14so12304836plk.8 for ; Tue, 31 May 2022 02:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PLcyL9+zMxCSYKQhg7am/pqmacna74/eYFicx/sc10A=; b=LkFuORN3aUtbTyegdTphhGbStutw+x+8V0upCjhrC5i7GEKdVzdqX4Szhj+gjc/EXa oTMEdNKe9ckL2BuTNhxTZEM+e5Pb6TNdO/WdF1HiqU2KmuJdYtwDgBaZ3W3BbQ/vIkPc igIEwkIIDFxWkT3TZQv5zkHwVz7Zn1AJ1RFW+jTbKLM71J1MnKWHcWoIIdyVvnOdpSVt g3WRk8UpZFDZ4tM1VO4KHsUzFbp83xew+BaXW83So7Hz++v7i4CkFW1w3jqo8AFUe1Vl FVZrB21b4stowkRsid25YyARjU3IoBGNintytxeuLjrWGL0nU4+y5CotWXnWwgJ75LL7 cjEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PLcyL9+zMxCSYKQhg7am/pqmacna74/eYFicx/sc10A=; b=v27GYEYuQYX1P6u2cq0Y/WDJJdrPVqnDVqtcJbYuyFZAFfR2pGyVwHX82eXt0SEdMg TM/t7hWCk9U9pW+S+xlqC0lH2xZgIkPfTpHASBWYEipM1f+lY5jEx24A7j0hLXvro9qe mznqzrUiqdEMpYQ9OTHIKR9FHXwO4N8PmrSRMtSv9kzxtOHcsj+t1c9Z70l6g8Hzu2or biHPxADB78NtUaHAhduwwBlAGibVlzaC2eOA+PsvJ7lI1Pwoc/EY6TI/s8SUqCYsmmRp yYslQENIiRiRtcWA/D145MkZm1pINAPlfCwvTgjGtfIp4DmcA84zuI+sNB0xP97FvjYI j1qg== X-Gm-Message-State: AOAM531g/M3yocVxd75VCKe/kUCyasS4eut6fx840y4tZXy9+cdGJlXt PfFEYJ9kEkPYCUe4kv7Y0wxq7B0C/vUlnw== X-Google-Smtp-Source: ABdhPJwFKGoOiBf0rCuzmj/Cu6iCPC4j9pYZBg9No+FXgFAw+GesFM2KVzYl+3upblV06DlPAGcw+w== X-Received: by 2002:a17:903:2287:b0:164:95f:b4d6 with SMTP id b7-20020a170903228700b00164095fb4d6mr1762128plh.140.1653988518990; Tue, 31 May 2022 02:15:18 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (220-245-15-130.tpgi.com.au. [220.245.15.130]) by smtp.gmail.com with ESMTPSA id t10-20020a17090a950a00b001e2ebcce5d5sm1282857pjo.37.2022.05.31.02.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 02:15:18 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Tue, 31 May 2022 19:14:54 +1000 Message-Id: <20220531091457.2208488-8-npiggin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220531091457.2208488-1-npiggin@gmail.com> References: <20220531091457.2208488-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 07/10] thread: print core state with threadstatus X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 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: Nicholas Piggin Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" For each line of threads printed, print interesting core state as well. Signed-off-by: Nicholas Piggin --- src/thread.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/thread.c b/src/thread.c index 76909d67..4093f1a3 100644 --- a/src/thread.c +++ b/src/thread.c @@ -220,6 +220,48 @@ static int thr_stop(void) } OPTCMD_DEFINE_CMD(stop, thr_stop); +static int print_one_core(struct pdbg_target *core) +{ + struct core_state cstate; + char s; + + if (!path_target_selected(core)) { + printf("--- "); + return 0; + } + + cstate = core_status(core); + + switch (cstate.smt_state) { + case PDBG_SMT_1: + s = '1'; + break; + + case PDBG_SMT_2: + s = '2'; + break; + + case PDBG_SMT_4: + s = '4'; + break; + + case PDBG_SMT_8: + s = '8'; + break; + + default: + s = '.'; + break; + } + + printf("%c%c%c ", + s, + (cstate.fused_core_mode ? 'F': 'N'), + (cstate.lpar_per_thread ? 'T': 'C')); + + return 1; +} + static int print_one_thread(struct pdbg_target *thread) { @@ -233,7 +275,6 @@ static int print_one_thread(struct pdbg_target *thread) tstate = thread_status(thread); - switch (tstate.sleep_state) { case PDBG_THREAD_STATE_DOZE: c = 'D'; @@ -292,7 +333,7 @@ static int thread_status_print(void) if (pdbg_target_status(pib) != PDBG_TARGET_ENABLED) continue; - printf("\np%01dt:", pdbg_target_index(pib)); + printf("\np%01dt: ", pdbg_target_index(pib)); for (i = 0; i < threads_per_core; i++) printf(" %d", i); printf("\n"); @@ -304,6 +345,7 @@ static int thread_status_print(void) continue; printf("c%02d: ", pdbg_target_index(core)); + print_one_core(core); pdbg_for_each_target("thread", core, thread) count += print_one_thread(thread);