+#include <lttng-events.h>
+#include <wrapper/ringbuffer/frontend_types.h>
+#include <wrapper/vmalloc.h>
+#include <wrapper/kallsyms.h>
+#include <lttng-tracer.h>
+
+static
+int (*wrapper_task_prio_sym)(struct task_struct *t);
+
+int wrapper_task_prio_init(void)
+{
+ wrapper_task_prio_sym = (void *) kallsyms_lookup_funcptr("task_prio");
+ if (!wrapper_task_prio_sym) {
+ printk(KERN_WARNING "LTTng: task_prio symbol lookup failed.\n");
+ return -EINVAL;
+ }
+ return 0;
+}
+
+/*
+ * Canary function to check for 'task_prio()' at compile time.
+ *
+ * From 'include/linux/sched.h':
+ *
+ * extern int task_prio(const struct task_struct *p);
+ */
+__attribute__((unused)) static
+int __canary__task_prio(const struct task_struct *p)
+{
+ return task_prio(p);
+}