-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 1306: Design update for Mu telemetry
Design update for Mu telemetry: 1. A new CPER section type and structure is defined for telemetry report (MuTelemetrySectionType will be the one and only data acknowledged by the listeners); 2. Added helper library to assist mu telemetry reporting; 3. Updated backend processing to work with newly defined structure in #1; 4. Updated unit test application to test new library APIs and backend routines;
- Loading branch information
Showing
25 changed files
with
1,238 additions
and
1,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** @file -- MsWheaErrorStatus.h | ||
This header file defines the Guid and data structure of Mu Telemetry section type | ||
that will be used in Common Platform Error Record (CPER) for WHEA events. | ||
Copyright (C) Microsoft Corporation. All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
**/ | ||
|
||
#ifndef __MU_TELEMETRY_CPER_SECTION_DATA__ | ||
#define __MU_TELEMETRY_CPER_SECTION_DATA__ | ||
|
||
#define MU_TELEMETRY_SECTION_TYPE_GUID \ | ||
{ \ | ||
0x85183a8b, 0x9c41, 0x429c, { 0x93, 0x9c, 0x5c, 0x3c, 0x08, 0x7c, 0xa2, 0x80 } \ | ||
} | ||
|
||
extern EFI_GUID gMuTelemetrySectionTypeGuid; | ||
|
||
#pragma pack(1) | ||
|
||
/** | ||
Telemetry report structure. This structure corresponds to the gMuTelemetrySectionTypeGuid. | ||
This will contain the most essential information regarding the error of interest. Any | ||
other arbitrary data will not be reported/collected through telemetry pipeline | ||
Note: Please be compliant with privacy policy. Microsoft is not responsible for | ||
sanitizing the data being transported to cloud. | ||
ComponentID: Component Guid which invoked telemetry report, will be gCallerId if not supplied. | ||
SubComponentID: Subcomponent Guid which invoked telemetry report, will be NULL if not supplied. | ||
Reserved: Not used | ||
ErrorStatusValue: Reported Status Code Value upon calling ReportStatusCode | ||
AdditionalInfo1: 64 bit value used for caller to include necessary interrogative information | ||
AdditionalInfo2: Secondary 64 bit value, usage same as AdditionalInfo1 | ||
**/ | ||
typedef struct { | ||
EFI_GUID ComponentID; | ||
EFI_GUID SubComponentID; | ||
UINT32 Reserved; | ||
EFI_STATUS_CODE_VALUE ErrorStatusValue; | ||
UINT64 AdditionalInfo1; | ||
UINT64 AdditionalInfo2; | ||
} MU_TELEMETRY_CPER_SECTION_DATA; | ||
|
||
#pragma pack() | ||
|
||
#endif // __MU_TELEMETRY_CPER_SECTION_DATA__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** @file -- MuTelemetryHelperLib.h | ||
Helper functions to make it even easier to report telemetry events in | ||
source code. | ||
Copyright (c) 2019, Microsoft Corporation | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | ||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
**/ | ||
|
||
#ifndef _MU_TELEMETRY_HELPER_LIB_H_ | ||
#define _MU_TELEMETRY_HELPER_LIB_H_ | ||
|
||
// TODO: This is against common Mu practice. | ||
#include <Library/ReportStatusCodeLib.h> | ||
|
||
// TODO: Make this a MACRO so it can be disabled. | ||
|
||
/** | ||
Helper function to minimize the number of parameters for a critical telemetry event | ||
and to clarify the purpose of each field. | ||
This helper constructs the most detailed report possible that can still be persisted in case | ||
of power loss or reset. It will log a critical fatal event through the telemetry system. | ||
@param[in] ComponentId [Optional] This identifier should uniquely identify the module that is emitting this | ||
event. When this is passed in as NULL, report status code will automatically populate | ||
this field with gEfiCallerIdGuid. | ||
@param[in] ClassId An EFI_STATUS_CODE_VALUE representing the event that has occurred. This | ||
value will occupy the same space as EventId from LogCriticalEvent(), and | ||
should be unique enough to identify a module or region of code. | ||
@param[in] LibraryId This should identify the library that is emitting this event. | ||
@param[in] IhvId This should identify the Ihv related to this event if applicable. For example, | ||
this would typically be used for TPM and SOC specific events. | ||
@param[in] ExtraData1 [Optional] This should be data specific to the cause. Ideally, used to contain contextual | ||
or runtime data related to the event (e.g. register contents, failure codes, etc.). | ||
It will be persisted. | ||
@param[in] ExtraData2 [Optional] Another UINT32 similar to ExtraData1. | ||
@retval EFI_SUCCESS Event has been reported. | ||
@retval EFI_ERROR Something has gone wrong. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
LogTelemetry ( | ||
IN BOOLEAN IsFatal, | ||
IN EFI_GUID* ComponentId OPTIONAL, | ||
IN EFI_STATUS_CODE_VALUE ClassId, | ||
IN EFI_GUID* LibraryId OPTIONAL, | ||
IN EFI_GUID* IhvId OPTIONAL, | ||
IN UINT64 ExtraData1, | ||
IN UINT64 ExtraData2 | ||
); | ||
|
||
|
||
#endif // _MU_TELEMETRY_HELPER_LIB_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.