3 ms·
Kindof off-topic, but has anyone had any success in using perf_event_open from within WSL, or is that unsupported? I tried `sysctl kernel.perf_event_paranoid=0`
by dundarious 3y ago
Kindof off-topic, but has anyone had any success in using perf_event_open from within WSL, or is that unsupported? I tried `sysctl kernel.perf_event_paranoid=0` and the following, which works under "real" linux, but fails under WSL:
struct perf_event_attr attr = {
.type = PERF_TYPE_HARDWARE,
.size = sizeof(struct perf_event_attr),
.config = PERF_COUNT_HW_INSTRUCTIONS,
.disabled = 1, /* only need to read once, not updating values, but fails with 0 also */
.exclude_kernel = 1,
.exclude_hv = 1
};
int fd = perf_event_open(&attr, 0, -1, -1, 0); /* fails, returns -1 */
Microsoft's kernel appears to have the right CONFIG_* as well, so I feel like it must be supported in some capacity, even if limited.