| 77 | } |
| 78 | |
| 79 | static JSValueRef js_perf_counters_init( |
| 80 | JSContextRef context, |
| 81 | JSObjectRef object, |
| 82 | JSObjectRef thisObject, |
| 83 | size_t argumentCount, |
| 84 | const JSValueRef arguments[], |
| 85 | JSValueRef *exception |
| 86 | ) { |
| 87 | // TODO: Allow customizing recorded events |
| 88 | bool enable = true; |
| 89 | std::string events = ""; |
| 90 | bool recordSubprocesses = false; |
| 91 | HardwareCounter::Init(enable, events, recordSubprocesses); |
| 92 | HardwareCounter::s_counter.getCheck(); |
| 93 | |
| 94 | return JSValueMakeUndefined(context); |
| 95 | } |
| 96 | |
| 97 | static JSValueRef js_perf_counters_get_counters( |
| 98 | JSContextRef context, |