diff options
Diffstat (limited to 'kernel/trace/trace_output.c')
-rw-r--r-- | kernel/trace/trace_output.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index a436de18aa99..f3dad80c20b2 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -126,6 +126,34 @@ trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | |||
126 | EXPORT_SYMBOL_GPL(trace_seq_printf); | 126 | EXPORT_SYMBOL_GPL(trace_seq_printf); |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * trace_seq_bitmask - put a list of longs as a bitmask print output | ||
130 | * @s: trace sequence descriptor | ||
131 | * @maskp: points to an array of unsigned longs that represent a bitmask | ||
132 | * @nmaskbits: The number of bits that are valid in @maskp | ||
133 | * | ||
134 | * It returns 0 if the trace oversizes the buffer's free | ||
135 | * space, 1 otherwise. | ||
136 | * | ||
137 | * Writes a ASCII representation of a bitmask string into @s. | ||
138 | */ | ||
139 | int | ||
140 | trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp, | ||
141 | int nmaskbits) | ||
142 | { | ||
143 | int len = (PAGE_SIZE - 1) - s->len; | ||
144 | int ret; | ||
145 | |||
146 | if (s->full || !len) | ||
147 | return 0; | ||
148 | |||
149 | ret = bitmap_scnprintf(s->buffer, len, maskp, nmaskbits); | ||
150 | s->len += ret; | ||
151 | |||
152 | return 1; | ||
153 | } | ||
154 | EXPORT_SYMBOL_GPL(trace_seq_bitmask); | ||
155 | |||
156 | /** | ||
129 | * trace_seq_vprintf - sequence printing of trace information | 157 | * trace_seq_vprintf - sequence printing of trace information |
130 | * @s: trace sequence descriptor | 158 | * @s: trace sequence descriptor |
131 | * @fmt: printf format string | 159 | * @fmt: printf format string |
@@ -399,6 +427,19 @@ EXPORT_SYMBOL(ftrace_print_symbols_seq_u64); | |||
399 | #endif | 427 | #endif |
400 | 428 | ||
401 | const char * | 429 | const char * |
430 | ftrace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr, | ||
431 | unsigned int bitmask_size) | ||
432 | { | ||
433 | const char *ret = p->buffer + p->len; | ||
434 | |||
435 | trace_seq_bitmask(p, bitmask_ptr, bitmask_size * 8); | ||
436 | trace_seq_putc(p, 0); | ||
437 | |||
438 | return ret; | ||
439 | } | ||
440 | EXPORT_SYMBOL_GPL(ftrace_print_bitmask_seq); | ||
441 | |||
442 | const char * | ||
402 | ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) | 443 | ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) |
403 | { | 444 | { |
404 | int i; | 445 | int i; |