/kernel/ |
D | relay.c | 35 struct rchan_buf *buf = vma->vm_private_data; in relay_file_mmap_close() local 36 buf->chan->cb->buf_unmapped(buf, vma->vm_file); in relay_file_mmap_close() 45 struct rchan_buf *buf = vmf->vma->vm_private_data; in relay_buf_fault() local 48 if (!buf) in relay_buf_fault() 51 page = vmalloc_to_page(buf->start + (pgoff << PAGE_SHIFT)); in relay_buf_fault() 96 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) in relay_mmap_buf() argument 101 if (!buf) in relay_mmap_buf() 104 if (length != (unsigned long)buf->chan->alloc_size) in relay_mmap_buf() 109 vma->vm_private_data = buf; in relay_mmap_buf() 110 buf->chan->cb->buf_mapped(buf, filp); in relay_mmap_buf() [all …]
|
D | ksysfs.c | 32 struct kobj_attribute *attr, char *buf) in uevent_seqnum_show() argument 34 return sprintf(buf, "%llu\n", (unsigned long long)uevent_seqnum); in uevent_seqnum_show() 41 struct kobj_attribute *attr, char *buf) in uevent_helper_show() argument 43 return sprintf(buf, "%s\n", uevent_helper); in uevent_helper_show() 47 const char *buf, size_t count) in uevent_helper_store() argument 51 memcpy(uevent_helper, buf, count); in uevent_helper_store() 62 struct kobj_attribute *attr, char *buf) in profiling_show() argument 64 return sprintf(buf, "%d\n", prof_on); in profiling_show() 68 const char *buf, size_t count) in profiling_store() argument 79 profile_setup((char *)buf); in profiling_store() [all …]
|
D | crash_core.c | 297 Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type, in append_elf_note() argument 300 struct elf_note *note = (struct elf_note *)buf; in append_elf_note() 305 buf += DIV_ROUND_UP(sizeof(*note), sizeof(Elf_Word)); in append_elf_note() 306 memcpy(buf, name, note->n_namesz); in append_elf_note() 307 buf += DIV_ROUND_UP(note->n_namesz, sizeof(Elf_Word)); in append_elf_note() 308 memcpy(buf, data, data_len); in append_elf_note() 309 buf += DIV_ROUND_UP(data_len, sizeof(Elf_Word)); in append_elf_note() 311 return buf; in append_elf_note() 314 void final_note(Elf_Word *buf) in final_note() argument 316 memset(buf, 0, sizeof(struct elf_note)); in final_note() [all …]
|
D | panic.c | 246 static char buf[1024]; in panic() local 296 len = vscnprintf(buf, sizeof(buf), fmt, args); in panic() 299 if (len && buf[len - 1] == '\n') in panic() 300 buf[len - 1] = '\0'; in panic() 302 pr_emerg("Kernel panic - not syncing: %s\n", buf); in panic() 316 kgdb_panic(buf); in panic() 349 atomic_notifier_call_chain(&panic_notifier_list, 0, buf); in panic() 426 pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf); in panic() 478 static char buf[TAINT_FLAGS_COUNT + sizeof("Tainted: ")]; in print_tainted() local 486 s = buf + sprintf(buf, "Tainted: "); in print_tainted() [all …]
|
D | kexec_elf.c | 119 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 …]
|
D | watch_queue.c | 59 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 131 buf = &pipe->bufs[head & mask]; in post_one_notification() 132 buf->page = page; in post_one_notification() 133 buf->private = (unsigned long)wqueue; in post_one_notification() 134 buf->ops = &watch_queue_pipe_buf_ops; in post_one_notification() [all …]
|
D | kexec_core.c | 787 unsigned char __user *buf = NULL; in kimage_load_normal_segment() local 794 buf = segment->buf; in kimage_load_normal_segment() 830 result = copy_from_user(ptr, buf, uchunk); in kimage_load_normal_segment() 841 buf += mchunk; in kimage_load_normal_segment() 860 unsigned char __user *buf = NULL; in kimage_load_crash_segment() local 867 buf = segment->buf; in kimage_load_crash_segment() 896 result = copy_from_user(ptr, buf, uchunk); in kimage_load_crash_segment() 909 buf += mchunk; in kimage_load_crash_segment() 1067 u32 *buf; in crash_save_cpu() local 1079 buf = (u32 *)per_cpu_ptr(crash_notes, cpu); in crash_save_cpu() [all …]
|
/kernel/power/ |
D | main.c | 101 char *buf) in pm_async_show() argument 103 return sprintf(buf, "%d\n", pm_async_enabled); in pm_async_show() 107 const char *buf, size_t n) in pm_async_store() argument 111 if (kstrtoul(buf, 10, &val)) in pm_async_store() 125 char *buf) in mem_sleep_show() argument 127 char *s = buf; in mem_sleep_show() 141 if (s != buf) in mem_sleep_show() 144 return (s - buf); in mem_sleep_show() 147 static suspend_state_t decode_suspend_state(const char *buf, size_t n) in decode_suspend_state() argument 153 p = memchr(buf, '\n', n); in decode_suspend_state() [all …]
|
D | hibernate.c | 1060 char *buf) in disk_show() argument 1063 char *start = buf; in disk_show() 1066 return sprintf(buf, "[disabled]\n"); in disk_show() 1086 buf += sprintf(buf, "[%s] ", hibernation_modes[i]); in disk_show() 1088 buf += sprintf(buf, "%s ", hibernation_modes[i]); in disk_show() 1090 buf += sprintf(buf, "\n"); in disk_show() 1091 return buf-start; in disk_show() 1095 const char *buf, size_t n) in disk_store() argument 1106 p = memchr(buf, '\n', n); in disk_store() 1107 len = p ? p - buf : n; in disk_store() [all …]
|
D | wakelock.c | 38 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/ |
D | trace_boot.c | 29 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 …]
|
D | trace_probe_tmpl.h | 7 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 …]
|
D | kprobe_event_gen_test.c | 88 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()
|
D | bpf_trace.c | 360 static void bpf_trace_copy_string(char *buf, void *unsafe_ptr, char fmt_ptype, in bpf_trace_copy_string() argument 365 buf[0] = 0; in bpf_trace_copy_string() 371 strncpy_from_user_nofault(buf, user_ptr, bufsz); in bpf_trace_copy_string() 377 strncpy_from_kernel_nofault(buf, unsafe_ptr, bufsz); in bpf_trace_copy_string() 380 strncpy_from_user_nofault(buf, user_ptr, bufsz); in bpf_trace_copy_string() 391 static char buf[BPF_TRACE_PRINTK_SIZE]; in bpf_do_trace_printk() local 398 ret = vsnprintf(buf, sizeof(buf), fmt, ap); in bpf_do_trace_printk() 402 buf[0] = '\0'; in bpf_do_trace_printk() 403 trace_bpf_trace_printk(buf); in bpf_do_trace_printk() 417 char buf[64], fmt_ptype; in BPF_CALL_5() local [all …]
|
D | synth_event_gen_test.c | 49 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()
|
D | trace.c | 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() [all …]
|
D | blktrace.c | 154 char *buf; in __trace_note_message() local 168 buf = this_cpu_ptr(bt->msg_data); in __trace_note_message() 170 n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); in __trace_note_message() 176 trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n, in __trace_note_message() 179 trace_note(bt, current->pid, BLK_TN_MESSAGE, buf, n, 0); in __trace_note_message() 377 char buf[16]; in blk_dropped_read() local 379 snprintf(buf, sizeof(buf), "%u\n", atomic_read(&bt->dropped)); in blk_dropped_read() 381 return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf)); in blk_dropped_read() 422 static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf, in blk_subbuf_start_callback() argument 427 if (!relay_buf_full(buf)) in blk_subbuf_start_callback() [all …]
|
D | trace_events_inject.c | 286 char *buf; in event_inject_write() local 291 buf = memdup_user_nul(ubuf, cnt); in event_inject_write() 292 if (IS_ERR(buf)) in event_inject_write() 293 return PTR_ERR(buf); in event_inject_write() 294 strim(buf); in event_inject_write() 300 size = parse_entry(buf, call, &entry); in event_inject_write() 309 kfree(buf); in event_inject_write() 319 event_inject_read(struct file *file, char __user *buf, size_t size, in event_inject_read() argument
|
/kernel/printk/ |
D | printk.c | 598 static ssize_t info_print_ext_header(char *buf, size_t size, in info_print_ext_header() argument 614 return scnprintf(buf, size, "%u,%llu,%llu,%c%s;", in info_print_ext_header() 619 static ssize_t msg_add_ext_text(char *buf, size_t size, in msg_add_ext_text() argument 623 char *p = buf, *e = buf + size; in msg_add_ext_text() 637 return p - buf; in msg_add_ext_text() 640 static ssize_t msg_add_dict_text(char *buf, size_t size, in msg_add_dict_text() argument 649 len = msg_add_ext_text(buf, size, "", 0, ' '); /* dict prefix */ in msg_add_dict_text() 650 len += msg_add_ext_text(buf + len, size - len, key, strlen(key), '='); in msg_add_dict_text() 651 len += msg_add_ext_text(buf + len, size - len, val, val_len, '\n'); in msg_add_dict_text() 656 static ssize_t msg_print_ext_body(char *buf, size_t size, in msg_print_ext_body() argument [all …]
|
/kernel/kcsan/ |
D | report.c | 194 char buf[64]; in skip_report() local 195 int len = scnprintf(buf, sizeof(buf), "%ps", (void *)top_frame); in skip_report() 197 if (!strnstr(buf, "rcu_", len) && in skip_report() 198 !strnstr(buf, "_rcu", len) && in skip_report() 199 !strnstr(buf, "_srcu", len)) in skip_report() 257 static char buf[32]; /* safe: protected by report_lock */ in get_thread_desc() local 259 snprintf(buf, sizeof(buf), "task %i", task_id); in get_thread_desc() 260 return buf; in get_thread_desc() 268 char buf[64]; in get_stack_skipnr() local 273 len = scnprintf(buf, sizeof(buf), "%ps", (void *)stack_entries[skip]); in get_stack_skipnr() [all …]
|
/kernel/rcu/ |
D | refscale.c | 452 char *buf; in process_durations() local 455 buf = kmalloc(128 + nreaders * 32, GFP_KERNEL); in process_durations() 456 if (!buf) in process_durations() 458 buf[0] = 0; in process_durations() 459 sprintf(buf, "Experiment #%d (Format: <THREAD-NUM>:<Total loop time in ns>)", in process_durations() 467 strcat(buf, "\n"); in process_durations() 468 strcat(buf, buf1); in process_durations() 472 strcat(buf, "\n"); in process_durations() 474 SCALEOUT("%s\n", buf); in process_durations() 476 kfree(buf); in process_durations() [all …]
|
/kernel/bpf/ |
D | helpers.c | 207 BPF_CALL_2(bpf_get_current_comm, char *, buf, u32, size) in BPF_CALL_2() argument 214 strncpy(buf, task->comm, size); in BPF_CALL_2() 220 buf[size - 1] = 0; in BPF_CALL_2() 223 memset(buf, 0, size); in BPF_CALL_2() 398 ptr = &READ_ONCE(storage->buf)->data[0]; in BPF_CALL_2() 416 static int __bpf_strtoull(const char *buf, size_t buf_len, u64 flags, in __bpf_strtoull() argument 420 const char *cur_buf = buf; in __bpf_strtoull() 426 if (!buf || !buf_len || !res || !is_negative) in __bpf_strtoull() 435 while (cur_buf < buf + buf_len && isspace(*cur_buf)) in __bpf_strtoull() 438 *is_negative = (cur_buf < buf + buf_len && *cur_buf == '-'); in __bpf_strtoull() [all …]
|
/kernel/locking/ |
D | qspinlock_stat.h | 39 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/sched/ |
D | debug.c | 130 char buf[64]; in sched_feat_write() local 138 if (copy_from_user(&buf, ubuf, cnt)) in sched_feat_write() 141 buf[cnt] = 0; in sched_feat_write() 142 cmp = strstrip(buf); in sched_feat_write() 254 char *tmp, *buf; in sd_ctl_doflags() local 272 buf = kcalloc(data_size + 1, sizeof(*buf), GFP_KERNEL); in sd_ctl_doflags() 273 if (!buf) in sd_ctl_doflags() 279 len += snprintf(buf + len, strlen(name) + 2, "%s ", name); in sd_ctl_doflags() 282 tmp = buf + *ppos; in sd_ctl_doflags() 297 kfree(buf); in sd_ctl_doflags() [all …]
|
/kernel/irq/ |
D | irqdesc.c | 147 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, "%d\n", (int)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 …]
|