Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00036 #ifndef BENCHMARK_API_H
00037 #define BENCHMARK_API_H
00038
00039 #include "../../sr_module.h"
00040
00041 typedef int (*bm_register_timer_f)(char *tname, int mode, unsigned int *id);
00042 typedef int (*bm_start_timer_f)(unsigned int id);
00043 typedef int (*bm_log_timer_f)(unsigned int id);
00044
00045 struct bm_binds {
00046 bm_register_timer_f bm_register;
00047 bm_start_timer_f bm_start;
00048 bm_log_timer_f bm_log;
00049 };
00050
00051 typedef int(*load_bm_f)(struct bm_binds *bmb);
00052
00053 int load_bm(struct bm_binds *bmb);
00054
00055 static inline int load_bm_api( struct bm_binds *bmb )
00056 {
00057 load_bm_f load_bm;
00058
00059
00060 if ( !(load_bm=(load_bm_f)find_export("load_bm", 0, 0)))
00061 {
00062 LM_ERR("can't import load_bm\n");
00063 return -1;
00064 }
00065
00066 if (load_bm( bmb )==-1)
00067 {
00068 LM_ERR("load_bm failed\n");
00069 return -1;
00070 }
00071
00072 return 0;
00073 }
00074
00075 #endif