1# Copyright (c) 2021-2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13# 14# To add new event, create new record in the 'events' section with following fields: 15# - name - name of the event 16# - fields - data fields that will be stored within event. The type of each field should be a real C++ type, except enum. 17# Then you can dump your event by writing EVENT_<name.upcase()>(values). For example, for 'osr_entry' event it will be: 18# EVENT_OSR_ENTRY(method->GetFullName(), bc, events::OsrEntryKind::TOP_FRAME, events::OsrEntryResult::SUCCESS) 19# 20# There are may be several backends(streams) for events, such as csv file, memory, etc. 21# Backend can be chosen in runtime by invoking Events::Create(<Events::StreamKind>). 22# The following streams are currently available: 23# - EventsMemory: store events in the heap memory, useful for tests. 24# - EventsCsv: dump events to the csv file, useful for statistics gathering. 25# 26events: 27- name: osr_entry 28 fields: 29 - name: method_name 30 type: std::string 31 - name: bc_offset 32 type: size_t 33 - name: kind 34 type: enum 35 enum: [after_cframe, after_iframe, top_frame] 36 - name: result 37 type: enum 38 enum: [success, error] 39 40- name: inline 41 fields: 42 - name: caller 43 type: std::string 44 - name: callee 45 type: std::string 46 - name: call_inst_id 47 type: int 48 - name: kind 49 type: enum 50 enum: [static, virtual, virtual_cha, virtual_monomorphic, virtual_polymorphic] 51 - name: result 52 type: enum 53 enum: [success, fail, fail_resolve, fail_megamorphic, unsuitable, noinline, lost_single_impl, limit, devirtualized, inf_loop, skip_external] 54 55- name: deoptimization 56 fields: 57 - name: method_name 58 type: std::string 59 - name: pc 60 type: uintptr_t 61 - name: after 62 type: enum 63 enum: [cframe, iframe, top] 64 65- name: exception 66 fields: 67 - name: method_name 68 type: std::string 69 - name: pc 70 type: size_t 71 - name: npc 72 type: size_t 73 - name: type 74 type: enum 75 enum: [null_check, bound_check, negative_size, native, throw, abstract_method, arithmetic, instantiation_error, 76 cast_check, stack_overflow, icce_method_conflict] 77 78- name: compilation 79 fields: 80 - name: method_name 81 type: std::string 82 - name: is_osr 83 type: bool 84 - name: bc_size 85 type: size_t 86 dscr: "Bytecode size of the method" 87 - name: address 88 type: uintptr_t 89 dscr: "Address of generated code" 90 - name: code_size 91 type: size_t 92 dscr: "Size of generated code" 93 - name: info_size 94 type: size_t 95 dscr: "Metainfo size for generated code" 96 - name: status 97 type: enum 98 enum: [compiled, failed, dropped, failed_single_impl] 99 100- name: paoc 101 fields: 102 - name: description 103 type: std::string 104 105- name: intrinsic_compilation 106 fields: 107 - name: name 108 type: std::string 109 - name: result 110 type: enum 111 enum: [inlined, inline_failed] 112 113- name: cha_invalidate 114 fields: 115 - name: method 116 type: std::string 117 - name: loaded_class 118 type: std::string 119 120- name: cha_deoptimize 121 fields: 122 - name: method 123 type: std::string 124 - name: in_stack_count 125 type: size_t 126 127- name: interp_profiling 128 fields: 129 - name: action 130 type: enum 131 enum: [start, stop] 132 - name: method 133 type: PandaString 134 - name: vcalls_num 135 type: size_t 136 137- name: method_enter 138 enable: false 139 fields: 140 - name: method 141 type: PandaString 142 - name: kind 143 type: enum 144 enum: [interp, compiled, inlined] 145 - name: depth 146 type: int 147 148- name: method_exit 149 enable: false 150 fields: 151 - name: method 152 type: PandaString 153 - name: kind 154 type: enum 155 enum: [interp, compiled, inlined] 156 - name: depth 157 type: int 158 159- name: tlab_alloc 160 fields: 161 - name: thread_id 162 type: size_t 163 - name: tlab 164 type: size_t 165 - name: instruction 166 type: PandaString 167 - name: allocate_memory 168 type: size_t 169 - name: size 170 type: int 171 172- name: slowpath_alloc 173 fields: 174 - name: thread_id 175 type: size_t 176 177- name: aot_resolve_string 178 fields: 179 - name: value 180 type: PandaString 181 182- name: aot_loaded_for_class 183 fields: 184 - name: filename 185 type: PandaString 186 - name: classname 187 type: PandaString 188 189- name: aot_entrypoint_found 190 fields: 191 - name: methodname 192 type: PandaString 193 194- name: jit_use_resolved_string 195 fields: 196 - name: method_name 197 type: std::string 198 - name: string_id 199 type: int 200 201- name: implicit_nullcheck 202 fields: 203 - name: pc 204 type: uintptr_t 205 206- name: aot_manager 207 fields: 208 - name: aot_file 209 type: std::string 210 - name: action 211 type: enum 212 enum: [added, open_failed, verified, cha_verify_failed, file_verify_failed] 213 214- name: codegen_simplification 215 fields: 216 - name: inst 217 type: enum 218 enum: [checkcast, isinstance] 219 - name: reason 220 type: enum 221 enum: [final_class, skip_nullcheck]