DEBUG: task: define a series of wakeup types for tasks and tasklets

The WAKEUP_* values will be used to report how a task/tasklet was woken
up, and task_wakeup_type_str() wlil report the associated function name.
diff --git a/include/haproxy/task-t.h b/include/haproxy/task-t.h
index 373ac29..98661ed 100644
--- a/include/haproxy/task-t.h
+++ b/include/haproxy/task-t.h
@@ -61,6 +61,19 @@
 #define TASK_PERSISTENT   (TASK_SELF_WAKING | TASK_KILLED | \
                            TASK_HEAVY | TASK_F_TASKLET | TASK_F_USR1)
 
+/* these wakeup types are used to indicate how a task/tasklet was woken up, for
+ * debugging purposes.
+ */
+enum {
+	WAKEUP_TYPE_UNSET = 0,
+	WAKEUP_TYPE_TASK_WAKEUP,
+	WAKEUP_TYPE_TASK_INSTANT_WAKEUP,
+	WAKEUP_TYPE_TASKLET_WAKEUP,
+	WAKEUP_TYPE_TASKLET_WAKEUP_AFTER,
+	WAKEUP_TYPE_TASK_DROP_RUNNING,
+	WAKEUP_TYPE_APPCTX_WAKEUP,
+};
+
 struct notification {
 	struct list purge_me; /* Part of the list of signals to be purged in the
 	                         case of the LUA execution stack crash. */
diff --git a/include/haproxy/task.h b/include/haproxy/task.h
index a711c27..161d557 100644
--- a/include/haproxy/task.h
+++ b/include/haproxy/task.h
@@ -86,7 +86,6 @@
 /* tasklets are recognized with nice==-32768 */
 #define TASK_IS_TASKLET(t) ((t)->state & TASK_F_TASKLET)
 
-
 /* a few exported variables */
 extern struct pool_head *pool_head_task;
 extern struct pool_head *pool_head_tasklet;
@@ -677,6 +676,22 @@
 	}
 }
 
+/* returns the string corresponding to a task type as found in the task caller
+ * locations.
+ */
+static inline const char *task_wakeup_type_str(uint t)
+{
+	switch (t) {
+	case WAKEUP_TYPE_TASK_WAKEUP          : return "task_wakeup";
+	case WAKEUP_TYPE_TASK_INSTANT_WAKEUP  : return "task_instant_wakeup";
+	case WAKEUP_TYPE_TASKLET_WAKEUP       : return "tasklet_wakeup";
+	case WAKEUP_TYPE_TASKLET_WAKEUP_AFTER : return "tasklet_wakeup_after";
+	case WAKEUP_TYPE_TASK_DROP_RUNNING    : return "task_drop_running";
+	case WAKEUP_TYPE_APPCTX_WAKEUP        : return "appctx_wakeup";
+	default                               : return "?";
+	}
+}
+
 /* This function register a new signal. "lua" is the current lua
  * execution context. It contains a pointer to the associated task.
  * "link" is a list head attached to an other task that must be wake