📄 profiler.c
字号:
#line 184 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/profiler.mx"#include "mal_config.h"#include "profiler.h"#ifdef WIN32#ifndef LIBPROFILER#define profiler_export extern __declspec(dllimport)#else#define profiler_export extern __declspec(dllexport)#endif#else#define profiler_export extern#endifprofiler_export str CMDactivateProfiler(int *res, str *name);profiler_export str CMDdeactivateProfiler(int *res, str *name);profiler_export str CMDsetFilterProfiler(int *res, str *mod, str *fcn);profiler_export str CMDsetAllProfiler(int *res);profiler_export str CMDclrFilterProfiler(int *res, str *mod, str *fcn);profiler_export str CMDsetNoneProfiler(int *res);profiler_export str CMDsetProfilerStream(int *res, str *fnme);profiler_export str CMDstartPointProfiler(int *res, str *mod, str *fcn);profiler_export str CMDendPointProfiler(int *res, str *mod, str *fcn);profiler_export str CMDstopProfiler(int *res);profiler_export str CMDstartProfiler(int *res);profiler_export str CMDstartTrace(int *res);profiler_export str CMDstopTrace(int *res);profiler_export str CMDclearTrace(int *res);profiler_export str CMDdumpTrace(int *res);profiler_export str CMDgetTrace(int *res, str *ev);profiler_export str CMDsetCachedProfiling(int *ret);profiler_export str CMDsetOnlineProfiling(int *ret);profiler_export str CMDsetOfflineProfiling(int *ret);profiler_export str CMDopenProfilerStream(int *res);profiler_export str CMDcloseProfilerStream(int *res);profiler_export str CMDcleanup(int *ret);#define checkProfiler(X) \ if( ! profilerAvailable()) \ throw(MAL, "profiler." X,\ ":Monet not compiled for performance monitoring");strCMDactivateProfiler(int *res, str *name){ (void) res; /* fool compiler */ checkProfiler("activate"); activateCounter(*name); return MAL_SUCCEED;}strCMDdeactivateProfiler(int *res, str *name){ (void) res; /* fool compiler */ checkProfiler("deactivate"); deactivateCounter(*name); return MAL_SUCCEED;}strCMDsetFilterProfiler(int *res, str *mod, str *fcn){ (void) res; /* fool compiler */ checkProfiler("setFilter"); setFilter(MCgetClient()->nspace, *mod, *fcn); return MAL_SUCCEED;}strCMDsetAllProfiler(int *res){ str x = GDKstrdup("*"); str y = GDKstrdup("*"); (void) res; /* fool compiler */ return CMDsetFilterProfiler(res, &x, &y);}strCMDopenProfilerStream(int *res){ (void) res; return openProfilerStream();}strCMDcloseProfilerStream(int *res){ (void) res; return closeProfilerStream();}strCMDclrFilterProfiler(int *res, str *mod, str *fcn){ (void) res; /* fool compiler */ checkProfiler("clrFilter"); resetFilter(MCgetClient()->nspace, *mod, *fcn); return MAL_SUCCEED;}strCMDsetNoneProfiler(int *res){ str x = GDKstrdup(""); str y = GDKstrdup(""); (void) res; /* fool compiler */ return CMDclrFilterProfiler(res, &x, &y);}strCMDsetProfilerStream(int *res, str *fnme){ (void) res; /* fool compiler */ checkProfiler("setProfiler"); setLogFile(MCgetClient()->nspace, *fnme); return MAL_SUCCEED;}strCMDstartPointProfiler(int *res, str *mod, str *fcn){ (void) res; /* fool compiler */ checkProfiler("startPoint"); setStartPoint(MCgetClient()->nspace, *mod, *fcn); return MAL_SUCCEED;}strCMDendPointProfiler(int *res, str *mod, str *fcn){ (void) res; /* fool compiler */ checkProfiler("endPoint"); setStartPoint(MCgetClient()->nspace, *mod, *fcn); return MAL_SUCCEED;}strCMDstopProfiler(int *res){ Client c = MCgetClient(); (void) res; /* fool compiler */ checkProfiler("stop"); stream_printf(c->fdout, "# Performance profiling stopped\n"); stopProfiling(); return MAL_SUCCEED;}strCMDstartProfiler(int *res){ Client c = MCgetClient(); (void) res; /* fool compiler */ checkProfiler("start"); stream_printf(c->fdout, "# Start performance profiling\n"); startProfiling(); return MAL_SUCCEED;}#line 349 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/profiler.mx"strCMDstartTrace(int *res){ (void) res; /* fool compiler */ checkProfiler("start"); startTrace(); return MAL_SUCCEED;}strCMDstopTrace(int *res){ (void) res; /* fool compiler */ checkProfiler("stop"); stopTrace(); return MAL_SUCCEED;}strCMDclearTrace(int *res){ (void) res; /* fool compiler */ checkProfiler("stop"); clearTrace(); return MAL_SUCCEED;}strCMDdumpTrace(int *res){ (void) res; /* fool compiler */ checkProfiler("dump"); stopTrace(); return MAL_SUCCEED;}strCMDgetTrace(int *res, str *ev){ BAT *bn; (void) res; /* fool compiler */ checkProfiler("dump"); bn = getTrace(*ev); if (bn) { BBPincref(*res = bn->batCacheid, TRUE); return MAL_SUCCEED; } throw(MAL, "getTrace", "Failed to find event profile");}strCMDsetCachedProfiling(int *ret){ (void) ret; setCachedProfiling(); return MAL_SUCCEED;}strCMDsetOnlineProfiling(int *ret){ (void) ret; setOnlineProfiling(); return MAL_SUCCEED;}strCMDsetOfflineProfiling(int *ret){ (void) ret; setOnlineProfiling(); return MAL_SUCCEED;}strCMDcleanup(int *ret){ (void) ret; cleanupProfiler(); return MAL_SUCCEED;}#line 431 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/profiler.mx"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -