Keep hostcall CPU profiling off hot paths

This commit is contained in:
root
2026-07-17 02:35:03 +00:00
parent c15fdc3346
commit 5a5450caa8
6 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -1676,7 +1676,7 @@ StringMap make_server_settings()
cfg["BIN_DIRECTORY"] = "/tmp/uce/work";
cfg["WASM_COMPILE_SCRIPT"] = "scripts/compile_wasm_unit";
cfg["WASM_BACKEND_VERBOSE"] = "0";
cfg["WASM_PROFILE_HOSTCALL_CPU"] = "1";
cfg["WASM_PROFILE_HOSTCALL_CPU"] = "0";
cfg["WASM_CORE_PATH"] = "";
cfg["WASM_MEMORY_LIMIT_BYTES"] = std::to_string(512ull * 1024 * 1024);
cfg["WASM_EPOCH_DEADLINE_TICKS"] = "200";
+1 -1
View File
@@ -53,7 +53,7 @@ static String wasm_backend_ensure_started(Request* context)
wc.memory_limit = (int64_t)to_u64(cfg["WASM_MEMORY_LIMIT_BYTES"], 512ull * 1024 * 1024);
wc.epoch_deadline_ticks = to_u64(cfg["WASM_EPOCH_DEADLINE_TICKS"], 200);
wc.mysql_persistent_pool_size = std::min<u64>(to_u64(cfg["MYSQL_PERSISTENT_POOL_SIZE"], 8), 64);
wc.profile_hostcall_cpu = to_bool(cfg["WASM_PROFILE_HOSTCALL_CPU"], true);
wc.profile_hostcall_cpu = to_bool(cfg["WASM_PROFILE_HOSTCALL_CPU"], false);
wc.verbose = to_bool(cfg["WASM_BACKEND_VERBOSE"], false);
// UCE_HOSTCALL_BLOCKLIST: comma-separated uce_host_* names (with or without
// the "uce_host_" prefix) the sysadmin disables; each blocked call traps into
+2 -1
View File
@@ -125,7 +125,7 @@ struct WasmWorkerConfig
u32 table_headroom = 4096;
u64 epoch_deadline_ticks = 200; // ticker period × ticks = CPU budget
u64 mysql_persistent_pool_size = 8;
bool profile_hostcall_cpu = true;
bool profile_hostcall_cpu = false;
bool verbose = false;
// uce_host_* names (bare, without the "uce_host_" prefix) the sysadmin has
// disabled via UCE_HOSTCALL_BLOCKLIST. A blocked hostcall resolves to a trap
@@ -2349,6 +2349,7 @@ private:
response["execution_cpu_us"] = (f64)(workspace_cpu_us > phase_cpu_us ? workspace_cpu_us - phase_cpu_us : 0);
response["hostcall_count"] = (f64)self->hostcall_count;
response["hostcall_us"] = (f64)self->hostcall_total_us;
response["hostcall_cpu_profiled"].set_bool(self->worker.cfg.profile_hostcall_cpu);
response["hostcall_cpu_us"] = (f64)self->hostcall_cpu_total_us;
std::vector<u64> invoked_hostcalls;
for(u64 i = 0; i < self->hostcall_operation_slots; i++)