Skip to content

Commit a0c2e07

Browse files
htejuntorvalds
authored andcommitted
proc: use %*pb[l] to print bitmaps including cpumasks and nodemasks
printk and friends can now format bitmaps using '%*pb[l]'. cpumask and nodemask also provide cpumask_pr_args() and nodemask_pr_args() respectively which can be used to generate the two printf arguments necessary to format the specified cpu/nodemask. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4497da6 commit a0c2e07

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fs/proc/array.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,10 @@ static inline void task_context_switch_counts(struct seq_file *m,
316316

317317
static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
318318
{
319-
seq_puts(m, "Cpus_allowed:\t");
320-
seq_cpumask(m, &task->cpus_allowed);
321-
seq_putc(m, '\n');
322-
seq_puts(m, "Cpus_allowed_list:\t");
323-
seq_cpumask_list(m, &task->cpus_allowed);
324-
seq_putc(m, '\n');
319+
seq_printf(m, "Cpus_allowed:\t%*pb\n",
320+
cpumask_pr_args(&task->cpus_allowed));
321+
seq_printf(m, "Cpus_allowed_list:\t%*pbl\n",
322+
cpumask_pr_args(&task->cpus_allowed));
325323
}
326324

327325
int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,

0 commit comments

Comments
 (0)