Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100566
b: refs/heads/master
c: 76094a2
h: refs/heads/master
v: v3
  • Loading branch information
Abhishek Sagar authored and Ingo Molnar committed Jun 2, 2008
1 parent 97e31ba commit 5105d4e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 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: 014c257cce65e9d1cd2d28ec1c89a37c536b151d
refs/heads/master: 76094a2cf46e4ab776055d4086615b884408568c
27 changes: 24 additions & 3 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/poll.h>
#include <linux/gfp.h>
#include <linux/fs.h>
#include <linux/kprobes.h>
#include <linux/writeback.h>

#include <linux/stacktrace.h>
Expand Down Expand Up @@ -1199,6 +1200,20 @@ static void s_stop(struct seq_file *m, void *p)
mutex_unlock(&trace_types_lock);
}

#define KRETPROBE_MSG "[unknown/kretprobe'd]"

#ifdef CONFIG_KRETPROBES
static inline int kretprobed(unsigned long addr)
{
return addr == (unsigned long)kretprobe_trampoline;
}
#else
static inline int kretprobed(unsigned long addr)
{
return 0;
}
#endif /* CONFIG_KRETPROBES */

static int
seq_print_sym_short(struct trace_seq *s, const char *fmt, unsigned long address)
{
Expand Down Expand Up @@ -1434,7 +1449,10 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)
case TRACE_FN:
seq_print_ip_sym(s, entry->fn.ip, sym_flags);
trace_seq_puts(s, " (");
seq_print_ip_sym(s, entry->fn.parent_ip, sym_flags);
if (kretprobed(entry->fn.parent_ip))
trace_seq_puts(s, KRETPROBE_MSG);
else
seq_print_ip_sym(s, entry->fn.parent_ip, sym_flags);
trace_seq_puts(s, ")\n");
break;
case TRACE_CTX:
Expand Down Expand Up @@ -1514,8 +1532,11 @@ static int print_trace_fmt(struct trace_iterator *iter)
ret = trace_seq_printf(s, " <-");
if (!ret)
return 0;
ret = seq_print_ip_sym(s, entry->fn.parent_ip,
sym_flags);
if (kretprobed(entry->fn.parent_ip))
ret = trace_seq_puts(s, KRETPROBE_MSG);
else
ret = seq_print_ip_sym(s, entry->fn.parent_ip,
sym_flags);
if (!ret)
return 0;
}
Expand Down

0 comments on commit 5105d4e

Please sign in to comment.