Merge branch 'sched/core' into core/locking, to prepare the kernel/locking/ file...
[firefly-linux-kernel-4.4.55.git] / include / trace / events / sched.h
index 2e7d9947a10d3f62bfe12e450375625efae913df..04c308413a5dd3b2295b33c8c78bf56a11fa6b20 100644 (file)
@@ -100,7 +100,7 @@ static inline long __trace_sched_switch_state(struct task_struct *p)
        /*
         * For all intents and purposes a preempted task is a running task.
         */
-       if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
+       if (task_preempt_count(p) & PREEMPT_ACTIVE)
                state = TASK_RUNNING | TASK_STATE_MAX;
 #endif
 
@@ -424,6 +424,25 @@ TRACE_EVENT(sched_pi_setprio,
                        __entry->oldprio, __entry->newprio)
 );
 
+#ifdef CONFIG_DETECT_HUNG_TASK
+TRACE_EVENT(sched_process_hang,
+       TP_PROTO(struct task_struct *tsk),
+       TP_ARGS(tsk),
+
+       TP_STRUCT__entry(
+               __array( char,  comm,   TASK_COMM_LEN   )
+               __field( pid_t, pid                     )
+       ),
+
+       TP_fast_assign(
+               memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
+               __entry->pid = tsk->pid;
+       ),
+
+       TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid)
+);
+#endif /* CONFIG_DETECT_HUNG_TASK */
+
 #endif /* _TRACE_SCHED_H */
 
 /* This part must be outside protection */