From nobody Sun Nov 9 22:57:17 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552118928950585.3512391233011; Sat, 9 Mar 2019 00:08:48 -0800 (PST) Received: from localhost ([127.0.0.1]:55569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2X2B-0002sL-QR for importer@patchew.org; Sat, 09 Mar 2019 03:08:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Wip-0003yw-L8 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Wio-0000fz-L7 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:43 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2Wio-0000el-C8 for qemu-devel@nongnu.org; Sat, 09 Mar 2019 02:48:42 -0500 Received: by mail-wr1-x432.google.com with SMTP id l12so7191524wrp.6 for ; Fri, 08 Mar 2019 23:48:42 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id 11sm5252294wmg.27.2019.03.08.23.48.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Mar 2019 23:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MeXgrkegz45A7u724nmrmyFXzBs4nH52uk5SITDRMIs=; b=seHbQTuOZwPCzqn5dX0GqB+0ucAjJkXjXFRMxVQEvyn/RWA8k/3jxLT3cN1l/DRdf7 6qWunyLXBSupF3ggwMBbmrlozU6wUYBZySQ71xmpmNFP0940v/DEKFsTWr9KiSO7mesi ldWT+tiPOYEdfLTdnhHzM2fb63VAjVTnCtyrFKzGF4kQ0CTH0Vn1D54hHxTFZAj+iH7K 4D0hMa5rLFvL+/483dFg5YwBG1ZTmGliD6Sj1ZCwtxBIx0UdQQnmB7XMlR+7msqidyEx 4LqWha/aLKyddl/iUpO77zEI4f67qdZAjzIvoeh+Iy0I6zF0RDGgdJm51R5UmoOQilXO s9sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MeXgrkegz45A7u724nmrmyFXzBs4nH52uk5SITDRMIs=; b=DcBhhi/RII/fquD+hOJP7q+7yYQ8K31EXfkmunbfgSPUguCZGK1TmbBCCY8Jn/zco9 pCThnieiRQf4egTNy8JLwMCAAy+zQT57H49kq+SUANCBitMBvPPHYETOCY+ZTywhOqpt oy6hnfROcb7IAJiyCnliHetFrgymCzafiB0PHggQKCZikRWTr+nRq8Mj4qyt1TvS/dvH IiwS3B4fsEv0KJ41czNnZkM5toPjFiGuo+5iH+FPTsa179qCgk/yS+429b5CwX89UNQ9 QB7mvuWH2hX2QpYp6QMzoA7OTHWQweDPUuB2kEwB4ZN331I35/CtJPMsS1UT566B6Sji Lbzg== X-Gm-Message-State: APjAAAWEOefK9TJnHhRkL8C3M6zDKRzWzfUlLqkysbUzW7Lr7ujpUQ2Y xu+lNTsq5+HrRv4vdiYysZyBUrbk X-Google-Smtp-Source: APXvYqzSrxO98QULNb1Xk7sKXkHfeCr5iydD7c9SQGZvM+/nUPISM4sIiSVQe9AjzSZE8bWRzpzQSg== X-Received: by 2002:a05:6000:1110:: with SMTP id z16mr13911926wrw.28.1552117721081; Fri, 08 Mar 2019 23:48:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 9 Mar 2019 08:48:16 +0100 Message-Id: <1552117698-12355-24-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> References: <1552117698-12355-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PULL 23/25] lsi: use SCSI phase names instead of numbers in trace X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sven Schnelle Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Sven Schnelle This makes trace logs much easier to read, especially for people who are not fluent in SCSI. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190305195519.24303-5-svens@stackframe.org> --- hw/scsi/lsi53c895a.c | 31 +++++++++++++++++++++++-------- hw/scsi/trace-events | 6 +++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index d67584e..66f217f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -306,6 +306,22 @@ typedef struct { #define LSI53C895A(obj) \ OBJECT_CHECK(LSIState, (obj), TYPE_LSI53C895A) =20 +static const char *scsi_phases[] =3D { + "DOUT", + "DIN", + "CMD", + "STATUS", + "RSVOUT", + "RSVIN", + "MSGOUT", + "MSGIN" +}; + +static const char *scsi_phase_name(int phase) +{ + return scsi_phases[phase & PHASE_MASK]; +} + static inline int lsi_irq_on_rsl(LSIState *s) { return (s->sien0 & LSI_SIST0_RSL) && (s->scid & LSI_SCID_RRE); @@ -1201,8 +1217,9 @@ again: s->ia =3D s->dsp - 12; } if ((s->sstat1 & PHASE_MASK) !=3D ((insn >> 24) & 7)) { - trace_lsi_execute_script_blockmove_badphase(s->sstat1 & PHASE_= MASK, - (insn >> 24) & 7); + trace_lsi_execute_script_blockmove_badphase( + scsi_phase_name(s->sstat1), + scsi_phase_name(insn >> 24)); lsi_script_scsi_interrupt(s, LSI_SIST0_MA, 0); break; } @@ -1234,8 +1251,8 @@ again: lsi_do_msgin(s); break; default: - qemu_log_mask(LOG_UNIMP, "lsi_scsi: Unimplemented phase %d\n", - s->sstat1 & PHASE_MASK); + qemu_log_mask(LOG_UNIMP, "lsi_scsi: Unimplemented phase %s\n", + scsi_phase_name(s->sstat1)); } s->dfifo =3D s->dbc & 0xff; s->ctest5 =3D (s->ctest5 & 0xfc) | ((s->dbc >> 8) & 3); @@ -1463,10 +1480,8 @@ again: cond =3D s->carry !=3D 0; } if (cond =3D=3D jmp && (insn & (1 << 17))) { - trace_lsi_execute_script_tc_compp( - (s->sstat1 & PHASE_MASK), - jmp ? '=3D' : '!', - ((insn >> 24) & 7)); + trace_lsi_execute_script_tc_compp(scsi_phase_name(s->sstat= 1), + jmp ? '=3D' : '!', scsi_phase_name(insn >> 24)); cond =3D (s->sstat1 & PHASE_MASK) =3D=3D ((insn >> 24) & 7= ); } if (cond =3D=3D jmp && (insn & (1 << 18))) { diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events index 29aaa75..09f3fc3 100644 --- a/hw/scsi/trace-events +++ b/hw/scsi/trace-events @@ -268,7 +268,7 @@ lsi_memcpy(uint32_t dest, uint32_t src, int count) "mem= cpy dest 0x%"PRIx32" src lsi_wait_reselect(void) "Wait Reselect" lsi_execute_script(uint32_t dsp, uint32_t insn, uint32_t addr) "SCRIPTS ds= p=3D0x%"PRIx32" opcode 0x%"PRIx32" arg 0x%"PRIx32 lsi_execute_script_blockmove_delayed(void) "Delayed select timeout" -lsi_execute_script_blockmove_badphase(uint8_t phase, uint8_t expected) "Wr= ong phase got %d expected %d" +lsi_execute_script_blockmove_badphase(const char *phase, const char *expec= ted) "Wrong phase got %s expected %s" lsi_execute_script_io_alreadyreselected(void) "Already reselected, jumping= to alternative address" lsi_execute_script_io_selected(uint8_t id, const char *atn) "Selected targ= et %d%s" lsi_execute_script_io_disconnect(void) "Wait Disconnect" @@ -278,8 +278,8 @@ lsi_execute_script_io_opcode(const char *opcode, int re= g, const char *opname, ui lsi_execute_script_tc_nop(void) "NOP" lsi_execute_script_tc_delayedselect_timeout(void) "Delayed select timeout" lsi_execute_script_tc_compc(int result) "Compare carry %d" -lsi_execute_script_tc_compp(uint8_t phase, int op, uint8_t insn_phase) "Co= mpare phase %d %c=3D %d" -lsi_execute_script_tc_compd(uint32_t sfbr, uint8_t mask, int op, int resul= t) "Compare data 0x%"PRIx32" & 0x%x %c=3D 0x%x" +lsi_execute_script_tc_compp(const char *phase, char op, const char *insn_p= hase) "Compare phase %s %c=3D %s" +lsi_execute_script_tc_compd(uint32_t sfbr, uint8_t mask, char op, int resu= lt) "Compare data 0x%"PRIx32" & 0x%x %c=3D 0x%x" lsi_execute_script_tc_jump(uint32_t addr) "Jump to 0x%"PRIx32 lsi_execute_script_tc_call(uint32_t addr) "Call 0x%"PRIx32 lsi_execute_script_tc_return(uint32_t addr) "Return to 0x%"PRIx32 --=20 1.8.3.1