diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-09 14:27:33 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-09 15:27:32 +0100 |
commit | 084dc96bc564b814b7d8850958613cfae835dc77 (patch) | |
tree | a33bbbb6dac6c4277389478b154f2b4306eacb34 /src/lua/lua_task.c | |
parent | 0ebcb5c9fb90363a2afff95f3f1af827fcf9b287 (diff) | |
download | rspamd-084dc96bc564b814b7d8850958613cfae835dc77.tar.gz rspamd-084dc96bc564b814b7d8850958613cfae835dc77.zip |
[Feature] Add support for Lua API tracing
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r-- | src/lua/lua_task.c | 110 |
1 files changed, 108 insertions, 2 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 83adc99a2..e4defa667 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -1117,6 +1117,7 @@ static void lua_task_set_cached (lua_State *L, struct rspamd_task *task, const gchar *key, gint pos, guint id) { + LUA_TRACE_POINT; struct rspamd_lua_cached_entry *entry; lua_pushvalue (L, pos); @@ -1141,6 +1142,7 @@ static gboolean lua_task_get_cached (lua_State *L, struct rspamd_task *task, const gchar *key, guint id) { + LUA_TRACE_POINT; struct rspamd_lua_cached_entry *entry; entry = g_hash_table_lookup (task->lua_cache, key); @@ -1158,6 +1160,7 @@ lua_task_get_cached (lua_State *L, struct rspamd_task *task, const gchar *key, static int lua_task_process_message (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -1184,6 +1187,7 @@ lua_task_process_message (lua_State *L) static int lua_task_get_cfg (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_config **pcfg; @@ -1202,6 +1206,7 @@ lua_task_get_cfg (lua_State *L) static int lua_task_set_cfg (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); void *ud = rspamd_lua_check_udata (L, 2, "rspamd{config}"); @@ -1219,6 +1224,7 @@ lua_task_set_cfg (lua_State *L) static int lua_task_destroy (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -1231,6 +1237,7 @@ lua_task_destroy (lua_State *L) static int lua_task_get_message (lua_State * L) { + LUA_TRACE_POINT; return luaL_error (L, "task:get_message is no longer supported"); } @@ -1257,6 +1264,7 @@ lua_task_free_dtor (gpointer p) static gint lua_task_load_from_file (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = NULL, **ptask; const gchar *fname = luaL_checkstring (L, 1), *err = NULL; struct rspamd_config *cfg = NULL; @@ -1315,6 +1323,7 @@ lua_task_load_from_file (lua_State * L) static gint lua_task_load_from_string (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = NULL, **ptask; const gchar *str_message; gsize message_len; @@ -1354,6 +1363,7 @@ lua_task_load_from_string (lua_State * L) static int lua_task_get_mempool (lua_State * L) { + LUA_TRACE_POINT; rspamd_mempool_t **ppool; struct rspamd_task *task = lua_check_task (L, 1); @@ -1372,6 +1382,7 @@ lua_task_get_mempool (lua_State * L) static int lua_task_get_session (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_async_session **psession; struct rspamd_task *task = lua_check_task (L, 1); @@ -1389,6 +1400,7 @@ lua_task_get_session (lua_State * L) static int lua_task_get_ev_base (lua_State * L) { + LUA_TRACE_POINT; struct event_base **pbase; struct rspamd_task *task = lua_check_task (L, 1); @@ -1406,6 +1418,7 @@ lua_task_get_ev_base (lua_State * L) static int lua_task_get_worker (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_worker **pworker; struct rspamd_task *task = lua_check_task (L, 1); @@ -1429,6 +1442,7 @@ lua_task_get_worker (lua_State * L) static gint lua_task_insert_result (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *symbol_name, *param; double weight; @@ -1487,6 +1501,7 @@ lua_task_insert_result (lua_State * L) static gint lua_task_adjust_result (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *symbol_name, *param; struct rspamd_metric_result *metric_res; @@ -1550,6 +1565,7 @@ lua_task_adjust_result (lua_State * L) static gint lua_task_set_pre_result (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gchar *action_str; gint action = METRIC_ACTION_MAX; @@ -1607,6 +1623,7 @@ lua_task_set_pre_result (lua_State * L) static gint lua_task_has_pre_result (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -1622,6 +1639,7 @@ lua_task_has_pre_result (lua_State * L) static gint lua_task_append_message (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *message = luaL_checkstring (L, 2), *category; @@ -1664,6 +1682,7 @@ lua_tree_url_callback (gpointer key, gpointer value, gpointer ud) static gint lua_task_get_urls (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct lua_tree_cb_data cb; gboolean need_emails = FALSE; @@ -1711,6 +1730,7 @@ lua_task_get_urls (lua_State * L) static gint lua_task_has_urls (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gboolean need_emails = FALSE, ret = FALSE; @@ -1739,6 +1759,7 @@ lua_task_has_urls (lua_State * L) static gint lua_task_get_content (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_lua_text *t; @@ -1759,6 +1780,7 @@ lua_task_get_content (lua_State * L) static gint lua_task_get_filename (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -1779,6 +1801,7 @@ lua_task_get_filename (lua_State * L) static gint lua_task_get_rawbody (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_lua_text *t; @@ -1808,6 +1831,7 @@ lua_task_get_rawbody (lua_State * L) static gint lua_task_get_emails (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct lua_tree_cb_data cb; @@ -1827,6 +1851,7 @@ lua_task_get_emails (lua_State * L) static gint lua_task_get_text_parts (lua_State * L) { + LUA_TRACE_POINT; guint i; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_mime_text_part *part, **ppart; @@ -1858,6 +1883,7 @@ lua_task_get_text_parts (lua_State * L) static gint lua_task_get_parts (lua_State * L) { + LUA_TRACE_POINT; guint i; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_mime_part *part, **ppart; @@ -1888,6 +1914,7 @@ lua_task_get_parts (lua_State * L) static gint lua_task_get_request_header (lua_State *L) { + LUA_TRACE_POINT; rspamd_ftok_t *hdr; struct rspamd_task *task = lua_check_task (L, 1); const gchar *s; @@ -1921,6 +1948,7 @@ lua_task_get_request_header (lua_State *L) static gint lua_task_set_request_header (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *s, *v = NULL; rspamd_fstring_t *buf; @@ -1967,7 +1995,7 @@ gint rspamd_lua_push_header (lua_State *L, struct rspamd_mime_header *rh, enum rspamd_lua_task_header_type how) { - + LUA_TRACE_POINT; switch (how) { case RSPAMD_TASK_HEADER_PUSH_FULL: /* Create new associated table for a header */ @@ -2023,7 +2051,7 @@ rspamd_lua_push_header_array (lua_State * L, GPtrArray *ar, enum rspamd_lua_task_header_type how) { - + LUA_TRACE_POINT; struct rspamd_mime_header *rh; guint i; @@ -2060,6 +2088,7 @@ rspamd_lua_push_header_array (lua_State * L, static gint lua_task_get_header_common (lua_State *L, enum rspamd_lua_task_header_type how) { + LUA_TRACE_POINT; gboolean strong = FALSE; struct rspamd_task *task = lua_check_task (L, 1); const gchar *name; @@ -2108,6 +2137,7 @@ lua_task_get_header_count (lua_State * L) static gint lua_task_get_raw_headers (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_lua_text *t; @@ -2129,6 +2159,7 @@ lua_task_get_raw_headers (lua_State *L) static gint lua_task_get_received_headers (lua_State * L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct received_header *rh; const gchar *proto; @@ -2250,6 +2281,7 @@ lua_task_get_received_headers (lua_State * L) static gint lua_task_get_queue_id (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -2270,6 +2302,7 @@ lua_task_get_queue_id (lua_State *L) static gint lua_task_get_uid (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -2285,6 +2318,7 @@ lua_task_get_uid (lua_State *L) static gint lua_task_get_resolver (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_dns_resolver **presolver; @@ -2303,6 +2337,7 @@ lua_task_get_resolver (lua_State *L) static gint lua_task_inc_dns_req (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -2318,6 +2353,7 @@ lua_task_inc_dns_req (lua_State *L) static gint lua_task_get_dns_req (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -2602,6 +2638,7 @@ lua_import_email_address (lua_State *L, struct rspamd_task *task, static gint lua_task_get_recipients (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); GPtrArray *ptrs = NULL; gint what = 0; @@ -2648,6 +2685,7 @@ lua_task_get_recipients (lua_State *L) static gint lua_task_set_recipients (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); GPtrArray *ptrs = NULL; struct rspamd_email_address *addr = NULL; @@ -2734,6 +2772,7 @@ lua_task_set_recipients (lua_State *L) static gint lua_task_has_from (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gint what = 0; gboolean ret = FALSE; @@ -2775,6 +2814,7 @@ lua_task_has_from (lua_State *L) static gint lua_task_has_recipients (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gint what = 0; gboolean ret = FALSE; @@ -2816,6 +2856,7 @@ lua_task_has_recipients (lua_State *L) static gint lua_task_get_from (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); GPtrArray *addrs = NULL; struct rspamd_email_address *addr = NULL; @@ -2875,6 +2916,7 @@ lua_task_get_from (lua_State *L) static gint lua_task_set_from (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); GPtrArray *addrs = NULL; struct rspamd_email_address **paddr = NULL, *addr; @@ -2954,6 +2996,7 @@ lua_task_set_from (lua_State *L) static gint lua_task_get_principal_recipient (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *r; @@ -2976,6 +3019,7 @@ lua_task_get_principal_recipient (lua_State *L) static gint lua_task_get_user (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -2996,6 +3040,7 @@ lua_task_get_user (lua_State *L) static gint lua_task_set_user (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *new_user; @@ -3037,6 +3082,7 @@ lua_task_set_user (lua_State *L) static gint lua_task_get_from_ip (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -3052,6 +3098,7 @@ lua_task_get_from_ip (lua_State *L) static gint lua_task_set_from_ip (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *ip_str = luaL_checkstring (L, 2); rspamd_inet_addr_t *addr = NULL; @@ -3082,6 +3129,7 @@ lua_task_set_from_ip (lua_State *L) static gint lua_task_get_from_ip_num (lua_State *L) { + LUA_TRACE_POINT; msg_err ("this function is deprecated and should no longer be used"); lua_pushnil (L); return 1; @@ -3090,6 +3138,7 @@ lua_task_get_from_ip_num (lua_State *L) static gint lua_task_get_client_ip (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -3105,6 +3154,7 @@ lua_task_get_client_ip (lua_State *L) static gint lua_task_get_helo (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -3126,6 +3176,7 @@ lua_task_get_helo (lua_State *L) static gint lua_task_get_subject (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -3147,6 +3198,7 @@ lua_task_get_subject (lua_State *L) static gint lua_task_set_helo (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *new_helo; @@ -3166,6 +3218,7 @@ lua_task_set_helo (lua_State *L) static gint lua_task_get_hostname (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -3200,6 +3253,7 @@ lua_task_get_hostname (lua_State *L) static gint lua_task_set_hostname (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *new_hostname; @@ -3220,6 +3274,7 @@ lua_task_set_hostname (lua_State *L) static gint lua_task_get_images (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); guint nelt = 0, i; struct rspamd_mime_part *part; @@ -3253,6 +3308,7 @@ lua_task_get_images (lua_State *L) static gint lua_task_get_archives (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); guint nelt = 0, i; struct rspamd_mime_part *part; @@ -3370,6 +3426,7 @@ lua_push_symbol_result (lua_State *L, static gint lua_task_get_symbol (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *symbol; gboolean found = FALSE; @@ -3403,6 +3460,7 @@ lua_task_get_symbol (lua_State *L) static gint lua_task_has_symbol (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *symbol; gboolean found = FALSE; @@ -3423,6 +3481,7 @@ lua_task_has_symbol (lua_State *L) static gint lua_task_get_symbols (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_metric_result *mres; gint i = 1; @@ -3460,6 +3519,7 @@ lua_task_get_symbols (lua_State *L) static gint lua_task_get_symbols_all (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_metric_result *mres; struct rspamd_symbol_result *s; @@ -3494,6 +3554,7 @@ lua_task_get_symbols_all (lua_State *L) static gint lua_task_get_symbols_numeric (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_metric_result *mres; gint i = 1, id; @@ -3567,6 +3628,7 @@ tokens_foreach_cb (gint id, const gchar *sym, gint flags, gpointer ud) static gint lua_task_get_symbols_tokens (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct tokens_foreach_cbdata cbd; @@ -3649,6 +3711,7 @@ lua_task_detect_date_type (struct rspamd_task *task, static gint lua_task_get_date (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); GPtrArray *hdrs; gdouble tim; @@ -3728,6 +3791,7 @@ lua_task_get_date (lua_State *L) static gint lua_task_get_message_id (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -3748,6 +3812,7 @@ lua_task_get_message_id (lua_State *L) static gint lua_task_get_timeval (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -3769,6 +3834,7 @@ lua_task_get_timeval (lua_State *L) static gint lua_task_get_size (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -3814,6 +3880,7 @@ lua_task_get_size (lua_State *L) static gint lua_task_set_flag (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *flag = luaL_checkstring (L, 2); gboolean set = TRUE, found = FALSE; @@ -3849,6 +3916,7 @@ lua_task_set_flag (lua_State *L) static gint lua_task_has_flag (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *flag = luaL_checkstring (L, 2); gboolean found = FALSE; @@ -3884,6 +3952,7 @@ lua_task_has_flag (lua_State *L) static gint lua_task_get_flags (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gint idx = 1; guint flags, bit, i; @@ -3958,6 +4027,7 @@ lua_task_get_flags (lua_State *L) static gint lua_task_get_digest (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gchar hexbuf[33]; gint r; @@ -3985,6 +4055,7 @@ lua_task_get_digest (lua_State *L) static gint lua_task_learn (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gboolean is_spam = FALSE; const gchar *clname = NULL; @@ -4017,6 +4088,7 @@ lua_task_learn (lua_State *L) static gint lua_task_set_settings (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); ucl_object_t *settings; const ucl_object_t *act, *elt, *metric_elt, *vars, *cur; @@ -4086,6 +4158,7 @@ lua_task_set_settings (lua_State *L) static gint lua_task_set_milter_reply (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); ucl_object_t *reply, *prev; @@ -4115,6 +4188,7 @@ lua_task_set_milter_reply (lua_State *L) static gint lua_task_get_settings (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task != NULL) { @@ -4136,6 +4210,7 @@ lua_task_get_settings (lua_State *L) static gint lua_task_lookup_settings (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *key = NULL; const ucl_object_t *elt; @@ -4175,6 +4250,7 @@ lua_task_lookup_settings (lua_State *L) static gint lua_task_get_settings_id (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); guint32 *hp; @@ -4198,6 +4274,7 @@ lua_task_get_settings_id (lua_State *L) static gint lua_task_cache_get (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *key = luaL_checkstring (L, 2); guint id = 0; @@ -4221,6 +4298,7 @@ lua_task_cache_get (lua_State *L) static gint lua_task_cache_set (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *key = luaL_checkstring (L, 2); guint id = 0; @@ -4260,6 +4338,7 @@ lua_tmp_file_dtor (gpointer p) static gint lua_task_store_in_file (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gboolean force_new = FALSE, keep = FALSE; gchar fpath[PATH_MAX]; @@ -4349,6 +4428,7 @@ lua_task_store_in_file (lua_State *L) static gint lua_task_process_regexp (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_lua_regexp *re = NULL; gboolean strong = FALSE; @@ -4409,6 +4489,7 @@ lua_task_process_regexp (lua_State *L) static gint lua_task_get_metric_score (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); gdouble rs; struct rspamd_metric_result *metric_res; @@ -4436,6 +4517,7 @@ lua_task_get_metric_score (lua_State *L) static gint lua_task_get_metric_action (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_metric_result *metric_res; enum rspamd_action_type action; @@ -4458,6 +4540,7 @@ lua_task_get_metric_action (lua_State *L) static gint lua_task_set_metric_score (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); struct rspamd_metric_result *metric_res; gdouble nscore; @@ -4490,6 +4573,7 @@ lua_task_set_metric_score (lua_State *L) static gint lua_task_disable_action (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *action_name; gint action; @@ -4518,6 +4602,7 @@ lua_task_disable_action (lua_State *L) static gint lua_task_get_newlines_type (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); if (task) { @@ -4619,6 +4704,7 @@ lua_push_stat_token (lua_State *L, rspamd_token_t *tok) static gint lua_task_get_stat_tokens (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); guint i; rspamd_token_t *tok; @@ -4650,6 +4736,7 @@ lua_task_get_stat_tokens (lua_State *L) static gint lua_task_set_metric_subject (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); const gchar *subject; @@ -4670,6 +4757,7 @@ lua_task_set_metric_subject (lua_State *L) static gint lua_task_get_protocol_reply (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); guint flags = 0; ucl_object_t *obj; @@ -4733,6 +4821,7 @@ lua_task_get_protocol_reply (lua_State *L) static gint lua_task_headers_foreach (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_task *task = lua_check_task (L, 1); enum rspamd_lua_task_header_type how = RSPAMD_TASK_HEADER_PUSH_SIMPLE; struct rspamd_lua_regexp *re = NULL; @@ -4820,6 +4909,7 @@ lua_task_headers_foreach (lua_State *L) static gint lua_image_get_width (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_image *img = lua_check_image (L); if (img != NULL) { @@ -4835,6 +4925,7 @@ lua_image_get_width (lua_State *L) static gint lua_image_get_height (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_image *img = lua_check_image (L); if (img != NULL) { @@ -4850,6 +4941,7 @@ lua_image_get_height (lua_State *L) static gint lua_image_get_type (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_image *img = lua_check_image (L); if (img != NULL) { @@ -4865,6 +4957,7 @@ lua_image_get_type (lua_State *L) static gint lua_image_get_size (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_image *img = lua_check_image (L); if (img != NULL) { @@ -4880,6 +4973,7 @@ lua_image_get_size (lua_State *L) static gint lua_image_get_filename (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_image *img = lua_check_image (L); if (img != NULL && img->filename != NULL) { @@ -4896,6 +4990,7 @@ lua_image_get_filename (lua_State *L) static gint lua_archive_get_type (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_archive *arch = lua_check_archive (L); if (arch != NULL) { @@ -4911,6 +5006,7 @@ lua_archive_get_type (lua_State *L) static gint lua_archive_get_files (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_archive *arch = lua_check_archive (L); guint i; struct rspamd_archive_file *f; @@ -4935,6 +5031,7 @@ lua_archive_get_files (lua_State *L) static gint lua_archive_get_files_full (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_archive *arch = lua_check_archive (L); guint i; struct rspamd_archive_file *f; @@ -4976,6 +5073,7 @@ lua_archive_get_files_full (lua_State *L) static gint lua_archive_is_encrypted (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_archive *arch = lua_check_archive (L); if (arch != NULL) { @@ -4991,6 +5089,7 @@ lua_archive_is_encrypted (lua_State *L) static gint lua_archive_get_size (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_archive *arch = lua_check_archive (L); if (arch != NULL) { @@ -5006,6 +5105,7 @@ lua_archive_get_size (lua_State *L) static gint lua_archive_get_filename (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_archive *arch = lua_check_archive (L); if (arch != NULL) { @@ -5022,6 +5122,7 @@ lua_archive_get_filename (lua_State *L) static gint lua_text_len (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_lua_text *t = lua_check_text (L, 1); gsize l = 0; @@ -5040,6 +5141,7 @@ lua_text_len (lua_State *L) static gint lua_text_str (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_lua_text *t = lua_check_text (L, 1); if (t != NULL) { @@ -5055,6 +5157,7 @@ lua_text_str (lua_State *L) static gint lua_text_ptr (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_lua_text *t = lua_check_text (L, 1); if (t != NULL) { @@ -5070,6 +5173,7 @@ lua_text_ptr (lua_State *L) static gint lua_text_take_ownership (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_lua_text *t = lua_check_text (L, 1); gchar *dest; @@ -5096,6 +5200,7 @@ lua_text_take_ownership (lua_State *L) static gint lua_text_save_in_file (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_lua_text *t = lua_check_text (L, 1); const gchar *fname = NULL; guint mode = 00644; @@ -5150,6 +5255,7 @@ lua_text_save_in_file (lua_State *L) static gint lua_text_gc (lua_State *L) { + LUA_TRACE_POINT; struct rspamd_lua_text *t = lua_check_text (L, 1); if (t != NULL) { |