Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264863
b: refs/heads/master
c: 5b2ebce
h: refs/heads/master
i:
  264861: fb5085b
  264859: 1fc3e68
  264855: 71483e6
  264847: c10889c
  264831: 9291335
v: v3
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 34c4269 commit 16b6b66
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 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: 6c2140ee0ebf91258f93d3019922b5f520a18d88
refs/heads/master: 5b2ebce4821c66dd33d15d076ee264b4eb86fea3
34 changes: 23 additions & 11 deletions trunk/lib/dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,23 +430,35 @@ static int ddebug_exec_query(char *query_string)

static int dynamic_emit_prefix(const struct _ddebug *descriptor)
{
int res;
char tid[sizeof(int) + sizeof(int)/2 + 4];
char lineno[sizeof(int) + sizeof(int)/2];

res = printk(KERN_DEBUG);
if (descriptor->flags & _DPRINTK_FLAGS_INCL_TID) {
if (in_interrupt())
res += printk(KERN_CONT "<intr> ");
snprintf(tid, sizeof(tid), "%s", "<intr> ");
else
res += printk(KERN_CONT "[%d] ", task_pid_vnr(current));
snprintf(tid, sizeof(tid), "[%d] ",
task_pid_vnr(current));
} else {
tid[0] = 0;
}
if (descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME)
res += printk(KERN_CONT "%s:", descriptor->modname);
if (descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME)
res += printk(KERN_CONT "%s:", descriptor->function);
if (descriptor->flags & _DPRINTK_FLAGS_INCL_LINENO)
res += printk(KERN_CONT "%d ", descriptor->lineno);

return res;
if (descriptor->flags & _DPRINTK_FLAGS_INCL_LINENO)
snprintf(lineno, sizeof(lineno), "%d", descriptor->lineno);
else
lineno[0] = 0;

return printk(KERN_DEBUG "%s%s%s%s%s%s",
tid,
(descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ?
descriptor->modname : "",
(descriptor->flags & _DPRINTK_FLAGS_INCL_MODNAME) ?
":" : "",
(descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ?
descriptor->function : "",
(descriptor->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) ?
":" : "",
lineno);
}

int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
Expand Down

0 comments on commit 16b6b66

Please sign in to comment.