Skip to content

Commit 5ef841f

Browse files
author
Steven Rostedt
committed
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>
1 parent ac5f6c9 commit 5ef841f

3 files changed

Lines changed: 39 additions & 34 deletions

File tree

‎kernel/trace/trace.c‎

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,38 +1694,6 @@ static enum print_line_t print_hex_fmt(struct trace_iterator *iter)
16941694
return TRACE_TYPE_HANDLED;
16951695
}
16961696

1697-
static 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-
1713-
static 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-
17291697
static enum print_line_t print_bin_fmt(struct trace_iterator *iter)
17301698
{
17311699
struct trace_seq *s = &iter->seq;
@@ -1787,12 +1755,12 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter)
17871755
if (iter->ent->type == TRACE_BPRINT &&
17881756
trace_flags & TRACE_ITER_PRINTK &&
17891757
trace_flags & TRACE_ITER_PRINTK_MSGONLY)
1790-
return print_bprintk_msg_only(iter);
1758+
return trace_print_bprintk_msg_only(iter);
17911759

17921760
if (iter->ent->type == TRACE_PRINT &&
17931761
trace_flags & TRACE_ITER_PRINTK &&
17941762
trace_flags & TRACE_ITER_PRINTK_MSGONLY)
1795-
return print_printk_msg_only(iter);
1763+
return trace_print_printk_msg_only(iter);
17961764

17971765
if (trace_flags & TRACE_ITER_BIN)
17981766
return print_bin_fmt(iter);

‎kernel/trace/trace_output.c‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,38 @@ static struct hlist_head event_hash[EVENT_HASHSIZE] __read_mostly;
1919

2020
static int next_event_type = __TRACE_LAST_TYPE + 1;
2121

22+
enum 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+
38+
enum 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+
2254
/**
2355
* trace_seq_printf - sequence printing of trace information
2456
* @s: trace sequence descriptor

‎kernel/trace/trace_output.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ struct trace_event {
1515
trace_print_func binary;
1616
};
1717

18+
extern enum print_line_t
19+
trace_print_bprintk_msg_only(struct trace_iterator *iter);
20+
extern enum print_line_t
21+
trace_print_printk_msg_only(struct trace_iterator *iter);
22+
1823
extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
1924
__attribute__ ((format (printf, 2, 3)));
2025
extern int

0 commit comments

Comments
 (0)