From c779ab073d7959a94cfe6735a62be341158047b3 Mon Sep 17 00:00:00 2001 From: laksono Date: Tue, 10 Oct 2017 21:40:57 -0500 Subject: [PATCH] add description that blocktime event is only for 4.3 or newer In some kernels, although the version is older than 4.3, but their perf_event.h provide attribute context_switch which is in theory only available with kernel 4.3 or newer. If this is the case, the configure will think the current platform is the new one, and "activate" kernel blocking module (BLOCTIME event). There is no build error nor crash during execution time. Only undefined event. --- src/tool/hpcrun/sample-sources/perf/kernel_blocking.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tool/hpcrun/sample-sources/perf/kernel_blocking.c b/src/tool/hpcrun/sample-sources/perf/kernel_blocking.c index 8e580f1fe3..d9ec0de34e 100644 --- a/src/tool/hpcrun/sample-sources/perf/kernel_blocking.c +++ b/src/tool/hpcrun/sample-sources/perf/kernel_blocking.c @@ -286,7 +286,10 @@ void kernel_blocking_init() event_custom_t *event_kernel_blocking = hpcrun_malloc(sizeof(event_custom_t)); event_kernel_blocking->name = EVNAME_KERNEL_BLOCK; - event_kernel_blocking->desc = "Approximation of a thread's blocking time. This event requires another event (such as CYCLES) to profile with. The unit time is hardware-dependent but mostly in microseconds."; + event_kernel_blocking->desc = "Approximation of a thread's blocking time." + " This event requires another event (such as CYCLES) to profile with." + " The unit time is hardware-dependent but mostly in microseconds." + " This event is only available on Linux kernel 4.3 or newer."; event_kernel_blocking->register_fn = register_blocking; // call backs event_kernel_blocking->handler_fn = NULL; // No call backs: we want all event to call us event_kernel_blocking->metric_index = 0; // these fields to be defined later