2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 #ifndef AJLA_PROFILE_H
20 #define AJLA_PROFILE_H
24 extern uchar_efficient_t profiling
;
25 extern uchar_efficient_t profiling_escapes
;
27 typedef uint_efficient_t profile_counter_t
;
29 void profile_unblock(void);
30 profile_counter_t
profile_sample(void);
31 void profile_collect(const char *function_name
, profile_counter_t profiling_counter
, profile_counter_t call_counter
);
32 void profile_escape_collect(const char *function_name
, profile_counter_t profiling_counter
, unsigned line
, code_t code
, unsigned short compile_line
);
34 bool function_enable_profile(const char *option
, size_t l
);
36 void profile_init(void);
37 void profile_done(void);