aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-19 12:20:38 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-03-19 15:57:55 -0400
commit5ef841f6f32dce0b752a4fa0622781ee67a0e874 (patch)
tree12c1ac0552f12b93662e2676137fb1286b50d4ee /kernel
parentac5f6c96859e9a664ac05b04bc96ed1caad5fe29 (diff)
tracing: make print_(b)printk_msg_only global
This patch makes print_printk_msg_only and print_bprintk_msg_only global for other functions to use. It also renames them by adding a "trace_" to the beginning to avoid namespace collisions. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c36
-rw-r--r--kernel/trace/trace_output.c32
-rw-r--r--kernel/trace/trace_output.h5
3 files changed, 39 insertions, 34 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8d981ababc45..c637cb687cf2 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1694,38 +1694,6 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter)
1694 return TRACE_TYPE_HANDLED; 1694 return TRACE_TYPE_HANDLED;
1695} 1695}
1696 1696
1697static enum print_line_t print_bprintk_msg_only(struct trace_iterator *iter)
1698{
1699 struct trace_seq *s = &iter->seq;
1700 struct trace_entry *entry = iter->ent;
1701 struct bprint_entry *field;
1702 int ret;
1703
1704 trace_assign_type(field, entry);
1705
1706 ret = trace_seq_bprintf(s, field->fmt, field->buf);
1707 if (!ret)
1708 return TRACE_TYPE_PARTIAL_LINE;
1709
1710 return TRACE_TYPE_HANDLED;
1711}
1712
1713static enum print_line_t print_printk_msg_only(struct trace_iterator *iter)
1714{
1715 struct trace_seq *s = &iter->seq;
1716 struct trace_entry *entry = iter->ent;
1717 struct print_entry *field;
1718 int ret;
1719
1720 trace_assign_type(field, entry);
1721
1722 ret = trace_seq_printf(s, "%s", field->buf);
1723 if (!ret)
1724 return TRACE_TYPE_PARTIAL_LINE;
1725
1726 return TRACE_TYPE_HANDLED;
1727}
1728
1729static enum print_line_t print_bin_fmt(struct trace_iterator *iter) 1697static enum print_line_t print_bin_fmt(struct trace_iterator *iter)
1730{ 1698{
1731 struct trace_seq *s = &iter->seq; 1699 struct trace_seq *s = &iter->seq;
@@ -1787,12 +1755,12 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter)
1787 if (iter->ent->type == TRACE_BPRINT && 1755 if (iter->ent->type == TRACE_BPRINT &&
1788 trace_flags & TRACE_ITER_PRINTK && 1756 trace_flags & TRACE_ITER_PRINTK &&
1789 trace_flags & TRACE_ITER_PRINTK_MSGONLY) 1757 trace_flags & TRACE_ITER_PRINTK_MSGONLY)
1790 return print_bprintk_msg_only(iter); 1758 return trace_print_bprintk_msg_only(iter);
1791 1759
1792 if (iter->ent->type == TRACE_PRINT && 1760 if (iter->ent->type == TRACE_PRINT &&
1793 trace_flags & TRACE_ITER_PRINTK && 1761 trace_flags & TRACE_ITER_PRINTK &&
1794 trace_flags & TRACE_ITER_PRINTK_MSGONLY) 1762 trace_flags & TRACE_ITER_PRINTK_MSGONLY)
1795 return print_printk_msg_only(iter); 1763 return trace_print_printk_msg_only(iter);
1796 1764
1797 if (trace_flags & TRACE_ITER_BIN) 1765 if (trace_flags & TRACE_ITER_BIN)
1798 return print_bin_fmt(iter); 1766 return print_bin_fmt(iter);
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 6a4c9dea191e..b45141748af5 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -19,6 +19,38 @@ static struct hlist_head event_hash[EVENT_HASHSIZE] __read_mostly;
19 19
20static int next_event_type = __TRACE_LAST_TYPE + 1; 20static int next_event_type = __TRACE_LAST_TYPE + 1;
21 21
22enum print_line_t trace_print_bprintk_msg_only(struct trace_iterator *iter)
23{
24 struct trace_seq *s = &iter->seq;
25 struct trace_entry *entry = iter->ent;
26 struct bprint_entry *field;
27 int ret;
28
29 trace_assign_type(field, entry);
30
31 ret = trace_seq_bprintf(s, field->fmt, field->buf);
32 if (!ret)
33 return TRACE_TYPE_PARTIAL_LINE;
34
35 return TRACE_TYPE_HANDLED;
36}
37
38enum print_line_t trace_print_printk_msg_only(struct trace_iterator *iter)
39{
40 struct trace_seq *s = &iter->seq;
41 struct trace_entry *entry = iter->ent;
42 struct print_entry *field;
43 int ret;
44
45 trace_assign_type(field, entry);
46
47 ret = trace_seq_printf(s, "%s", field->buf);
48 if (!ret)
49 return TRACE_TYPE_PARTIAL_LINE;
50
51 return TRACE_TYPE_HANDLED;
52}
53
22/** 54/**
23 * trace_seq_printf - sequence printing of trace information 55 * trace_seq_printf - sequence printing of trace information
24 * @s: trace sequence descriptor 56 * @s: trace sequence descriptor
diff --git a/kernel/trace/trace_output.h b/kernel/trace/trace_output.h
index 3b90e6ade1aa..35c422fb51a9 100644
--- a/kernel/trace/trace_output.h
+++ b/kernel/trace/trace_output.h
@@ -15,6 +15,11 @@ struct trace_event {
15 trace_print_func binary; 15 trace_print_func binary;
16}; 16};
17 17
18extern enum print_line_t
19trace_print_bprintk_msg_only(struct trace_iterator *iter);
20extern enum print_line_t
21trace_print_printk_msg_only(struct trace_iterator *iter);
22
18extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) 23extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
19 __attribute__ ((format (printf, 2, 3))); 24 __attribute__ ((format (printf, 2, 3)));
20extern int 25extern int