Lines Matching refs:buf
178 int tracing_set_tracer(struct trace_array *tr, const char *buf);
769 static u64 buffer_ftrace_now(struct array_buffer *buf, int cpu) in buffer_ftrace_now() argument
774 if (!buf->buffer) in buffer_ftrace_now()
777 ts = ring_buffer_time_stamp(buf->buffer, cpu); in buffer_ftrace_now()
778 ring_buffer_normalize_time_stamp(buf->buffer, cpu, &ts); in buffer_ftrace_now()
1043 memcpy(&entry->buf, str, size); in __trace_puts()
1046 if (entry->buf[size - 1] != '\n') { in __trace_puts()
1047 entry->buf[size] = '\n'; in __trace_puts()
1048 entry->buf[size + 1] = '\0'; in __trace_puts()
1050 entry->buf[size] = '\0'; in __trace_puts()
1217 static void set_buffer_entries(struct array_buffer *buf, unsigned long val);
1683 static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) in trace_seq_to_buffer() argument
1693 memcpy(buf, s->buffer + s->seq.readpos, cnt); in trace_seq_to_buffer()
2162 static void tracing_reset_cpu(struct array_buffer *buf, int cpu) in tracing_reset_cpu() argument
2164 struct trace_buffer *buffer = buf->buffer; in tracing_reset_cpu()
2178 void tracing_reset_online_cpus(struct array_buffer *buf) in tracing_reset_online_cpus() argument
2180 struct trace_buffer *buffer = buf->buffer; in tracing_reset_online_cpus()
2190 buf->time_start = buffer_ftrace_now(buf, buf->cpu); in tracing_reset_online_cpus()
3307 memcpy(entry->buf, tbuffer, sizeof(u32) * len); in trace_vbprintk()
3366 memcpy(&entry->buf, tbuffer, len + 1); in __trace_array_vprintk()
3778 get_total_entries_cpu(struct array_buffer *buf, unsigned long *total, in get_total_entries_cpu() argument
3783 count = ring_buffer_entries_cpu(buf->buffer, cpu); in get_total_entries_cpu()
3789 if (per_cpu_ptr(buf->data, cpu)->skipped_entries) { in get_total_entries_cpu()
3790 count -= per_cpu_ptr(buf->data, cpu)->skipped_entries; in get_total_entries_cpu()
3795 ring_buffer_overrun_cpu(buf->buffer, cpu); in get_total_entries_cpu()
3800 get_total_entries(struct array_buffer *buf, in get_total_entries() argument
3810 get_total_entries_cpu(buf, &t, &e, cpu); in get_total_entries()
3852 static void print_event_info(struct array_buffer *buf, struct seq_file *m) in print_event_info() argument
3857 get_total_entries(buf, &total, &entries); in print_event_info()
3863 static void print_func_help_header(struct array_buffer *buf, struct seq_file *m, in print_func_help_header() argument
3868 print_event_info(buf, m); in print_func_help_header()
3874 static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file *m, in print_func_help_header_irq() argument
3881 print_event_info(buf, m); in print_func_help_header_irq()
3896 struct array_buffer *buf = iter->array_buffer; in print_trace_header() local
3897 struct trace_array_cpu *data = per_cpu_ptr(buf->data, buf->cpu); in print_trace_header()
3905 get_total_entries(buf, &total, &entries); in print_trace_header()
3916 buf->cpu, in print_trace_header()
5044 char *buf = trace_boot_options_buf; in apply_trace_boot_options() local
5048 option = strsep(&buf, ","); in apply_trace_boot_options()
5057 if (buf) in apply_trace_boot_options()
5058 *(buf - 1) = ','; in apply_trace_boot_options()
5068 char buf[64]; in tracing_trace_options_write() local
5071 if (cnt >= sizeof(buf)) in tracing_trace_options_write()
5074 if (copy_from_user(buf, ubuf, cnt)) in tracing_trace_options_write()
5077 buf[cnt] = 0; in tracing_trace_options_write()
5079 ret = trace_set_options(tr, buf); in tracing_trace_options_write()
5490 char buf[TASK_COMM_LEN]; in saved_cmdlines_show() local
5493 __trace_find_cmdline(*pid, buf); in saved_cmdlines_show()
5494 seq_printf(m, "%d %s\n", *pid, buf); in saved_cmdlines_show()
5527 char buf[64]; in tracing_saved_cmdlines_size_read() local
5532 r = scnprintf(buf, sizeof(buf), "%u\n", savedcmd->cmdline_num); in tracing_saved_cmdlines_size_read()
5536 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in tracing_saved_cmdlines_size_read()
5770 char buf[MAX_TRACER_SIZE+2]; in tracing_set_trace_read() local
5774 r = sprintf(buf, "%s\n", tr->current_trace->name); in tracing_set_trace_read()
5777 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in tracing_set_trace_read()
5786 static void set_buffer_entries(struct array_buffer *buf, unsigned long val) in set_buffer_entries() argument
5791 per_cpu_ptr(buf->data, cpu)->entries = val; in set_buffer_entries()
5794 static void update_buffer_entries(struct array_buffer *buf, int cpu) in update_buffer_entries() argument
5797 set_buffer_entries(buf, ring_buffer_size(buf->buffer, 0)); in update_buffer_entries()
5799 per_cpu_ptr(buf->data, cpu)->entries = ring_buffer_size(buf->buffer, cpu); in update_buffer_entries()
5980 int tracing_set_tracer(struct trace_array *tr, const char *buf) in tracing_set_tracer() argument
5999 if (strcmp(t->name, buf) == 0) in tracing_set_tracer()
6094 char buf[MAX_TRACER_SIZE+1]; in tracing_set_trace_write() local
6104 if (copy_from_user(buf, ubuf, cnt)) in tracing_set_trace_write()
6107 buf[cnt] = 0; in tracing_set_trace_write()
6110 for (i = cnt - 1; i > 0 && isspace(buf[i]); i--) in tracing_set_trace_write()
6111 buf[i] = 0; in tracing_set_trace_write()
6113 err = tracing_set_tracer(tr, buf); in tracing_set_trace_write()
6126 char buf[64]; in tracing_nsecs_read() local
6129 r = snprintf(buf, sizeof(buf), "%ld\n", in tracing_nsecs_read()
6131 if (r > sizeof(buf)) in tracing_nsecs_read()
6132 r = sizeof(buf); in tracing_nsecs_read()
6133 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in tracing_nsecs_read()
6609 char buf[64]; in tracing_entries_read() local
6634 r = sprintf(buf, "%lu (expanded: %lu)\n", in tracing_entries_read()
6638 r = sprintf(buf, "%lu\n", size >> 10); in tracing_entries_read()
6640 r = sprintf(buf, "X\n"); in tracing_entries_read()
6642 r = sprintf(buf, "%lu\n", per_cpu_ptr(tr->array_buffer.data, cpu)->entries >> 10); in tracing_entries_read()
6646 ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in tracing_entries_read()
6683 char buf[64]; in tracing_total_entries_read() local
6694 r = sprintf(buf, "%lu\n", size); in tracing_total_entries_read()
6696 r = sprintf(buf, "%lu (expanded: %lu)\n", size, expanded_size); in tracing_total_entries_read()
6699 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in tracing_total_entries_read()
6778 len = __copy_from_user_inatomic(&entry->buf, ubuf, cnt); in tracing_mark_write()
6780 memcpy(&entry->buf, FAULTED_STR, FAULTED_SIZE); in tracing_mark_write()
6788 entry->buf[cnt] = '\0'; in tracing_mark_write()
6792 if (entry->buf[cnt - 1] != '\n') { in tracing_mark_write()
6793 entry->buf[cnt] = '\n'; in tracing_mark_write()
6794 entry->buf[cnt + 1] = '\0'; in tracing_mark_write()
6796 entry->buf[cnt] = '\0'; in tracing_mark_write()
6861 memcpy(&entry->buf, FAULTED_STR, FAULTED_SIZE); in tracing_mark_raw_write()
6928 char buf[64]; in tracing_clock_write() local
6932 if (cnt >= sizeof(buf)) in tracing_clock_write()
6935 if (copy_from_user(buf, ubuf, cnt)) in tracing_clock_write()
6938 buf[cnt] = 0; in tracing_clock_write()
6940 clockstr = strstrip(buf); in tracing_clock_write()
7729 struct pipe_buffer *buf) in buffer_pipe_buf_release() argument
7731 struct buffer_ref *ref = (struct buffer_ref *)buf->private; in buffer_pipe_buf_release()
7734 buf->private = 0; in buffer_pipe_buf_release()
7738 struct pipe_buffer *buf) in buffer_pipe_buf_get() argument
7740 struct buffer_ref *ref = (struct buffer_ref *)buf->private; in buffer_pipe_buf_get()
7964 char *buf; in tracing_read_dyn_info() local
7968 buf = kmalloc(256, GFP_KERNEL); in tracing_read_dyn_info()
7969 if (!buf) in tracing_read_dyn_info()
7972 r = scnprintf(buf, 256, "%ld pages:%ld groups: %ld\n", in tracing_read_dyn_info()
7977 ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in tracing_read_dyn_info()
7978 kfree(buf); in tracing_read_dyn_info()
8243 char *buf; in trace_options_read() local
8246 buf = "1\n"; in trace_options_read()
8248 buf = "0\n"; in trace_options_read()
8250 return simple_read_from_buffer(ubuf, cnt, ppos, buf, 2); in trace_options_read()
8351 char *buf; in trace_options_core_read() local
8356 buf = "1\n"; in trace_options_core_read()
8358 buf = "0\n"; in trace_options_core_read()
8360 return simple_read_from_buffer(ubuf, cnt, ppos, buf, 2); in trace_options_core_read()
8558 char buf[64]; in rb_simple_read() local
8562 r = sprintf(buf, "%d\n", r); in rb_simple_read()
8564 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in rb_simple_read()
8614 char buf[64]; in buffer_percent_read() local
8618 r = sprintf(buf, "%d\n", r); in buffer_percent_read()
8620 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); in buffer_percent_read()
8659 allocate_trace_buffer(struct trace_array *tr, struct array_buffer *buf, int size) in allocate_trace_buffer() argument
8665 buf->tr = tr; in allocate_trace_buffer()
8667 buf->buffer = ring_buffer_alloc(size, rb_flags); in allocate_trace_buffer()
8668 if (!buf->buffer) in allocate_trace_buffer()
8671 buf->data = alloc_percpu(struct trace_array_cpu); in allocate_trace_buffer()
8672 if (!buf->data) { in allocate_trace_buffer()
8673 ring_buffer_free(buf->buffer); in allocate_trace_buffer()
8674 buf->buffer = NULL; in allocate_trace_buffer()
8715 static void free_trace_buffer(struct array_buffer *buf) in free_trace_buffer() argument
8717 if (buf->buffer) { in free_trace_buffer()
8718 ring_buffer_free(buf->buffer); in free_trace_buffer()
8719 buf->buffer = NULL; in free_trace_buffer()
8720 free_percpu(buf->data); in free_trace_buffer()
8721 buf->data = NULL; in free_trace_buffer()
9558 int trace_run_command(const char *buf, int (*createfn)(int, char **)) in trace_run_command() argument
9565 argv = argv_split(GFP_KERNEL, buf, &argc); in trace_run_command()
9583 char *kbuf, *buf, *tmp; in trace_parse_run_command() local
9603 buf = kbuf; in trace_parse_run_command()
9605 tmp = strchr(buf, '\n'); in trace_parse_run_command()
9608 size = tmp - buf + 1; in trace_parse_run_command()
9610 size = strlen(buf); in trace_parse_run_command()
9612 if (buf != kbuf) in trace_parse_run_command()
9624 tmp = strchr(buf, '#'); in trace_parse_run_command()
9629 ret = trace_run_command(buf, createfn); in trace_parse_run_command()
9632 buf += size; in trace_parse_run_command()