Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42779
b: refs/heads/master
c: e59e2ae
h: refs/heads/master
i:
  42777: 069f663
  42775: 84c8460
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Dec 7, 2006
1 parent 10181cc commit 8320ef6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 875d95ec9eb69ffb334116fb44d04d9a64dcbfbb
refs/heads/master: e59e2ae2c29700117a54e85c106017c24837119f
14 changes: 13 additions & 1 deletion trunk/drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ static struct sysrq_key_op sysrq_showstate_op = {
.enable_mask = SYSRQ_ENABLE_DUMP,
};

static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty)
{
show_state_filter(TASK_UNINTERRUPTIBLE);
}
static struct sysrq_key_op sysrq_showstate_blocked_op = {
.handler = sysrq_handle_showstate_blocked,
.help_msg = "showBlockedTasks",
.action_msg = "Show Blocked State",
.enable_mask = SYSRQ_ENABLE_DUMP,
};


static void sysrq_handle_showmem(int key, struct tty_struct *tty)
{
show_mem();
Expand Down Expand Up @@ -304,7 +316,7 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
/* May be assigned at init time by SMP VOYAGER */
NULL, /* v */
NULL, /* w */
NULL, /* x */
&sysrq_showstate_blocked_op, /* x */
NULL, /* y */
NULL /* z */
};
Expand Down
11 changes: 10 additions & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,16 @@ extern void init_idle(struct task_struct *idle, int cpu);

extern cpumask_t nohz_cpu_mask;

extern void show_state(void);
/*
* Only dump TASK_* tasks. (-1 for all tasks)
*/
extern void show_state_filter(unsigned long state_filter);

static inline void show_state(void)
{
show_state_filter(-1);
}

extern void show_regs(struct pt_regs *);

/*
Expand Down
11 changes: 8 additions & 3 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4804,7 +4804,7 @@ static void show_task(struct task_struct *p)
show_stack(p, NULL);
}

void show_state(void)
void show_state_filter(unsigned long state_filter)
{
struct task_struct *g, *p;

Expand All @@ -4824,11 +4824,16 @@ void show_state(void)
* console might take alot of time:
*/
touch_nmi_watchdog();
show_task(p);
if (p->state & state_filter)
show_task(p);
} while_each_thread(g, p);

read_unlock(&tasklist_lock);
debug_show_all_locks();
/*
* Only show locks if all tasks are dumped:
*/
if (state_filter == -1)
debug_show_all_locks();
}

/**
Expand Down

0 comments on commit 8320ef6

Please sign in to comment.