diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0feae23d9893..12f5e817380e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/poll.h> | 27 | #include <linux/poll.h> |
28 | #include <linux/gfp.h> | 28 | #include <linux/gfp.h> |
29 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
30 | #include <linux/kprobes.h> | ||
30 | #include <linux/writeback.h> | 31 | #include <linux/writeback.h> |
31 | 32 | ||
32 | #include <linux/stacktrace.h> | 33 | #include <linux/stacktrace.h> |
@@ -1199,6 +1200,20 @@ static void s_stop(struct seq_file *m, void *p) | |||
1199 | mutex_unlock(&trace_types_lock); | 1200 | mutex_unlock(&trace_types_lock); |
1200 | } | 1201 | } |
1201 | 1202 | ||
1203 | #define KRETPROBE_MSG "[unknown/kretprobe'd]" | ||
1204 | |||
1205 | #ifdef CONFIG_KRETPROBES | ||
1206 | static inline int kretprobed(unsigned long addr) | ||
1207 | { | ||
1208 | return addr == (unsigned long)kretprobe_trampoline; | ||
1209 | } | ||
1210 | #else | ||
1211 | static inline int kretprobed(unsigned long addr) | ||
1212 | { | ||
1213 | return 0; | ||
1214 | } | ||
1215 | #endif /* CONFIG_KRETPROBES */ | ||
1216 | |||
1202 | static int | 1217 | static int |
1203 | seq_print_sym_short(struct trace_seq *s, const char *fmt, unsigned long address) | 1218 | seq_print_sym_short(struct trace_seq *s, const char *fmt, unsigned long address) |
1204 | { | 1219 | { |
@@ -1434,7 +1449,10 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) | |||
1434 | case TRACE_FN: | 1449 | case TRACE_FN: |
1435 | seq_print_ip_sym(s, entry->fn.ip, sym_flags); | 1450 | seq_print_ip_sym(s, entry->fn.ip, sym_flags); |
1436 | trace_seq_puts(s, " ("); | 1451 | trace_seq_puts(s, " ("); |
1437 | seq_print_ip_sym(s, entry->fn.parent_ip, sym_flags); | 1452 | if (kretprobed(entry->fn.parent_ip)) |
1453 | trace_seq_puts(s, KRETPROBE_MSG); | ||
1454 | else | ||
1455 | seq_print_ip_sym(s, entry->fn.parent_ip, sym_flags); | ||
1438 | trace_seq_puts(s, ")\n"); | 1456 | trace_seq_puts(s, ")\n"); |
1439 | break; | 1457 | break; |
1440 | case TRACE_CTX: | 1458 | case TRACE_CTX: |
@@ -1514,8 +1532,11 @@ static int print_trace_fmt(struct trace_iterator *iter) | |||
1514 | ret = trace_seq_printf(s, " <-"); | 1532 | ret = trace_seq_printf(s, " <-"); |
1515 | if (!ret) | 1533 | if (!ret) |
1516 | return 0; | 1534 | return 0; |
1517 | ret = seq_print_ip_sym(s, entry->fn.parent_ip, | 1535 | if (kretprobed(entry->fn.parent_ip)) |
1518 | sym_flags); | 1536 | ret = trace_seq_puts(s, KRETPROBE_MSG); |
1537 | else | ||
1538 | ret = seq_print_ip_sym(s, entry->fn.parent_ip, | ||
1539 | sym_flags); | ||
1519 | if (!ret) | 1540 | if (!ret) |
1520 | return 0; | 1541 | return 0; |
1521 | } | 1542 | } |