From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: zhichao.gao@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Tue, 28 May 2019 17:31:56 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 17:31:55 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2019 17:31:55 -0700 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 28 May 2019 17:31:55 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 28 May 2019 17:31:54 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.70]) with mapi id 14.03.0415.000; Wed, 29 May 2019 08:31:53 +0800 From: "Gao, Zhichao" To: "Bi, Dandan" , "devel@edk2.groups.io" , "oleksiyy@ami.com" CC: "Carsey, Jaben" , "Ni, Ray" Subject: Re: [patch] ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData Thread-Topic: [patch] ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData Thread-Index: AQHVFPyx4N8u0yxCTkGw/s2i/uX7BqaBQJVg Date: Wed, 29 May 2019 00:31:51 +0000 Message-ID: <3CE959C139B4C44DBEA1810E3AA6F9000B7D5896@SHSMSX101.ccr.corp.intel.com> References: <20190528022509.15152-1-dandan.bi@intel.com> In-Reply-To: <20190528022509.15152-1-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhichao.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Zhichao Gao > -----Original Message----- > From: Bi, Dandan > Sent: Tuesday, May 28, 2019 10:25 AM > To: devel@edk2.groups.io; oleksiyy@ami.com > Cc: Carsey, Jaben ; Ni, Ray ; > Gao, Zhichao > Subject: [patch] ShellPkg/Debug1CommandsLib: Fix bugs in func > DisplaySysEventLogData >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1498 >=20 > This patch fix following bugs in func DisplaySysEventLogData: > 1. Log increment (Log =3D (LOG_RECORD_FORMAT *) (LogData + Offset);) > should happened in the end of while loop, not in the very beginning. > 2. DisplaySELTypes function should be used in while loop instead of > DisplaySELVarDataFormatType. >=20 > Cc: Jaben Carsey > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Dandan Bi > --- > .../SmbiosView/EventLogInfo.c | 20 +++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) >=20 > diff --git > a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInf > o.c > b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInf > o.c > index b8adf438d3..984c178890 100644 > --- > a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInf > o.c > +++ > b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInf > +++ o.c > @@ -1,9 +1,9 @@ > /** @file > Module for clarifying the content of the smbios structure element info= . >=20 > - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. > + Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved. > +
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ >=20 > #include "UefiShellDebug1CommandsLib.h" > @@ -345,20 +345,16 @@ DisplaySysEventLogData ( > // Print Log info > // > Offset =3D 0; > Log =3D (LOG_RECORD_FORMAT *) LogData; > while (Log !=3D NULL && Log->Type !=3D END_OF_LOG && Offset < > LogAreaLength) { > - // > - // Get a Event Log Record > - // > - Log =3D (LOG_RECORD_FORMAT *) (LogData + Offset); >=20 > if (Log !=3D NULL) { > // > // Display Event Log Record Information > // > - DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL); > + DisplaySELTypes (Log->Type, SHOW_DETAIL); > DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL); >=20 > Offset +=3D Log->Length; > // > // Display Log Header Date/Time Fields @@ -371,10 +367,14 @@ > DisplaySysEventLogData ( > Print (L"19"); > } else if (Log !=3D NULL && Log->Year <=3D 79) { > Print (L"20"); > } else { > ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN > (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle); > + // > + // Get a Event Log Record > + // > + Log =3D (LOG_RECORD_FORMAT *) (LogData + Offset); > continue; > } >=20 > ShellPrintHiiEx(-1,-1,NULL, > STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS), > @@ -389,13 +389,21 @@ DisplaySysEventLogData ( >=20 > // > // Display Variable Data Format > // > if (Log->Length <=3D (sizeof (LOG_RECORD_FORMAT) - 1)) { > + // > + // Get a Event Log Record > + // > + Log =3D (LOG_RECORD_FORMAT *) (LogData + Offset); > continue; > } >=20 > ElVdfType =3D Log->LogVariableData[0]; > DisplayElVdfInfo (ElVdfType, Log->LogVariableData); > + // > + // Get a Event Log Record > + // > + Log =3D (LOG_RECORD_FORMAT *) (LogData + Offset); > } > } > } > -- > 2.18.0.windows.1