/* * Architectures are expected to know if AUX area sampling is supported by the * hardware. Here we check for kernel support.
*/ bool perf_can_aux_sample(void)
{ struct perf_event_attr attr = {
.size = sizeof(struct perf_event_attr),
.exclude_kernel = 1, /* * Non-zero value causes the kernel to calculate the effective * attribute size up to that byte.
*/
.aux_sample_size = 1,
}; int fd;
fd = sys_perf_event_open(&attr, -1, 0, -1, 0); /* * If the kernel attribute is big enough to contain aux_sample_size * then we assume that it is supported. We are relying on the kernel to * validate the attribute size before anything else that could be wrong.
*/ if (fd < 0 && errno == E2BIG) returnfalse; if (fd >= 0)
close(fd);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.