Commit ae0bd3a983023aeb48b4ab3f417e5a62f8f72c37

Authored by Heinrich Schuchardt
Committed by Alexander Graf
1 parent da94073b42

efi_loader: write protocol GUID in OpenProtocol

To understand what is happening in OpenProtocol or LocateProtocol
it is necessary to know the protocol interface GUID.
Let's write a debug message.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 2 changed files with 17 additions and 0 deletions Side-by-side Diff

include/efi_loader.h
... ... @@ -17,6 +17,7 @@
17 17  
18 18 int __efi_entry_check(void);
19 19 int __efi_exit_check(void);
  20 +const char *__efi_nesting(void);
20 21 const char *__efi_nesting_inc(void);
21 22 const char *__efi_nesting_dec(void);
22 23  
... ... @@ -50,6 +51,13 @@
50 51 assert(__efi_entry_check()); \
51 52 debug("%sEFI: Return From: %s\n", __efi_nesting_dec(), #exp); \
52 53 } while(0)
  54 +
  55 +/*
  56 + * Write GUID
  57 + */
  58 +#define EFI_PRINT_GUID(txt, guid) ({ \
  59 + debug("%sEFI: %s %pUl\n", __efi_nesting(), txt, guid); \
  60 + })
53 61  
54 62 extern struct efi_runtime_services efi_runtime_services;
55 63 extern struct efi_system_table systab;
lib/efi_loader/efi_boottime.c
... ... @@ -109,6 +109,11 @@
109 109 return &indent[max - level];
110 110 }
111 111  
  112 +const char *__efi_nesting(void)
  113 +{
  114 + return indent_string(nesting_level);
  115 +}
  116 +
112 117 const char *__efi_nesting_inc(void)
113 118 {
114 119 return indent_string(nesting_level++);
... ... @@ -1021,6 +1026,8 @@
1021 1026 if (!protocol || !protocol_interface)
1022 1027 return EFI_EXIT(EFI_INVALID_PARAMETER);
1023 1028  
  1029 + EFI_PRINT_GUID("protocol", protocol);
  1030 +
1024 1031 list_for_each(lhandle, &efi_obj_list) {
1025 1032 struct efi_object *efiobj;
1026 1033  
... ... @@ -1133,6 +1140,8 @@
1133 1140 EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) {
1134 1141 goto out;
1135 1142 }
  1143 +
  1144 + EFI_PRINT_GUID("protocol", protocol);
1136 1145  
1137 1146 switch (attributes) {
1138 1147 case EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL: