Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/code-gen/vertex-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ void compile_func_call(VertexAdaptor<op_func_call> root, CodeGenerator &W, func_
}

if (is_function_call_should_be_tracked(func)) {
W << "SAVE_BUILTIN_CALL_STATS(\"" << func->name << "\", (";
W << "DUMP_BUILTIN_CALL_STATS(\"" << func->name << "\", (";
}

if (mode == func_call_mode::fork_call) {
Expand Down
9 changes: 9 additions & 0 deletions runtime-light/stdlib/diagnostics/functions-call-stats.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2026 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#pragma once

#include "runtime-light/stdlib/diagnostics/logs.h"

#define DUMP_BUILTIN_CALL_STATS(builtin_name, builtin_call) (kphp::log::debug("built-in called: " builtin_name), builtin_call)
2 changes: 1 addition & 1 deletion runtime/runtime-builtin-stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ inline void save_virtual_builtin_call_stats(const kphp::stl::string<kphp::memory
}
} // namespace runtime_builtins_stats

#define SAVE_BUILTIN_CALL_STATS(builtin_name, builtin_call) \
#define DUMP_BUILTIN_CALL_STATS(builtin_name, builtin_call) \
(!runtime_builtins_stats::request_stats.has_value() ? 0 : (*runtime_builtins_stats::request_stats).builtin_stats[std::string_view(builtin_name)]++, \
builtin_call)
1 change: 1 addition & 0 deletions tests/kphp_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def set_up_env_for_k2(self):
self.env_vars["KPHP_ENABLE_GLOBAL_VARS_MEMORY_STATS"] = "0"
self.env_vars["KPHP_PROFILER"] = "0"
self.env_vars["KPHP_FORCE_LINK_RUNTIME"] = "1"
self.env_vars["KPHP_TRACKED_BUILTINS_LIST"] = KphpRunOnce.K2_KPHP_TRACKED_BUILTINS_LIST


def make_test_file(file_path, test_tmp_dir, test_tags):
Expand Down
Loading
Loading