diff options
| author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-11-12 11:49:00 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-19 15:25:40 -0500 |
| commit | c0cd93aa1640a48038bacbee093695f892ea0130 (patch) | |
| tree | eeb08bddbec6c7c728d2a9636148306a3705ff96 /kernel/trace/ring_buffer.c | |
| parent | f4a1d08ce65d7156504f2f0eac26f47dfc9120e6 (diff) | |
ring-buffer: Remove check of trace_seq_{puts,printf}() return values
Remove checking the return value of all trace_seq_puts(). It was wrong
anyway as only the last return value mattered. But as the trace_seq_puts()
is going to be a void function in the future, we should not be checking
the return value of it anyway.
Just return !trace_seq_has_overflowed() instead.
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
| -rw-r--r-- | kernel/trace/ring_buffer.c | 75 |
1 files changed, 36 insertions, 39 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 2d75c94ae87d..a28bdd17c853 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
| @@ -34,21 +34,19 @@ static void update_pages_handler(struct work_struct *work); | |||
| 34 | */ | 34 | */ |
| 35 | int ring_buffer_print_entry_header(struct trace_seq *s) | 35 | int ring_buffer_print_entry_header(struct trace_seq *s) |
| 36 | { | 36 | { |
| 37 | int ret; | 37 | trace_seq_puts(s, "# compressed entry header\n"); |
| 38 | 38 | trace_seq_puts(s, "\ttype_len : 5 bits\n"); | |
| 39 | ret = trace_seq_puts(s, "# compressed entry header\n"); | 39 | trace_seq_puts(s, "\ttime_delta : 27 bits\n"); |
| 40 | ret = trace_seq_puts(s, "\ttype_len : 5 bits\n"); | 40 | trace_seq_puts(s, "\tarray : 32 bits\n"); |
| 41 | ret = trace_seq_puts(s, "\ttime_delta : 27 bits\n"); | 41 | trace_seq_putc(s, '\n'); |
| 42 | ret = trace_seq_puts(s, "\tarray : 32 bits\n"); | 42 | trace_seq_printf(s, "\tpadding : type == %d\n", |
| 43 | ret = trace_seq_putc(s, '\n'); | 43 | RINGBUF_TYPE_PADDING); |
| 44 | ret = trace_seq_printf(s, "\tpadding : type == %d\n", | 44 | trace_seq_printf(s, "\ttime_extend : type == %d\n", |
| 45 | RINGBUF_TYPE_PADDING); | 45 | RINGBUF_TYPE_TIME_EXTEND); |
| 46 | ret = trace_seq_printf(s, "\ttime_extend : type == %d\n", | 46 | trace_seq_printf(s, "\tdata max type_len == %d\n", |
| 47 | RINGBUF_TYPE_TIME_EXTEND); | 47 | RINGBUF_TYPE_DATA_TYPE_LEN_MAX); |
| 48 | ret = trace_seq_printf(s, "\tdata max type_len == %d\n", | ||
| 49 | RINGBUF_TYPE_DATA_TYPE_LEN_MAX); | ||
| 50 | 48 | ||
| 51 | return ret; | 49 | return !trace_seq_has_overflowed(s); |
| 52 | } | 50 | } |
| 53 | 51 | ||
| 54 | /* | 52 | /* |
| @@ -419,32 +417,31 @@ static inline int test_time_stamp(u64 delta) | |||
| 419 | int ring_buffer_print_page_header(struct trace_seq *s) | 417 | int ring_buffer_print_page_header(struct trace_seq *s) |
| 420 | { | 418 | { |
| 421 | struct buffer_data_page field; | 419 | struct buffer_data_page field; |
| 422 | int ret; | ||
| 423 | |||
| 424 | ret = trace_seq_printf(s, "\tfield: u64 timestamp;\t" | ||
| 425 | "offset:0;\tsize:%u;\tsigned:%u;\n", | ||
| 426 | (unsigned int)sizeof(field.time_stamp), | ||
| 427 | (unsigned int)is_signed_type(u64)); | ||
| 428 | |||
| 429 | ret = trace_seq_printf(s, "\tfield: local_t commit;\t" | ||
| 430 | "offset:%u;\tsize:%u;\tsigned:%u;\n", | ||
| 431 | (unsigned int)offsetof(typeof(field), commit), | ||
| 432 | (unsigned int)sizeof(field.commit), | ||
| 433 | (unsigned int)is_signed_type(long)); | ||
| 434 | |||
| 435 | ret = trace_seq_printf(s, "\tfield: int overwrite;\t" | ||
| 436 | "offset:%u;\tsize:%u;\tsigned:%u;\n", | ||
| 437 | (unsigned int)offsetof(typeof(field), commit), | ||
| 438 | 1, | ||
| 439 | (unsigned int)is_signed_type(long)); | ||
| 440 | |||
| 441 | ret = trace_seq_printf(s, "\tfield: char data;\t" | ||
| 442 | "offset:%u;\tsize:%u;\tsigned:%u;\n", | ||
| 443 | (unsigned int)offsetof(typeof(field), data), | ||
| 444 | (unsigned int)BUF_PAGE_SIZE, | ||
| 445 | (unsigned int)is_signed_type(char)); | ||
| 446 | 420 | ||
| 447 | return ret; | 421 | trace_seq_printf(s, "\tfield: u64 timestamp;\t" |
| 422 | "offset:0;\tsize:%u;\tsigned:%u;\n", | ||
| 423 | (unsigned int)sizeof(field.time_stamp), | ||
| 424 | (unsigned int)is_signed_type(u64)); | ||
| 425 | |||
| 426 | trace_seq_printf(s, "\tfield: local_t commit;\t" | ||
| 427 | "offset:%u;\tsize:%u;\tsigned:%u;\n", | ||
| 428 | (unsigned int)offsetof(typeof(field), commit), | ||
| 429 | (unsigned int)sizeof(field.commit), | ||
| 430 | (unsigned int)is_signed_type(long)); | ||
| 431 | |||
| 432 | trace_seq_printf(s, "\tfield: int overwrite;\t" | ||
| 433 | "offset:%u;\tsize:%u;\tsigned:%u;\n", | ||
| 434 | (unsigned int)offsetof(typeof(field), commit), | ||
| 435 | 1, | ||
| 436 | (unsigned int)is_signed_type(long)); | ||
| 437 | |||
| 438 | trace_seq_printf(s, "\tfield: char data;\t" | ||
| 439 | "offset:%u;\tsize:%u;\tsigned:%u;\n", | ||
| 440 | (unsigned int)offsetof(typeof(field), data), | ||
| 441 | (unsigned int)BUF_PAGE_SIZE, | ||
| 442 | (unsigned int)is_signed_type(char)); | ||
| 443 | |||
| 444 | return !trace_seq_has_overflowed(s); | ||
| 448 | } | 445 | } |
| 449 | 446 | ||
| 450 | struct rb_irq_work { | 447 | struct rb_irq_work { |
