Chinaunix首页 | 论坛 | 博客
  • 博客访问: 307077
  • 博文数量: 65
  • 博客积分: 185
  • 博客等级: 入伍新兵
  • 技术积分: 609
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-06 21:41
个人简介

好好学习,天天向上

文章分类

全部博文(65)

文章存档

2022年(3)

2021年(25)

2020年(1)

2019年(3)

2016年(2)

2015年(3)

2014年(14)

2013年(7)

2012年(7)

我的朋友

分类: 嵌入式

2021-12-02 17:24:45

prev_pid=5737 prev_prio=87 prev_state=R+ ==> next_comm




__entry->prev_state = __trace_sched_switch_state(preempt, prev);


(__entry->prev_state & (TASK_REPORT_MAX - 1)) ?
  __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|",
{ 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" },
{ 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" },
{ 0x40, "P" }, { 0x80, "I" }) :
  "R",


__entry->prev_state & TASK_REPORT_MAX ? "+" : "",


static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p)
{
unsigned int state;


#ifdef CONFIG_SCHED_DEBUG
BUG_ON(p != current);
#endif /* CONFIG_SCHED_DEBUG */


/*
* Preemption ignores task state, therefore preempted tasks are always
* RUNNING (we will not have dequeued if state != RUNNING).
*/
if (preempt)
return TASK_REPORT_MAX;  【如果R+,只可能这里返回,即trace的地方preempt变量为真 trace_sched_switch(preempt, prev, next); ,如 preempt_schedule_irq--> __schedule(true), 主动调用schedule调度的是__schedule(false), 则没有+号;


================
{ 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" },
{ 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" },
{ 0x40, "P" }, { 0x80, "I" }) :

/* Used in tsk->state: */
#define TASK_RUNNING 0x0000
#define TASK_INTERRUPTIBLE 0x0001
#define TASK_UNINTERRUPTIBLE 0x0002
#define __TASK_STOPPED 0x0004
#define __TASK_TRACED 0x0008
/* Used in tsk->exit_state: */
#define EXIT_DEAD 0x0010
#define EXIT_ZOMBIE 0x0020
#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD)
/* Used in tsk->state again: */
#define TASK_PARKED 0x0040


/* get_task_state(): */
#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
__TASK_TRACED | EXIT_DEAD | EXIT_ZOMBIE | \
TASK_PARKED)

#define TASK_REPORT_IDLE (TASK_REPORT + 1)


阅读(1511) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~