Add frontend stuff instrumentation tooling

//+no-instrumentation
@(no_instrumentation)
@(instrumentation_enter)
@(instrumentation_exit)
This commit is contained in:
gingerBill
2024-01-07 19:56:00 +00:00
parent 1e1228fb37
commit aff8f06e3c
6 changed files with 140 additions and 12 deletions
+24 -11
View File
@@ -103,6 +103,12 @@ struct DeferredProcedure {
};
enum InstrumentationFlag : i32 {
Instrumentation_Enabled = -1,
Instrumentation_Default = 0,
Instrumentation_Disabled = +1,
};
struct AttributeContext {
String link_name;
String link_prefix;
@@ -113,20 +119,23 @@ struct AttributeContext {
String deprecated_message;
String warning_message;
DeferredProcedure deferred_procedure;
bool is_export : 1;
bool is_static : 1;
bool require_results : 1;
bool require_declaration : 1;
bool has_disabled_proc : 1;
bool disabled_proc : 1;
bool test : 1;
bool init : 1;
bool fini : 1;
bool set_cold : 1;
bool entry_point_only : 1;
bool is_export : 1;
bool is_static : 1;
bool require_results : 1;
bool require_declaration : 1;
bool has_disabled_proc : 1;
bool disabled_proc : 1;
bool test : 1;
bool init : 1;
bool fini : 1;
bool set_cold : 1;
bool entry_point_only : 1;
bool instrumentation_enter : 1;
bool instrumentation_exit : 1;
u32 optimization_mode; // ProcedureOptimizationMode
i64 foreign_import_priority_index;
String extra_linker_flags;
InstrumentationFlag no_instrumentation;
String objc_class;
String objc_name;
@@ -403,6 +412,10 @@ struct CheckerInfo {
BlockingMutex all_procedures_mutex;
Array<ProcInfo *> all_procedures;
BlockingMutex instrumentation_mutex;
Entity *instrumentation_enter_entity;
Entity *instrumentation_exit_entity;
};
struct CheckerContext {