Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 142) sorted by relevance

123456

/kernel/
Drelay.c36 struct rchan_buf *buf = vmf->vma->vm_private_data; in relay_buf_fault() local
39 if (!buf) in relay_buf_fault()
42 page = vmalloc_to_page(buf->start + (pgoff << PAGE_SHIFT)); in relay_buf_fault()
83 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) in relay_mmap_buf() argument
87 if (!buf) in relay_mmap_buf()
90 if (length != (unsigned long)buf->chan->alloc_size) in relay_mmap_buf()
95 vma->vm_private_data = buf; in relay_mmap_buf()
108 static void *relay_alloc_buf(struct rchan_buf *buf, size_t *size) in relay_alloc_buf() argument
116 buf->page_array = relay_alloc_page_array(n_pages); in relay_alloc_buf()
117 if (!buf->page_array) in relay_alloc_buf()
[all …]
Dksysfs.c31 struct kobj_attribute *attr, char *buf) in uevent_seqnum_show() argument
33 return sprintf(buf, "%llu\n", (unsigned long long)uevent_seqnum); in uevent_seqnum_show()
40 struct kobj_attribute *attr, char *buf) in uevent_helper_show() argument
42 return sprintf(buf, "%s\n", uevent_helper); in uevent_helper_show()
46 const char *buf, size_t count) in uevent_helper_store() argument
50 memcpy(uevent_helper, buf, count); in uevent_helper_store()
61 struct kobj_attribute *attr, char *buf) in profiling_show() argument
63 return sprintf(buf, "%d\n", prof_on); in profiling_show()
67 const char *buf, size_t count) in profiling_store() argument
78 profile_setup((char *)buf); in profiling_store()
[all …]
Dcrash_core.c317 Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type, in append_elf_note() argument
320 struct elf_note *note = (struct elf_note *)buf; in append_elf_note()
325 buf += DIV_ROUND_UP(sizeof(*note), sizeof(Elf_Word)); in append_elf_note()
326 memcpy(buf, name, note->n_namesz); in append_elf_note()
327 buf += DIV_ROUND_UP(note->n_namesz, sizeof(Elf_Word)); in append_elf_note()
328 memcpy(buf, data, data_len); in append_elf_note()
329 buf += DIV_ROUND_UP(data_len, sizeof(Elf_Word)); in append_elf_note()
331 return buf; in append_elf_note()
334 void final_note(Elf_Word *buf) in final_note() argument
336 memset(buf, 0, sizeof(struct elf_note)); in final_note()
[all …]
Dreboot.c1088 static ssize_t mode_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in mode_show() argument
1112 return sprintf(buf, "%s\n", val); in mode_show()
1115 const char *buf, size_t count) in mode_store() argument
1120 if (!strncmp(buf, REBOOT_COLD_STR, strlen(REBOOT_COLD_STR))) in mode_store()
1122 else if (!strncmp(buf, REBOOT_WARM_STR, strlen(REBOOT_WARM_STR))) in mode_store()
1124 else if (!strncmp(buf, REBOOT_HARD_STR, strlen(REBOOT_HARD_STR))) in mode_store()
1126 else if (!strncmp(buf, REBOOT_SOFT_STR, strlen(REBOOT_SOFT_STR))) in mode_store()
1128 else if (!strncmp(buf, REBOOT_GPIO_STR, strlen(REBOOT_GPIO_STR))) in mode_store()
1140 static ssize_t force_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) in force_show() argument
1142 return sprintf(buf, "%d\n", reboot_force); in force_show()
[all …]
Dpanic.c277 static char buf[1024]; in panic() local
327 len = vscnprintf(buf, sizeof(buf), fmt, args); in panic()
330 if (len && buf[len - 1] == '\n') in panic()
331 buf[len - 1] = '\0'; in panic()
333 pr_emerg("Kernel panic - not syncing: %s\n", buf); in panic()
347 kgdb_panic(buf); in panic()
366 atomic_notifier_call_chain(&panic_notifier_list, 0, buf); in panic()
440 pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf); in panic()
493 static char buf[TAINT_FLAGS_COUNT + sizeof("Tainted: ")]; in print_tainted() local
501 s = buf + sprintf(buf, "Tainted: "); in print_tainted()
[all …]
Dkexec_elf.c119 static int elf_read_ehdr(const char *buf, size_t len, struct elfhdr *ehdr) in elf_read_ehdr() argument
129 memcpy(ehdr->e_ident, buf, sizeof(ehdr->e_ident)); in elf_read_ehdr()
144 buf_ehdr = (struct elfhdr *) buf; in elf_read_ehdr()
202 static int elf_read_phdr(const char *buf, size_t len, in elf_read_phdr() argument
212 pbuf = buf + elf_info->ehdr->e_phoff + (idx * sizeof(*buf_phdr)); in elf_read_phdr()
251 static int elf_read_phdrs(const char *buf, size_t len, in elf_read_phdrs() argument
270 ret = elf_read_phdr(buf, len, elf_info, i); in elf_read_phdrs()
296 static int elf_read_from_buffer(const char *buf, size_t len, in elf_read_from_buffer() argument
302 ret = elf_read_ehdr(buf, len, ehdr); in elf_read_from_buffer()
306 elf_info->buffer = buf; in elf_read_from_buffer()
[all …]
Dwatch_queue.c59 struct pipe_buffer *buf) in watch_queue_pipe_buf_release() argument
61 struct watch_queue *wqueue = (struct watch_queue *)buf->private; in watch_queue_pipe_buf_release()
69 bit = buf->offset + buf->len; in watch_queue_pipe_buf_release()
74 page = buf->page; in watch_queue_pipe_buf_release()
78 generic_pipe_buf_release(pipe, buf); in watch_queue_pipe_buf_release()
103 struct pipe_buffer *buf; in post_one_notification() local
128 buf = &pipe->bufs[head & mask]; in post_one_notification()
129 buf->page = page; in post_one_notification()
130 buf->private = (unsigned long)wqueue; in post_one_notification()
131 buf->ops = &watch_queue_pipe_buf_ops; in post_one_notification()
[all …]
Dkexec_core.c782 unsigned char __user *buf = NULL; in kimage_load_normal_segment() local
788 buf = segment->buf; in kimage_load_normal_segment()
824 result = copy_from_user(ptr, buf, uchunk); in kimage_load_normal_segment()
835 buf += mchunk; in kimage_load_normal_segment()
854 unsigned char __user *buf = NULL; in kimage_load_crash_segment() local
861 buf = segment->buf; in kimage_load_crash_segment()
890 result = copy_from_user(ptr, buf, uchunk); in kimage_load_crash_segment()
903 buf += mchunk; in kimage_load_crash_segment()
1073 u32 *buf; in crash_save_cpu() local
1085 buf = (u32 *)per_cpu_ptr(crash_notes, cpu); in crash_save_cpu()
[all …]
/kernel/power/
Dmain.c104 char *buf) in pm_async_show() argument
106 return sprintf(buf, "%d\n", pm_async_enabled); in pm_async_show()
110 const char *buf, size_t n) in pm_async_store() argument
114 if (kstrtoul(buf, 10, &val)) in pm_async_store()
128 char *buf) in mem_sleep_show() argument
130 char *s = buf; in mem_sleep_show()
147 if (s != buf) in mem_sleep_show()
150 return (s - buf); in mem_sleep_show()
153 static suspend_state_t decode_suspend_state(const char *buf, size_t n) in decode_suspend_state() argument
159 p = memchr(buf, '\n', n); in decode_suspend_state()
[all …]
Dhibernate.c1081 char *buf) in disk_show() argument
1084 char *start = buf; in disk_show()
1087 return sprintf(buf, "[disabled]\n"); in disk_show()
1107 buf += sprintf(buf, "[%s] ", hibernation_modes[i]); in disk_show()
1109 buf += sprintf(buf, "%s ", hibernation_modes[i]); in disk_show()
1111 buf += sprintf(buf, "\n"); in disk_show()
1112 return buf-start; in disk_show()
1116 const char *buf, size_t n) in disk_store() argument
1128 p = memchr(buf, '\n', n); in disk_store()
1129 len = p ? p - buf : n; in disk_store()
[all …]
Dwakelock.c38 ssize_t pm_show_wakelocks(char *buf, bool show_active) in pm_show_wakelocks() argument
49 len += sysfs_emit_at(buf, len, "%s ", wl->name); in pm_show_wakelocks()
52 len += sysfs_emit_at(buf, len, "\n"); in pm_show_wakelocks()
203 int pm_wake_lock(const char *buf) in pm_wake_lock() argument
205 const char *str = buf; in pm_wake_lock()
217 len = str - buf; in pm_wake_lock()
230 wl = wakelock_lookup_add(buf, len, true); in pm_wake_lock()
251 int pm_wake_unlock(const char *buf) in pm_wake_unlock() argument
260 len = strlen(buf); in pm_wake_unlock()
264 if (buf[len-1] == '\n') in pm_wake_unlock()
[all …]
/kernel/trace/
Dtrace_boot.c29 char buf[MAX_BUF_LEN]; in trace_boot_set_instance_options() local
34 if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) { in trace_boot_set_instance_options()
39 if (trace_set_options(tr, buf) < 0) in trace_boot_set_instance_options()
40 pr_err("Failed to set option: %s\n", buf); in trace_boot_set_instance_options()
86 char buf[MAX_BUF_LEN]; in trace_boot_enable_events() local
90 if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) { in trace_boot_enable_events()
95 if (ftrace_set_clr_event(tr, buf, 1) < 0) in trace_boot_enable_events()
106 char buf[MAX_BUF_LEN]; in trace_boot_add_kprobe_event() local
111 kprobe_event_cmd_init(&cmd, buf, MAX_BUF_LEN); in trace_boot_add_kprobe_event()
115 pr_err("Failed to generate probe: %s\n", buf); in trace_boot_add_kprobe_event()
[all …]
Dkprobe_event_gen_test.c88 char *buf; in test_gen_kprobe_cmd() local
92 buf = kzalloc(MAX_DYNEVENT_CMD_LEN, GFP_KERNEL); in test_gen_kprobe_cmd()
93 if (!buf) in test_gen_kprobe_cmd()
97 kprobe_event_cmd_init(&cmd, buf, MAX_DYNEVENT_CMD_LEN); in test_gen_kprobe_cmd()
143 kfree(buf); in test_gen_kprobe_cmd()
159 char *buf; in test_gen_kretprobe_cmd() local
163 buf = kzalloc(MAX_DYNEVENT_CMD_LEN, GFP_KERNEL); in test_gen_kretprobe_cmd()
164 if (!buf) in test_gen_kretprobe_cmd()
168 kprobe_event_cmd_init(&cmd, buf, MAX_DYNEVENT_CMD_LEN); in test_gen_kretprobe_cmd()
208 kfree(buf); in test_gen_kretprobe_cmd()
Dtrace_probe_tmpl.h7 fetch_store_raw(unsigned long val, struct fetch_insn *code, void *buf) in fetch_store_raw() argument
11 *(u8 *)buf = (u8)val; in fetch_store_raw()
14 *(u16 *)buf = (u16)val; in fetch_store_raw()
17 *(u32 *)buf = (u32)val; in fetch_store_raw()
21 *(u64 *)buf = (u64)val; in fetch_store_raw()
24 *(unsigned long *)buf = val; in fetch_store_raw()
29 fetch_apply_bitfield(struct fetch_insn *code, void *buf) in fetch_apply_bitfield() argument
33 *(u8 *)buf <<= code->lshift; in fetch_apply_bitfield()
34 *(u8 *)buf >>= code->rshift; in fetch_apply_bitfield()
37 *(u16 *)buf <<= code->lshift; in fetch_apply_bitfield()
[all …]
Dtrace.c180 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); in buffer_ftrace_now()
778 ring_buffer_normalize_time_stamp(buf->buffer, cpu, &ts); in buffer_ftrace_now()
1037 memcpy(&entry->buf, str, size); in __trace_array_puts()
1040 if (entry->buf[size - 1] != '\n') { in __trace_array_puts()
1041 entry->buf[size] = '\n'; in __trace_array_puts()
1042 entry->buf[size + 1] = '\0'; in __trace_array_puts()
1044 entry->buf[size] = '\0'; in __trace_array_puts()
[all …]
Dsynth_event_gen_test.c49 char *buf; in test_gen_synth_cmd() local
53 buf = kzalloc(MAX_DYNEVENT_CMD_LEN, GFP_KERNEL); in test_gen_synth_cmd()
54 if (!buf) in test_gen_synth_cmd()
58 synth_event_cmd_init(&cmd, buf, MAX_DYNEVENT_CMD_LEN); in test_gen_synth_cmd()
124 kfree(buf); in test_gen_synth_cmd()
140 char *buf; in test_empty_synth_event() local
144 buf = kzalloc(MAX_DYNEVENT_CMD_LEN, GFP_KERNEL); in test_empty_synth_event()
145 if (!buf) in test_empty_synth_event()
149 synth_event_cmd_init(&cmd, buf, MAX_DYNEVENT_CMD_LEN); in test_empty_synth_event()
229 kfree(buf); in test_empty_synth_event()
Dblktrace.c154 char *buf; in __blk_trace_note_message() local
169 buf = this_cpu_ptr(bt->msg_data); in __blk_trace_note_message()
171 n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); in __blk_trace_note_message()
180 trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n, cgid); in __blk_trace_note_message()
418 char buf[16]; in blk_dropped_read() local
420 snprintf(buf, sizeof(buf), "%u\n", atomic_read(&bt->dropped)); in blk_dropped_read()
422 return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf)); in blk_dropped_read()
463 static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf, in blk_subbuf_start_callback() argument
468 if (!relay_buf_full(buf)) in blk_subbuf_start_callback()
471 bt = buf->chan->private_data; in blk_subbuf_start_callback()
[all …]
/kernel/module/
Ddecompress.c63 static size_t module_gzip_header_len(const u8 *buf, size_t size) in module_gzip_header_len() argument
68 if (size < len || memcmp(buf, signature, sizeof(signature))) in module_gzip_header_len()
71 if (buf[3] & 0x08) { in module_gzip_header_len()
79 } while (buf[len++] != '\0'); in module_gzip_header_len()
86 const void *buf, size_t size) in module_gzip_decompress() argument
94 gzip_hdr_len = module_gzip_header_len(buf, size); in module_gzip_decompress()
100 s.next_in = buf + gzip_hdr_len; in module_gzip_decompress()
150 const void *buf, size_t size) in module_xz_decompress() argument
160 memcmp(buf, signature, sizeof(signature))) { in module_xz_decompress()
170 xz_buf.in = buf; in module_xz_decompress()
[all …]
Dtracking.c51 char buf[MODULE_FLAGS_BUF_SIZE]; in print_unloaded_tainted_modules() local
59 l = module_flags_taint(mod_taint->taints, buf); in print_unloaded_tainted_modules()
60 buf[l++] = '\0'; in print_unloaded_tainted_modules()
61 pr_cont(" %s(%s):%llu", mod_taint->name, buf, in print_unloaded_tainted_modules()
89 char buf[MODULE_FLAGS_BUF_SIZE]; in unloaded_tainted_modules_seq_show() local
93 l = module_flags_taint(mod_taint->taints, buf); in unloaded_tainted_modules_seq_show()
94 buf[l++] = '\0'; in unloaded_tainted_modules_seq_show()
96 seq_printf(m, "%s (%s) %llu", mod_taint->name, buf, mod_taint->count); in unloaded_tainted_modules_seq_show()
/kernel/printk/
Dprintk.c555 static ssize_t info_print_ext_header(char *buf, size_t size, in info_print_ext_header() argument
571 return scnprintf(buf, size, "%u,%llu,%llu,%c%s;", in info_print_ext_header()
576 static ssize_t msg_add_ext_text(char *buf, size_t size, in msg_add_ext_text() argument
580 char *p = buf, *e = buf + size; in msg_add_ext_text()
594 return p - buf; in msg_add_ext_text()
597 static ssize_t msg_add_dict_text(char *buf, size_t size, in msg_add_dict_text() argument
606 len = msg_add_ext_text(buf, size, "", 0, ' '); /* dict prefix */ in msg_add_dict_text()
607 len += msg_add_ext_text(buf + len, size - len, key, strlen(key), '='); in msg_add_dict_text()
608 len += msg_add_ext_text(buf + len, size - len, val, val_len, '\n'); in msg_add_dict_text()
613 static ssize_t msg_print_ext_body(char *buf, size_t size, in msg_print_ext_body() argument
[all …]
/kernel/rcu/
Drefscale.c626 char *buf; in process_durations() local
629 buf = kmalloc(800 + 64, GFP_KERNEL); in process_durations()
630 if (!buf) in process_durations()
632 buf[0] = 0; in process_durations()
633 sprintf(buf, "Experiment #%d (Format: <THREAD-NUM>:<Total loop time in ns>)", in process_durations()
641 strcat(buf, "\n"); in process_durations()
642 if (strlen(buf) >= 800) { in process_durations()
643 pr_alert("%s", buf); in process_durations()
644 buf[0] = 0; in process_durations()
646 strcat(buf, buf1); in process_durations()
[all …]
/kernel/kcsan/
Dreport.c201 char buf[64]; in skip_report() local
202 int len = scnprintf(buf, sizeof(buf), "%ps", (void *)top_frame); in skip_report()
204 if (!strnstr(buf, "rcu_", len) && in skip_report()
205 !strnstr(buf, "_rcu", len) && in skip_report()
206 !strnstr(buf, "_srcu", len)) in skip_report()
268 static char buf[32]; /* safe: protected by report_lock */ in get_thread_desc() local
270 snprintf(buf, sizeof(buf), "task %i", task_id); in get_thread_desc()
271 return buf; in get_thread_desc()
279 char buf[64]; in get_stack_skipnr() local
284 len = scnprintf(buf, sizeof(buf), "%ps", (void *)stack_entries[skip]); in get_stack_skipnr()
[all …]
/kernel/sched/
Ddebug.c129 char buf[64]; in sched_feat_write() local
137 if (copy_from_user(&buf, ubuf, cnt)) in sched_feat_write()
140 buf[cnt] = 0; in sched_feat_write()
141 cmp = strstrip(buf); in sched_feat_write()
176 char buf[16]; in sched_scaling_write() local
182 if (copy_from_user(&buf, ubuf, cnt)) in sched_scaling_write()
184 buf[cnt] = '\0'; in sched_scaling_write()
186 if (kstrtouint(buf, 10, &scaling)) in sched_scaling_write()
226 char buf[16]; in sched_dynamic_write() local
232 if (copy_from_user(&buf, ubuf, cnt)) in sched_dynamic_write()
[all …]
/kernel/locking/
Dqspinlock_stat.h39 char buf[64]; in lockevent_read() local
80 len = snprintf(buf, sizeof(buf) - 1, "%llu.%02llu\n", in lockevent_read()
91 len = snprintf(buf, sizeof(buf) - 1, "%llu\n", sum); in lockevent_read()
94 return simple_read_from_buffer(user_buf, count, ppos, buf, len); in lockevent_read()
/kernel/irq/
Dirqdesc.c147 struct kobj_attribute *attr, char *buf) in per_cpu_count_show() argument
157 ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%u", p, c); in per_cpu_count_show()
161 ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n"); in per_cpu_count_show()
167 struct kobj_attribute *attr, char *buf) in chip_name_show() argument
174 ret = scnprintf(buf, PAGE_SIZE, "%s\n", in chip_name_show()
184 struct kobj_attribute *attr, char *buf) in hwirq_show() argument
191 ret = sprintf(buf, "%lu\n", desc->irq_data.hwirq); in hwirq_show()
199 struct kobj_attribute *attr, char *buf) in type_show() argument
205 ret = sprintf(buf, "%s\n", in type_show()
215 struct kobj_attribute *attr, char *buf) in wakeup_show() argument
[all …]

123456