patch 8.1.1689: profiling code is spread out
Problem: Profiling code is spread out.
Solution: Move more profiling code to profiler.c. (Yegappan Lakshmanan,
closes #4668)
diff --git a/src/proto/ex_cmds2.pro b/src/proto/ex_cmds2.pro
index ee74b0b..b66be2f 100644
--- a/src/proto/ex_cmds2.pro
+++ b/src/proto/ex_cmds2.pro
@@ -9,10 +9,6 @@
void add_timer_info_all(typval_T *rettv);
int set_ref_in_timer(int copyID);
void timer_free_all(void);
-void script_do_profile(scriptitem_T *si);
-void script_prof_save(proftime_T *tm);
-void script_prof_restore(proftime_T *tm);
-void script_dump_profile(FILE *fd);
int autowrite(buf_T *buf, int forceit);
void autowrite_all(void);
int check_changed(buf_T *buf, int flags);
@@ -63,9 +59,6 @@
void free_scriptnames(void);
linenr_T get_sourced_lnum(char_u *(*fgetline)(int, void *, int, int), void *cookie);
char_u *getsourceline(int c, void *cookie, int indent, int do_concat);
-void script_line_start(void);
-void script_line_exec(void);
-void script_line_end(void);
void ex_scriptencoding(exarg_T *eap);
void ex_scriptversion(exarg_T *eap);
void ex_finish(exarg_T *eap);
diff --git a/src/proto/profiler.pro b/src/proto/profiler.pro
index e7bcb47..64398f5 100644
--- a/src/proto/profiler.pro
+++ b/src/proto/profiler.pro
@@ -17,18 +17,20 @@
void ex_profile(exarg_T *eap);
char_u *get_profile_name(expand_T *xp, int idx);
void set_context_in_profile_cmd(expand_T *xp, char_u *arg);
-void profile_dump(void);
void prof_inchar_enter(void);
void prof_inchar_exit(void);
int prof_def_func(void);
-void prof_sort_list(FILE *fd, ufunc_T **sorttab, int st_len, char *title, int prefer_self);
-void prof_func_line(FILE *fd, int count, proftime_T *total, proftime_T *self, int prefer_self);
-int prof_total_cmp(const void *s1, const void *s2);
-int prof_self_cmp(const void *s1, const void *s2);
void func_do_profile(ufunc_T *fp);
void prof_child_enter(proftime_T *tm);
void prof_child_exit(proftime_T *tm);
void func_line_start(void *cookie);
void func_line_exec(void *cookie);
void func_line_end(void *cookie);
+void script_do_profile(scriptitem_T *si);
+void script_prof_save(proftime_T *tm);
+void script_prof_restore(proftime_T *tm);
+void profile_dump(void);
+void script_line_start(void);
+void script_line_exec(void);
+void script_line_end(void);
/* vim: set ft=c : */
diff --git a/src/proto/userfunc.pro b/src/proto/userfunc.pro
index 8395e01..2b59473 100644
--- a/src/proto/userfunc.pro
+++ b/src/proto/userfunc.pro
@@ -1,12 +1,13 @@
/* userfunc.c */
void func_init(void);
+hashtab_T *func_tbl_get(void);
int get_lambda_tv(char_u **arg, typval_T *rettv, int evaluate);
char_u *deref_func_name(char_u *name, int *lenp, partial_T **partialp, int no_autoload);
int get_func_tv(char_u *name, int len, typval_T *rettv, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, partial_T *partial, dict_T *selfdict);
ufunc_T *find_func(char_u *name);
void save_funccal(funccal_entry_T *entry);
void restore_funccal(void);
-funccall_T * get_current_funccal(void);
+funccall_T *get_current_funccal(void);
void free_all_functions(void);
int func_call(char_u *name, typval_T *args, partial_T *partial, dict_T *selfdict, typval_T *rettv);
int call_callback(callback_T *callback, int len, typval_T *rettv, int argcount, typval_T *argvars, int (*argv_func)(int, typval_T *, int), linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate, dict_T *selfdict);
@@ -17,7 +18,6 @@
int translated_function_exists(char_u *name);
int function_exists(char_u *name, int no_deref);
char_u *get_expanded_name(char_u *name, int check);
-void func_dump_profile(FILE *fd);
char_u *get_user_func_name(expand_T *xp, int idx);
void ex_delfunction(exarg_T *eap);
void func_unref(char_u *name);
@@ -30,9 +30,6 @@
void discard_pending_return(void *rettv);
char_u *get_return_cmd(void *rettv);
char_u *get_func_line(int c, void *cookie, int indent, int do_concat);
-void func_line_start(void *cookie);
-void func_line_exec(void *cookie);
-void func_line_end(void *cookie);
int func_has_ended(void *cookie);
int func_has_abort(void *cookie);
dict_T *make_partial(dict_T *selfdict_in, typval_T *rettv);