These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / tools / perf / tests / evsel-tp-sched.c
index 5216242..790e413 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/err.h>
 #include <traceevent/event-parse.h>
 #include "evsel.h"
 #include "tests.h"
@@ -36,8 +37,8 @@ int test__perf_evsel__tp_sched_test(void)
        struct perf_evsel *evsel = perf_evsel__newtp("sched", "sched_switch");
        int ret = 0;
 
-       if (evsel == NULL) {
-               pr_debug("perf_evsel__new\n");
+       if (IS_ERR(evsel)) {
+               pr_debug("perf_evsel__newtp failed with %ld\n", PTR_ERR(evsel));
                return -1;
        }
 
@@ -66,6 +67,11 @@ int test__perf_evsel__tp_sched_test(void)
 
        evsel = perf_evsel__newtp("sched", "sched_wakeup");
 
+       if (IS_ERR(evsel)) {
+               pr_debug("perf_evsel__newtp failed with %ld\n", PTR_ERR(evsel));
+               return -1;
+       }
+
        if (perf_evsel__test_field(evsel, "comm", 16, true))
                ret = -1;