moved actor probes to function

This commit is contained in:
mpilman 2019-05-28 15:51:00 -07:00 committed by Alex Miller
parent b7df7f3549
commit 884628bc0a
3 changed files with 37 additions and 4 deletions

View File

@ -2880,6 +2880,22 @@ void* checkThread(void *arg) {
#endif
}
#if defined(DTRACE_PROBES)
void fdb_probe_actor_create(const char* name) {
FDB_TRACE_PROBE(actor_create, name);
}
void fdb_probe_actor_destroy(const char* name) {
FDB_TRACE_PROBE(actor_destroy, name);
}
void fdb_probe_actor_enter(const char* name, int index) {
FDB_TRACE_PROBE(actor_enter, name, index);
}
void fdb_probe_actor_exit(const char* name, int index) {
FDB_TRACE_PROBE(actor_exit, name, index);
}
#endif
void setupSlowTaskProfiler() {
#ifdef __linux__
if(FLOW_KNOBS->SLOWTASK_PROFILING_INTERVAL > 0) {

View File

@ -641,9 +641,18 @@ EXTERNC void setProfilingEnabled(int enabled);
DTRACE_PROBE4, DTRACE_PROBE3, DTRACE_PROBE2, \
DTRACE_PROBE1, DTRACE_PROBE) \
(foundationdb, __VA_ARGS__)
extern void fdb_probe_actor_create(const char* name);
extern void fdb_probe_actor_destroy(const char* name);
extern void fdb_probe_actor_enter(const char* name, int index);
extern void fdb_probe_actor_exit(const char* name, int index);
#else
#define FDB_TRACE_PROBE_STRING_CONCAT(h, t) h ## t
#define FDB_TRACE_PROBE(...)
inline void fdb_probe_actor_create(const char*) {}
inline void fdb_probe_actor_destroy(const char*) {}
inline void fdb_probe_actor_enter(const char*, int) {}
inline void fdb_probe_actor_exit(const char*, int) {}
#endif
#endif /* FLOW_PLATFORM_H */

View File

@ -425,19 +425,27 @@ namespace actorcompiler
}
void ProbeEnter(Function fun, string name, int index = -1) {
fun.WriteLine("FDB_TRACE_PROBE(actor_enter, \"{0}\", {1});", name, index);
if (generateProbes) {
fun.WriteLine("fdb_probe_actor_enter(\"{0}\", {1});", name, index);
}
}
void ProbeExit(Function fun, string name, int index = -1) {
fun.WriteLine("FDB_TRACE_PROBE(actor_exit, \"{0}\", {1});", name, index);
if (generateProbes) {
fun.WriteLine("fdb_probe_actor_exit(\"{0}\", {1});", name, index);
}
}
void ProbeCreate(Function fun, string name) {
fun.WriteLine("FDB_TRACE_PROBE(actor_create, \"{0}\");", name);
if (generateProbes) {
fun.WriteLine("fdb_probe_actor_create(\"{0}\");", name);
}
}
void ProbeDestroy(Function fun, string name) {
fun.WriteLine("FDB_TRACE_PROBE(actor_destroy, \"{0}\");", name);
if (generateProbes) {
fun.WriteLine("fdb_probe_actor_destroy(\"{0}\");", name);
}
}
void LineNumber(TextWriter writer, int SourceLine)