MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / asprof_error_t asprof_execute

Function asprof_error_t asprof_execute

src/asprof.cpp:26–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26DLLEXPORT asprof_error_t asprof_execute(const char* command, asprof_writer_t output_callback) {
27 Arguments args;
28 Error error = args.parse(command);
29 if (error) {
30 return asprof_error(error.message());
31 }
32
33 Log::open(args);
34
35 if (!args.hasOutputFile()) {
36 CallbackWriter out(output_callback);
37 error = Profiler::instance()->runInternal(args, out);
38 if (!error) {
39 return NULL;
40 }
41 } else {
42 FileWriter out(args.file());
43 if (!out.is_open()) {
44 return asprof_error("Could not open output file");
45 }
46 error = Profiler::instance()->runInternal(args, out);
47 if (!error) {
48 return NULL;
49 }
50 }
51
52 return asprof_error(error.message());
53}
54
55DLLEXPORT asprof_thread_local_data* asprof_get_thread_local_data(void) {
56 return ThreadLocalData::getThreadLocalData();

Callers

nothing calls this directly

Calls 7

asprof_errorFunction · 0.85
messageMethod · 0.80
hasOutputFileMethod · 0.80
runInternalMethod · 0.80
is_openMethod · 0.80
parseMethod · 0.45
fileMethod · 0.45

Tested by

no test coverage detected