summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/evsel-tp-sched.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2015-11-23 22:46:28 +1100
committerJames Morris <james.l.morris@oracle.com>2015-11-23 22:46:28 +1100
commitebd68df3f24b318d391d15c458d6f43f340ba36a (patch)
treef0277bc4b853abe5db1d30fa4e10b05bba7f2ac5 /tools/perf/tests/evsel-tp-sched.c
parente42852bf88144affc227884b62637118ba74b783 (diff)
parent1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff)
downloadblackbird-op-linux-ebd68df3f24b318d391d15c458d6f43f340ba36a.tar.gz
blackbird-op-linux-ebd68df3f24b318d391d15c458d6f43f340ba36a.zip
Sync to Linus v4.4-rc2 for LSM developers.
Diffstat (limited to 'tools/perf/tests/evsel-tp-sched.c')
-rw-r--r--tools/perf/tests/evsel-tp-sched.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
index 52162425c969..790e413d9a1f 100644
--- a/tools/perf/tests/evsel-tp-sched.c
+++ b/tools/perf/tests/evsel-tp-sched.c
@@ -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;
OpenPOWER on IntegriCloud