Lines Matching refs:buffer
182 struct trace_buffer *buffer,
519 struct trace_buffer *buffer, in call_filter_check_discard() argument
524 __trace_event_discard_commit(buffer, event); in call_filter_check_discard()
737 if (kstrtoul(parser.buffer, 0, &val)) in trace_pid_write()
774 if (!buf->buffer) in buffer_ftrace_now()
777 ts = ring_buffer_time_stamp(buf->buffer); in buffer_ftrace_now()
778 ring_buffer_normalize_time_stamp(buf->buffer, cpu, &ts); in buffer_ftrace_now()
913 static void __ftrace_trace_stack(struct trace_buffer *buffer,
917 struct trace_buffer *buffer,
922 static inline void __ftrace_trace_stack(struct trace_buffer *buffer, in __ftrace_trace_stack() argument
928 struct trace_buffer *buffer, in ftrace_trace_stack() argument
946 __trace_buffer_lock_reserve(struct trace_buffer *buffer, in __trace_buffer_lock_reserve() argument
953 event = ring_buffer_lock_reserve(buffer, len); in __trace_buffer_lock_reserve()
962 if (tr->array_buffer.buffer) in tracer_tracing_on()
963 ring_buffer_record_on(tr->array_buffer.buffer); in tracer_tracing_on()
991 __buffer_unlock_commit(struct trace_buffer *buffer, struct ring_buffer_event *event) in __buffer_unlock_commit() argument
998 ring_buffer_write(buffer, event->array[0], &event->array[1]); in __buffer_unlock_commit()
1004 ring_buffer_unlock_commit(buffer, event); in __buffer_unlock_commit()
1011 struct trace_buffer *buffer; in __trace_array_puts() local
1025 buffer = tr->array_buffer.buffer; in __trace_array_puts()
1026 ring_buffer_nest_start(buffer); in __trace_array_puts()
1027 event = __trace_buffer_lock_reserve(buffer, TRACE_PRINT, alloc, in __trace_array_puts()
1046 __buffer_unlock_commit(buffer, event); in __trace_array_puts()
1047 ftrace_trace_stack(tr, buffer, trace_ctx, 4, NULL); in __trace_array_puts()
1049 ring_buffer_nest_end(buffer); in __trace_array_puts()
1074 struct trace_buffer *buffer; in __trace_bputs() local
1087 buffer = global_trace.array_buffer.buffer; in __trace_bputs()
1089 ring_buffer_nest_start(buffer); in __trace_bputs()
1090 event = __trace_buffer_lock_reserve(buffer, TRACE_BPUTS, size, in __trace_bputs()
1099 __buffer_unlock_commit(buffer, event); in __trace_bputs()
1100 ftrace_trace_stack(&global_trace, buffer, trace_ctx, 4, NULL); in __trace_bputs()
1104 ring_buffer_nest_end(buffer); in __trace_bputs()
1247 ring_buffer_resize(tr->max_buffer.buffer, 1, RING_BUFFER_ALL_CPUS); in free_snapshot()
1438 if (tr->array_buffer.buffer) in tracer_tracing_off()
1439 ring_buffer_record_off(tr->array_buffer.buffer); in tracer_tracing_off()
1470 trace_array_printk_buf(global_trace.array_buffer.buffer, _THIS_IP_, in disable_trace_on_warning()
1484 if (tr->array_buffer.buffer) in tracer_tracing_is_on()
1485 return ring_buffer_record_is_on(tr->array_buffer.buffer); in tracer_tracing_is_on()
1582 parser->buffer = kmalloc(size, GFP_KERNEL); in trace_parser_get_init()
1583 if (!parser->buffer) in trace_parser_get_init()
1595 kfree(parser->buffer); in trace_parser_put()
1596 parser->buffer = NULL; in trace_parser_put()
1654 parser->buffer[parser->idx++] = ch; in trace_get_user()
1668 parser->buffer[parser->idx] = 0; in trace_get_user()
1672 parser->buffer[parser->idx++] = ch; in trace_get_user()
1674 parser->buffer[parser->idx] = 0; in trace_get_user()
1698 memcpy(buf, s->buffer + s->seq.readpos, cnt); in trace_seq_to_buffer()
1839 if (ring_buffer_record_is_set_on(tr->array_buffer.buffer)) in update_max_tr()
1840 ring_buffer_record_on(tr->max_buffer.buffer); in update_max_tr()
1842 ring_buffer_record_off(tr->max_buffer.buffer); in update_max_tr()
1850 swap(tr->array_buffer.buffer, tr->max_buffer.buffer); in update_max_tr()
1857 ring_buffer_wake_waiters(tr->array_buffer.buffer, RING_BUFFER_ALL_CPUS); in update_max_tr()
1885 ret = ring_buffer_swap_cpu(tr->max_buffer.buffer, tr->array_buffer.buffer, cpu); in update_max_tr_single()
1895 trace_array_printk_buf(tr->max_buffer.buffer, _THIS_IP_, in update_max_tr_single()
1915 ret = ring_buffer_wait(iter->array_buffer->buffer, iter->cpu_file, full); in wait_on_pipe()
1989 ring_buffer_resize(tr->max_buffer.buffer, trace_buf_size, in run_tracer_selftest()
2015 ring_buffer_resize(tr->max_buffer.buffer, 1, in run_tracer_selftest()
2174 struct trace_buffer *buffer = buf->buffer; in tracing_reset_cpu() local
2176 if (!buffer) in tracing_reset_cpu()
2179 ring_buffer_record_disable(buffer); in tracing_reset_cpu()
2183 ring_buffer_reset_cpu(buffer, cpu); in tracing_reset_cpu()
2185 ring_buffer_record_enable(buffer); in tracing_reset_cpu()
2190 struct trace_buffer *buffer = buf->buffer; in tracing_reset_online_cpus() local
2192 if (!buffer) in tracing_reset_online_cpus()
2195 ring_buffer_record_disable(buffer); in tracing_reset_online_cpus()
2202 ring_buffer_reset_online_cpus(buffer); in tracing_reset_online_cpus()
2204 ring_buffer_record_enable(buffer); in tracing_reset_online_cpus()
2331 struct trace_buffer *buffer; in tracing_start_tr() local
2349 buffer = tr->array_buffer.buffer; in tracing_start_tr()
2350 if (buffer) in tracing_start_tr()
2351 ring_buffer_record_enable(buffer); in tracing_start_tr()
2354 buffer = tr->max_buffer.buffer; in tracing_start_tr()
2355 if (buffer) in tracing_start_tr()
2356 ring_buffer_record_enable(buffer); in tracing_start_tr()
2379 struct trace_buffer *buffer; in tracing_stop_tr() local
2389 buffer = tr->array_buffer.buffer; in tracing_stop_tr()
2390 if (buffer) in tracing_stop_tr()
2391 ring_buffer_record_disable(buffer); in tracing_stop_tr()
2394 buffer = tr->max_buffer.buffer; in tracing_stop_tr()
2395 if (buffer) in tracing_stop_tr()
2396 ring_buffer_record_disable(buffer); in tracing_stop_tr()
2657 trace_buffer_lock_reserve(struct trace_buffer *buffer, in trace_buffer_lock_reserve() argument
2662 return __trace_buffer_lock_reserve(buffer, type, len, trace_ctx); in trace_buffer_lock_reserve()
2787 *current_rb = tr->array_buffer.buffer; in trace_event_buffer_lock_reserve()
2893 printk("%s", iter->seq.buffer); in output_printk()
2899 void *buffer, size_t *lenp, in tracepoint_printk_sysctl() argument
2908 ret = proc_dointvec(table, write, buffer, lenp, ppos); in tracepoint_printk_sysctl()
2936 if (__event_trigger_test_discard(file, fbuffer->buffer, fbuffer->event, in trace_event_buffer_commit()
2946 trace_buffer_unlock_commit_regs(file->tr, fbuffer->buffer, in trace_event_buffer_commit()
2966 struct trace_buffer *buffer, in trace_buffer_unlock_commit_regs() argument
2971 __buffer_unlock_commit(buffer, event); in trace_buffer_unlock_commit_regs()
2979 ftrace_trace_stack(tr, buffer, trace_ctx, regs ? 0 : STACK_SKIP, regs); in trace_buffer_unlock_commit_regs()
2980 ftrace_trace_userstack(tr, buffer, trace_ctx); in trace_buffer_unlock_commit_regs()
2987 trace_buffer_unlock_commit_nostack(struct trace_buffer *buffer, in trace_buffer_unlock_commit_nostack() argument
2990 __buffer_unlock_commit(buffer, event); in trace_buffer_unlock_commit_nostack()
2998 struct trace_buffer *buffer = tr->array_buffer.buffer; in trace_function() local
3002 event = __trace_buffer_lock_reserve(buffer, TRACE_FN, sizeof(*entry), in trace_function()
3010 if (!call_filter_check_discard(call, entry, buffer, event)) { in trace_function()
3013 __buffer_unlock_commit(buffer, event); in trace_function()
3036 static void __ftrace_trace_stack(struct trace_buffer *buffer, in __ftrace_trace_stack() argument
3084 event = __trace_buffer_lock_reserve(buffer, TRACE_STACK, in __ftrace_trace_stack()
3094 if (!call_filter_check_discard(call, entry, buffer, event)) in __ftrace_trace_stack()
3095 __buffer_unlock_commit(buffer, event); in __ftrace_trace_stack()
3106 struct trace_buffer *buffer, in ftrace_trace_stack() argument
3113 __ftrace_trace_stack(buffer, trace_ctx, skip, regs); in ftrace_trace_stack()
3119 struct trace_buffer *buffer = tr->array_buffer.buffer; in __trace_stack() local
3122 __ftrace_trace_stack(buffer, trace_ctx, skip, NULL); in __trace_stack()
3136 __ftrace_trace_stack(buffer, trace_ctx, skip, NULL); in __trace_stack()
3153 __ftrace_trace_stack(global_trace.array_buffer.buffer, in trace_dump_stack()
3163 struct trace_buffer *buffer, unsigned int trace_ctx) in ftrace_trace_userstack() argument
3189 event = __trace_buffer_lock_reserve(buffer, TRACE_USER_STACK, in ftrace_trace_userstack()
3199 if (!call_filter_check_discard(call, entry, buffer, event)) in ftrace_trace_userstack()
3200 __buffer_unlock_commit(buffer, event); in ftrace_trace_userstack()
3209 struct trace_buffer *buffer, in ftrace_trace_userstack() argument
3229 struct trace_buffer *buffer = tr->array_buffer.buffer; in trace_last_func_repeats() local
3234 event = __trace_buffer_lock_reserve(buffer, TRACE_FUNC_REPEATS, in trace_last_func_repeats()
3239 delta = ring_buffer_event_time_stamp(buffer, event) - in trace_last_func_repeats()
3248 __buffer_unlock_commit(buffer, event); in trace_last_func_repeats()
3254 char buffer[4][TRACE_BUF_SIZE]; member
3265 struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer); in get_trace_buf() local
3267 if (!trace_percpu_buffer || buffer->nesting >= 4) in get_trace_buf()
3270 buffer->nesting++; in get_trace_buf()
3274 return &buffer->buffer[buffer->nesting - 1][0]; in get_trace_buf()
3337 if (global_trace.array_buffer.buffer) in trace_printk_init_buffers()
3371 struct trace_buffer *buffer; in trace_vbprintk() local
3399 buffer = tr->array_buffer.buffer; in trace_vbprintk()
3400 ring_buffer_nest_start(buffer); in trace_vbprintk()
3401 event = __trace_buffer_lock_reserve(buffer, TRACE_BPRINT, size, in trace_vbprintk()
3410 if (!call_filter_check_discard(call, entry, buffer, event)) { in trace_vbprintk()
3411 __buffer_unlock_commit(buffer, event); in trace_vbprintk()
3412 ftrace_trace_stack(tr, buffer, trace_ctx, 6, NULL); in trace_vbprintk()
3416 ring_buffer_nest_end(buffer); in trace_vbprintk()
3430 __trace_array_vprintk(struct trace_buffer *buffer, in __trace_array_vprintk() argument
3459 ring_buffer_nest_start(buffer); in __trace_array_vprintk()
3460 event = __trace_buffer_lock_reserve(buffer, TRACE_PRINT, size, in __trace_array_vprintk()
3468 if (!call_filter_check_discard(call, entry, buffer, event)) { in __trace_array_vprintk()
3469 __buffer_unlock_commit(buffer, event); in __trace_array_vprintk()
3470 ftrace_trace_stack(&global_trace, buffer, trace_ctx, 6, NULL); in __trace_array_vprintk()
3474 ring_buffer_nest_end(buffer); in __trace_array_vprintk()
3488 return __trace_array_vprintk(tr->array_buffer.buffer, ip, fmt, args); in trace_array_vprintk()
3557 int trace_array_printk_buf(struct trace_buffer *buffer, in trace_array_printk_buf() argument
3567 ret = __trace_array_vprintk(buffer, ip, fmt, ap); in trace_array_printk_buf()
3601 event = ring_buffer_peek(iter->array_buffer->buffer, cpu, ts, in peek_next_entry()
3617 struct trace_buffer *buffer = iter->array_buffer->buffer; in __find_next_entry() local
3631 if (ring_buffer_empty_cpu(buffer, cpu_file)) in __find_next_entry()
3642 if (ring_buffer_empty_cpu(buffer, cpu)) in __find_next_entry()
3715 if ((addr >= (unsigned long)iter->tmp_seq.buffer) && in trace_safe_str()
3716 (addr < (unsigned long)iter->tmp_seq.buffer + PAGE_SIZE)) in trace_safe_str()
3754 return seq->buffer; in show_buffer()
4037 ring_buffer_consume(iter->array_buffer->buffer, iter->cpu, &iter->ts, in trace_consume()
4185 count = ring_buffer_entries_cpu(buf->buffer, cpu); in get_total_entries_cpu()
4197 ring_buffer_overrun_cpu(buf->buffer, cpu); in get_total_entries_cpu()
4501 if (!ring_buffer_empty_cpu(iter->array_buffer->buffer, cpu)) in trace_empty()
4513 if (!ring_buffer_empty_cpu(iter->array_buffer->buffer, cpu)) in trace_empty()
4808 if (ring_buffer_overruns(iter->array_buffer->buffer)) in __tracing_open()
4825 ring_buffer_read_prepare(iter->array_buffer->buffer, in __tracing_open()
4836 ring_buffer_read_prepare(iter->array_buffer->buffer, in __tracing_open()
5221 ring_buffer_record_disable_cpu(tr->array_buffer.buffer, cpu); in tracing_set_cpumask()
5223 ring_buffer_record_disable_cpu(tr->max_buffer.buffer, cpu); in tracing_set_cpumask()
5229 ring_buffer_record_enable_cpu(tr->array_buffer.buffer, cpu); in tracing_set_cpumask()
5231 ring_buffer_record_enable_cpu(tr->max_buffer.buffer, cpu); in tracing_set_cpumask()
5408 ring_buffer_change_overwrite(tr->array_buffer.buffer, enabled); in set_tracer_flag()
5410 ring_buffer_change_overwrite(tr->max_buffer.buffer, enabled); in set_tracer_flag()
6233 set_buffer_entries(buf, ring_buffer_size(buf->buffer, 0)); in update_buffer_entries()
6235 per_cpu_ptr(buf->data, cpu)->entries = ring_buffer_size(buf->buffer, cpu); in update_buffer_entries()
6248 ret = ring_buffer_resize(trace_buf->buffer, in resize_buffer_duplicate_size()
6256 ret = ring_buffer_resize(trace_buf->buffer, in resize_buffer_duplicate_size()
6280 if (!tr->array_buffer.buffer) in __tracing_resize_ring_buffer()
6286 ret = ring_buffer_resize(tr->array_buffer.buffer, size, cpu); in __tracing_resize_ring_buffer()
6294 ret = ring_buffer_resize(tr->max_buffer.buffer, size, cpu); in __tracing_resize_ring_buffer()
6741 return ring_buffer_poll_wait(iter->array_buffer->buffer, iter->cpu_file, in trace_poll()
7175 struct trace_buffer *buffer; in tracing_mark_write() local
7202 buffer = tr->array_buffer.buffer; in tracing_mark_write()
7203 event = __trace_buffer_lock_reserve(buffer, TRACE_PRINT, size, in tracing_mark_write()
7223 tt = event_triggers_call(tr->trace_marker_file, buffer, entry, event); in tracing_mark_write()
7234 __buffer_unlock_commit(buffer, event); in tracing_mark_write()
7251 struct trace_buffer *buffer; in tracing_mark_raw_write() local
7278 buffer = tr->array_buffer.buffer; in tracing_mark_raw_write()
7279 event = __trace_buffer_lock_reserve(buffer, TRACE_RAW_DATA, size, in tracing_mark_raw_write()
7295 __buffer_unlock_commit(buffer, event); in tracing_mark_raw_write()
7330 ring_buffer_set_clock(tr->array_buffer.buffer, trace_clocks[i].func); in tracing_set_clock()
7339 if (tr->max_buffer.buffer) in tracing_set_clock()
7340 ring_buffer_set_clock(tr->max_buffer.buffer, trace_clocks[i].func); in tracing_set_clock()
7399 if (ring_buffer_time_stamp_abs(tr->array_buffer.buffer)) in tracing_time_stamp_mode_show()
7425 u64 tracing_event_time_stamp(struct trace_buffer *buffer, struct ring_buffer_event *rbe) in tracing_event_time_stamp() argument
7428 return ring_buffer_time_stamp(buffer); in tracing_event_time_stamp()
7430 return ring_buffer_event_time_stamp(buffer, rbe); in tracing_event_time_stamp()
8087 const char __user *buffer, in tracing_err_log_write() argument
8179 info->spare = ring_buffer_alloc_read_page(iter->array_buffer->buffer, in tracing_buffers_read()
8197 ret = ring_buffer_read_page(iter->array_buffer->buffer, in tracing_buffers_read()
8250 ring_buffer_wake_waiters(iter->array_buffer->buffer, iter->cpu_file); in tracing_buffers_release()
8253 ring_buffer_free_read_page(iter->array_buffer->buffer, in tracing_buffers_release()
8263 struct trace_buffer *buffer; member
8273 ring_buffer_free_read_page(ref->buffer, ref->cpu, ref->page); in buffer_ref_release()
8356 entries = ring_buffer_entries_cpu(iter->array_buffer->buffer, iter->cpu_file); in tracing_buffers_splice_read()
8369 ref->buffer = iter->array_buffer->buffer; in tracing_buffers_splice_read()
8370 ref->page = ring_buffer_alloc_read_page(ref->buffer, iter->cpu_file); in tracing_buffers_splice_read()
8379 r = ring_buffer_read_page(ref->buffer, &ref->page, in tracing_buffers_splice_read()
8382 ring_buffer_free_read_page(ref->buffer, ref->cpu, in tracing_buffers_splice_read()
8397 entries = ring_buffer_entries_cpu(iter->array_buffer->buffer, iter->cpu_file); in tracing_buffers_splice_read()
8454 ring_buffer_wake_waiters(iter->array_buffer->buffer, iter->cpu_file); in tracing_buffers_ioctl()
8489 cnt = ring_buffer_entries_cpu(trace_buf->buffer, cpu); in tracing_stats_read()
8492 cnt = ring_buffer_overrun_cpu(trace_buf->buffer, cpu); in tracing_stats_read()
8495 cnt = ring_buffer_commit_overrun_cpu(trace_buf->buffer, cpu); in tracing_stats_read()
8498 cnt = ring_buffer_bytes_cpu(trace_buf->buffer, cpu); in tracing_stats_read()
8503 t = ns2usecs(ring_buffer_oldest_event_ts(trace_buf->buffer, cpu)); in tracing_stats_read()
8508 t = ns2usecs(ring_buffer_time_stamp(trace_buf->buffer)); in tracing_stats_read()
8514 ring_buffer_oldest_event_ts(trace_buf->buffer, cpu)); in tracing_stats_read()
8517 ring_buffer_time_stamp(trace_buf->buffer)); in tracing_stats_read()
8520 cnt = ring_buffer_dropped_events_cpu(trace_buf->buffer, cpu); in tracing_stats_read()
8523 cnt = ring_buffer_read_events_cpu(trace_buf->buffer, cpu); in tracing_stats_read()
8527 s->buffer, trace_seq_used(s)); in tracing_stats_read()
9156 struct trace_buffer *buffer = tr->array_buffer.buffer; in rb_simple_write() local
9164 if (buffer) { in rb_simple_write()
9177 ring_buffer_wake_waiters(buffer, RING_BUFFER_ALL_CPUS); in rb_simple_write()
9253 buf->buffer = ring_buffer_alloc(size, rb_flags); in allocate_trace_buffer()
9254 if (!buf->buffer) in allocate_trace_buffer()
9259 ring_buffer_free(buf->buffer); in allocate_trace_buffer()
9260 buf->buffer = NULL; in allocate_trace_buffer()
9266 ring_buffer_size(tr->array_buffer.buffer, 0)); in allocate_trace_buffer()
9273 if (buf->buffer) { in free_trace_buffer()
9274 ring_buffer_free(buf->buffer); in free_trace_buffer()
9275 buf->buffer = NULL; in free_trace_buffer()
10032 s->buffer[s->seq.len] = 0; in trace_printk_seq()
10036 printk(KERN_TRACE "%s", s->buffer); in trace_printk_seq()
10052 if (ring_buffer_overruns(iter->array_buffer->buffer)) in trace_init_global_iter()
10101 size = ring_buffer_size(iter.array_buffer->buffer, cpu); in ftrace_dump()
10185 ssize_t trace_parse_run_command(struct file *file, const char __user *buffer, in trace_parse_run_command() argument
10204 if (copy_from_user(kbuf, buffer + done, size)) { in trace_parse_run_command()