summaryrefslogtreecommitdiff
path: root/EDK/Foundation/Protocol/Performance/Performance.h
blob: 0fd5cc97282f2a7d0dd3ffc75062f8473be25169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*++

Copyright (c) 2004, Intel Corporation                                                         
All rights reserved. This program and the accompanying materials                          
are licensed and made available under the terms and conditions of the BSD License         
which accompanies this distribution.  The full text of the license may be found at        
http://opensource.org/licenses/bsd-license.php                                            
                                                                                          
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

Module Name:

  Performance.h

Abstract:

  
--*/

#ifndef _EFI_PERFORMANCE_H_
#define _EFI_PERFORMANCE_H_

#define EFI_PERFORMANCE_PROTOCOL_GUID \
  { 0xFFECFFFF, 0x923C, 0x14d2, 0x9E, 0x3F, 0x22, 0xA0, 0xC9, 0x69, 0x56, 0x3B }

#define EFI_NULL_GUID \
  { 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }


EFI_FORWARD_DECLARATION (EFI_PERFORMANCE_PROTOCOL);

#define DXE_TOK L"DXE"
#define SHELL_TOK L"SHELL"
#define PEI_TOK L"PEI"
#define BDS_TOK L"BDS"
#define DRIVERBINDING_START_TOK L"DriverBinding:Start"
#define DRIVERBINDING_SUPPORT_TOK L"DriverBinding:Support"
#define START_IMAGE_TOK L"StartImage"
#define LOAD_IMAGE_TOK L"LoadImage"

#define DXE_PHASE 0
#define SHELL_PHASE 1
#define PEI_PHASE 2

#define EFI_PERF_TOKEN_LENGTH        32
#define EFI_PERF_HOST_LENGTH         32
#define EFI_PERF_PDBFILENAME_LENGTH  28

typedef struct {
  EFI_HANDLE        Handle; 
  UINT16            Token[EFI_PERF_TOKEN_LENGTH];
  UINT16            Host[EFI_PERF_HOST_LENGTH];
  UINT64            StartTick;
  UINT64            EndTick;
  EFI_GUID          GuidName;
  UINT8             PdbFileName[EFI_PERF_PDBFILENAME_LENGTH];
  UINT8             Phase;
} EFI_GAUGE_DATA ;


typedef 
EFI_STATUS
(EFIAPI * EFI_PERF_START_GAUGE) (
  IN EFI_PERFORMANCE_PROTOCOL *This,
  IN EFI_HANDLE        Handle,
  IN UINT16           *Token,
  IN UINT16           *Host,
  IN UINT64           Ticker
  );

typedef 
EFI_STATUS
(EFIAPI * EFI_PERF_END_GAUGE) (
  IN EFI_PERFORMANCE_PROTOCOL *This,
  IN EFI_HANDLE        Handle,
  IN UINT16           *Token,
  IN UINT16           *Host,
  IN UINT64           Ticker
  );


typedef 
EFI_GAUGE_DATA *
(EFIAPI * EFI_PERF_GET_GAUGE) (
  IN EFI_PERFORMANCE_PROTOCOL *This,
  IN EFI_HANDLE                       Handle,     
  IN UINT16                           *Token,     
  IN UINT16                           *Host,      
  IN EFI_GAUGE_DATA                   *PrevGauge      
  );


typedef struct _EFI_PERFORMANCE_PROTOCOL{
  EFI_PERF_START_GAUGE  StartGauge;
  EFI_PERF_END_GAUGE    EndGauge;
  EFI_PERF_GET_GAUGE    GetGauge;
} EFI_PERFORMANCE_PROTOCOL;

extern EFI_GUID gEfiPerformanceProtocolGuid;

#endif