TianoCore EDK2 master
Loading...
Searching...
No Matches
Dp.c File Reference
#include "Dp.h"
#include "Literals.h"
#include "DpInternal.h"

Go to the source code of this file.

Data Structures

struct  RSDT_TABLE
 
struct  XSDT_TABLE
 
struct  HANDLE_GUID_MAP
 

Functions

VOID DumpStatistics (void)
 
EFI_STATUS GetBootPerformanceTable ()
 
VOID GetHandleFormModuleGuid (IN EFI_GUID *ModuleGuid, IN OUT EFI_HANDLE *Handle)
 
EFI_STATUS BuildCachedGuidHandleTable (VOID)
 
VOID GetMeasurementInfo (IN EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER *RecordHeader, IN BOOLEAN IsStart, IN OUT MEASUREMENT_RECORD *Measurement)
 
VOID SearchMeasurement (IN MEASUREMENT_RECORD *EndMeasureMent)
 
EFI_STATUS BuildMeasurementList ()
 
VOID InitCumulativeData (VOID)
 
VOID InitSummaryData (VOID)
 
SHELL_STATUS RunDp (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_HII_HANDLE InitializeHiiPackage (EFI_HANDLE ImageHandle)
 

Variables

EFI_HII_HANDLE mDpHiiHandle
 
HANDLE_GUID_MAPmCacheHandleGuidTable
 
UINTN mCachePairCount = 0
 
CHAR16 mGaugeString [DP_GAUGE_STRING_LENGTH+1]
 
CHAR16 mUnicodeToken [DXE_PERFORMANCE_STRING_SIZE]
 
UINT64 mInterestThreshold
 
BOOLEAN mShowId = FALSE
 
UINT8 * mBootPerformanceTable
 
UINTN mBootPerformanceTableSize
 
BOOLEAN mPeiPhase = FALSE
 
BOOLEAN mDxePhase = FALSE
 
UINT64 mResetEnd = 0
 
PERF_SUMMARY_DATA SummaryData = { 0 }
 Create the SummaryData structure and init. to ZERO.
 
MEASUREMENT_RECORDmMeasurementList = NULL
 
UINTN mMeasurementNum = 0
 
PERF_CUM_DATA CumData []
 Items for which to gather cumulative statistics.
 
UINT32 const NumCum = sizeof (CumData) / sizeof (PERF_CUM_DATA)
 Number of items for which we are gathering cumulative statistics.
 
STATIC CONST SHELL_PARAM_ITEM ParamList []
 

Detailed Description

Shell command for Displaying Performance Metrics.

The Dp command reads performance data and presents it in several different formats depending upon the needs of the user. Both Trace and Measured Profiling information is processed and presented.

Dp uses the "PerformanceLib" to read the measurement records. The "TimerLib" provides information about the timer, such as frequency, beginning, and ending counter values. Measurement records contain identifying information (Handle, Token, Module) and start and end time values. Dp uses this information to group records in different ways. It also uses timer information to calculate elapsed time for each measurement.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Dp.c.

Function Documentation

◆ BuildCachedGuidHandleTable()

EFI_STATUS BuildCachedGuidHandleTable ( VOID  )

Cache the GUID and handle mapping pairs. In order to save time for searching.

Definition at line 192 of file Dp.c.

◆ BuildMeasurementList()

EFI_STATUS BuildMeasurementList ( )

Generate the measure record array.

Definition at line 546 of file Dp.c.

◆ DumpStatistics()

VOID DumpStatistics ( void  )

Display the trailing Verbose information.

Definition at line 97 of file Dp.c.

◆ GetBootPerformanceTable()

EFI_STATUS GetBootPerformanceTable ( )

Get Boot performance table form Acpi table.

Definition at line 129 of file Dp.c.

◆ GetHandleFormModuleGuid()

VOID GetHandleFormModuleGuid ( IN EFI_GUID ModuleGuid,
IN OUT EFI_HANDLE Handle 
)

Get Handle form Module Guid.

Parameters
ModuleGuidModule Guid.
HandleThe handle to be returned.

Definition at line 161 of file Dp.c.

◆ GetMeasurementInfo()

VOID GetMeasurementInfo ( IN EFI_ACPI_5_0_FPDT_PERFORMANCE_RECORD_HEADER RecordHeader,
IN BOOLEAN  IsStart,
IN OUT MEASUREMENT_RECORD Measurement 
)

Get Measurement form Fpdt records.

Parameters
RecordHeaderPointer to the start record.
IsStartIs start record or End record.
MeasurementPointer to the measurement which need to be filled.

Definition at line 285 of file Dp.c.

◆ InitCumulativeData()

VOID InitCumulativeData ( VOID  )

Initialize the cumulative data.

Definition at line 627 of file Dp.c.

◆ InitializeHiiPackage()

EFI_HII_HANDLE InitializeHiiPackage ( EFI_HANDLE  ImageHandle)

Retrieve HII package list from ImageHandle and publish to HII database.

Parameters
ImageHandleThe image handle of the process.
Returns
HII handle.

Definition at line 992 of file Dp.c.

◆ InitSummaryData()

VOID InitSummaryData ( VOID  )

Initialize the Summary data.

Definition at line 646 of file Dp.c.

◆ RunDp()

SHELL_STATUS RunDp ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Dump performance data.

Parameters
[in]ImageHandleThe image handle.
[in]SystemTableThe system table.
Return values
SHELL_SUCCESSCommand completed successfully.
SHELL_INVALID_PARAMETERCommand usage error.
SHELL_ABORTEDThe user aborts the operation.
valueUnknown error.

Definition at line 670 of file Dp.c.

◆ SearchMeasurement()

VOID SearchMeasurement ( IN MEASUREMENT_RECORD EndMeasureMent)

Search the start measurement in the mMeasurementList for the end measurement.

Parameters
EndMeasureMentMeasurement for end record.

Definition at line 504 of file Dp.c.

Variable Documentation

◆ CumData

PERF_CUM_DATA CumData[]
Initial value:
= {
}
#define PERF_INIT_CUM_DATA(t)
Definition: Dp.h:75
#define DRIVERBINDING_START_TOK
Driver Binding Start() function call.
#define LOAD_IMAGE_TOK
Load a dispatched module.
#define START_IMAGE_TOK
Dispatched Modules Entry Point execution.
#define DRIVERBINDING_SUPPORT_TOK
Driver Binding Support() function call.

Items for which to gather cumulative statistics.

Definition at line 67 of file Dp.c.

◆ mBootPerformanceTable

UINT8* mBootPerformanceTable

Definition at line 56 of file Dp.c.

◆ mBootPerformanceTableSize

UINTN mBootPerformanceTableSize

Definition at line 57 of file Dp.c.

◆ mCacheHandleGuidTable

HANDLE_GUID_MAP* mCacheHandleGuidTable

Definition at line 46 of file Dp.c.

◆ mCachePairCount

UINTN mCachePairCount = 0

Definition at line 47 of file Dp.c.

◆ mDpHiiHandle

EFI_HII_HANDLE mDpHiiHandle

Module-Global Variables

Definition at line 39 of file Dp.c.

◆ mDxePhase

BOOLEAN mDxePhase = FALSE

Definition at line 59 of file Dp.c.

◆ mGaugeString

CHAR16 mGaugeString[DP_GAUGE_STRING_LENGTH+1]

Module-Global Variables

Definition at line 52 of file Dp.c.

◆ mInterestThreshold

UINT64 mInterestThreshold

Definition at line 54 of file Dp.c.

◆ mMeasurementList

MEASUREMENT_RECORD* mMeasurementList = NULL

Definition at line 63 of file Dp.c.

◆ mMeasurementNum

UINTN mMeasurementNum = 0

Definition at line 64 of file Dp.c.

◆ mPeiPhase

BOOLEAN mPeiPhase = FALSE

Definition at line 58 of file Dp.c.

◆ mResetEnd

UINT64 mResetEnd = 0

Definition at line 60 of file Dp.c.

◆ mShowId

BOOLEAN mShowId = FALSE

Definition at line 55 of file Dp.c.

◆ mUnicodeToken

CHAR16 mUnicodeToken[DXE_PERFORMANCE_STRING_SIZE]

Definition at line 53 of file Dp.c.

◆ NumCum

UINT32 const NumCum = sizeof (CumData) / sizeof (PERF_CUM_DATA)

Number of items for which we are gathering cumulative statistics.

Definition at line 76 of file Dp.c.

◆ ParamList

Initial value:
= {
{ L"-v", TypeFlag },
{ L"-A", TypeFlag },
{ L"-R", TypeFlag },
{ L"-s", TypeFlag },
{ L"-x", TypeFlag },
{ L"-i", TypeFlag },
{ L"-c", TypeValue },
{ L"-n", TypeValue },
{ L"-t", TypeValue },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 78 of file Dp.c.

◆ SummaryData

PERF_SUMMARY_DATA SummaryData = { 0 }

Create the SummaryData structure and init. to ZERO.

Definition at line 62 of file Dp.c.