From: Mathieu Desnoyers Date: Fri, 24 Jun 2011 03:28:52 +0000 (-0400) Subject: Add check for perf counter X-Git-Tag: v2.0-pre1~33 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=inline;h=54de85a41d9c61aaf1a3fd2ad6dc01d01ccb4360;p=lttng-modules.git Add check for perf counter Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-context-perf-counters.c b/lttng-context-perf-counters.c index 56e0d250..c6f73037 100644 --- a/lttng-context-perf-counters.c +++ b/lttng-context-perf-counters.c @@ -36,7 +36,7 @@ void perf_counter_record(struct lttng_ctx_field *field, uint64_t value; event = field->u.perf_counter.e[ctx->cpu]; - if (likely(event)) { + if (likely(event) && likely(event->pmu)) { event->pmu->read(event); value = local64_read(&event->count); } else {