1# Copyright (c) 2021 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# 26 27events: 28- name: osr_entry 29 fields: 30 - name: method_name 31 type: std::string 32 - name: bc_offset 33 type: size_t 34 - name: kind 35 type: enum 36 enum: [after_cframe, after_iframe, top_frame] 37 - name: result 38 type: enum 39 enum: [success, error] 40 41- name: inline 42 fields: 43 - name: caller 44 type: std::string 45 - name: callee 46 type: std::string 47 - name: call_inst_id 48 type: int 49 - name: kind 50 type: enum 51 enum: [static, virtual, virtual_cha, virtual_monomorphic, virtual_polymorphic] 52 - name: result 53 type: enum 54 enum: [success, fail, fail_resolve, fail_megamorphic, unsuitable, noinline, lost_single_impl, limit, devirtualized] 55 56- name: deoptimization 57 fields: 58 - name: method_name 59 type: std::string 60 - name: pc 61 type: const void* 62 - name: after 63 type: enum 64 enum: [cframe, iframe, top] 65 66- name: exception 67 fields: 68 - name: method_name 69 type: std::string 70 - name: pc 71 type: size_t 72 - name: npc 73 type: size_t 74 - name: type 75 type: enum 76 enum: [null_check, bound_check, negative_size, native, throw, abstract_method, arithmetic, instantiation_error, cast_check] 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: cha_invalidate 106 fields: 107 - name: method 108 type: std::string 109 - name: loaded_class 110 type: std::string 111 112- name: cha_deoptimize 113 fields: 114 - name: method 115 type: std::string 116 - name: in_stack_count 117 type: size_t 118 119- name: interp_profiling 120 fields: 121 - name: action 122 type: enum 123 enum: [start, stop] 124 - name: method 125 type: PandaString 126 - name: vcalls_num 127 type: size_t 128 129- name: method_enter 130 enable: false 131 fields: 132 - name: method 133 type: PandaString 134 - name: kind 135 type: enum 136 enum: [interp, compiled, inlined] 137 - name: depth 138 type: int 139 140- name: method_exit 141 enable: false 142 fields: 143 - name: method 144 type: PandaString 145 - name: kind 146 type: enum 147 enum: [interp, compiled, inlined] 148 - name: depth 149 type: int 150 151- name: tlab_alloc 152 fields: 153 - name: thread_id 154 type: size_t 155 - name: tlab 156 type: size_t 157 - name: instruction 158 type: PandaString 159 - name: allocate_memory 160 type: size_t 161 - name: size 162 type: int 163 164- name: aot_resolve_string 165 fields: 166 - name: value 167 type: PandaString 168 169- name: aot_loaded_for_class 170 fields: 171 - name: filename 172 type: PandaString 173 - name: classname 174 type: PandaString 175 176- name: aot_entrypoint_found 177 fields: 178 - name: methodname 179 type: PandaString 180 181- name: jit_use_resolved_string 182 fields: 183 - name: method_name 184 type: std::string 185 - name: string_id 186 type: int 187