/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 | 295 Elf_Word *append_elf_note(Elf_Word *buf, char *name, unsigned int type, in append_elf_note() argument 298 struct elf_note *note = (struct elf_note *)buf; in append_elf_note() 303 buf += DIV_ROUND_UP(sizeof(*note), sizeof(Elf_Word)); in append_elf_note() 304 memcpy(buf, name, note->n_namesz); in append_elf_note() 305 buf += DIV_ROUND_UP(note->n_namesz, sizeof(Elf_Word)); in append_elf_note() 306 memcpy(buf, data, data_len); in append_elf_note() 307 buf += DIV_ROUND_UP(data_len, sizeof(Elf_Word)); in append_elf_note() 309 return buf; in append_elf_note() 312 void final_note(Elf_Word *buf) in final_note() argument 314 memset(buf, 0, sizeof(struct elf_note)); in final_note() [all …]
|
D | panic.c | 169 static char buf[1024]; in panic() local 209 len = vscnprintf(buf, sizeof(buf), fmt, args); in panic() 212 if (len && buf[len - 1] == '\n') in panic() 213 buf[len - 1] = '\0'; in panic() 215 pr_emerg("Kernel panic - not syncing: %s\n", buf); in panic() 229 kgdb_panic(buf); in panic() 262 atomic_notifier_call_chain(&panic_notifier_list, 0, buf); in panic() 339 pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf); in panic() 391 static char buf[TAINT_FLAGS_COUNT + sizeof("Tainted: ")]; in print_tainted() local 399 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 | kexec_core.c | 781 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() 1058 u32 *buf; in crash_save_cpu() local 1070 buf = (u32 *)per_cpu_ptr(crash_notes, cpu); in crash_save_cpu() [all …]
|
D | fail_function.c | 244 char *buf, *sym; in fei_write() local 250 buf = kmalloc(count + 1, GFP_KERNEL); in fei_write() 251 if (!buf) in fei_write() 254 if (copy_from_user(buf, buffer, count)) { in fei_write() 258 buf[count] = '\0'; in fei_write() 259 sym = strstrip(buf); in fei_write() 310 kfree(buf); in fei_write()
|
D | cpu.c | 1993 struct device_attribute *attr, char *buf) in show_cpuhp_state() argument 1997 return sprintf(buf, "%d\n", st->state); in show_cpuhp_state() 2003 const char *buf, size_t count) in write_cpuhp_target() argument 2009 ret = kstrtoint(buf, 10, &target); in write_cpuhp_target() 2042 struct device_attribute *attr, char *buf) in show_cpuhp_target() argument 2046 return sprintf(buf, "%d\n", st->target); in show_cpuhp_target() 2053 const char *buf, size_t count) in write_cpuhp_fail() argument 2059 ret = kstrtoint(buf, 10, &fail); in write_cpuhp_fail() 2089 struct device_attribute *attr, char *buf) in show_cpuhp_fail() argument 2093 return sprintf(buf, "%d\n", st->fail); in show_cpuhp_fail() [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 | 958 char *buf) in disk_show() argument 961 char *start = buf; in disk_show() 964 return sprintf(buf, "[disabled]\n"); in disk_show() 984 buf += sprintf(buf, "[%s] ", hibernation_modes[i]); in disk_show() 986 buf += sprintf(buf, "%s ", hibernation_modes[i]); in disk_show() 988 buf += sprintf(buf, "\n"); in disk_show() 989 return buf-start; in disk_show() 993 const char *buf, size_t n) in disk_store() argument 1004 p = memchr(buf, '\n', n); in disk_store() 1005 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 42 char *str = buf; in pm_show_wakelocks() 43 char *end = buf + PAGE_SIZE; in pm_show_wakelocks() 52 if (str > buf) in pm_show_wakelocks() 58 return (str - buf); in pm_show_wakelocks() 206 int pm_wake_lock(const char *buf) in pm_wake_lock() argument 208 const char *str = buf; in pm_wake_lock() 220 len = str - buf; in pm_wake_lock() 233 wl = wakelock_lookup_add(buf, len, true); in pm_wake_lock() 254 int pm_wake_unlock(const char *buf) in pm_wake_unlock() argument [all …]
|
D | wakeup_reason.c | 45 char *buf) in last_resume_reason_show() argument 52 buf_offset = sprintf(buf, "Abort: %s", abort_reason); in last_resume_reason_show() 57 buf_offset += sprintf(buf + buf_offset, "%d %s\n", in last_resume_reason_show() 60 buf_offset += sprintf(buf + buf_offset, "%d\n", in last_resume_reason_show() 69 struct kobj_attribute *attr, char *buf) in last_suspend_time_show() argument 92 return sprintf(buf, "%llu.%09lu %llu.%09lu\n", in last_suspend_time_show()
|
/kernel/printk/ |
D | printk.c | 714 static ssize_t msg_print_ext_header(char *buf, size_t size, in msg_print_ext_header() argument 730 return scnprintf(buf, size, "%u,%llu,%llu,%c%s;", in msg_print_ext_header() 735 static ssize_t msg_print_ext_body(char *buf, size_t size, in msg_print_ext_body() argument 739 char *p = buf, *e = buf + size; in msg_print_ext_body() 780 return p - buf; in msg_print_ext_body() 789 char buf[CONSOLE_EXT_LOG_MAX]; member 807 char *buf, *line; in devkmsg_write() local 828 buf = kmalloc(len+1, GFP_KERNEL); in devkmsg_write() 829 if (buf == NULL) in devkmsg_write() 832 buf[len] = '\0'; in devkmsg_write() [all …]
|
/kernel/trace/ |
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 | trace.c | 162 static int tracing_set_tracer(struct trace_array *tr, const char *buf); 591 static u64 buffer_ftrace_now(struct trace_buffer *buf, int cpu) in buffer_ftrace_now() argument 596 if (!buf->buffer) in buffer_ftrace_now() 599 ts = ring_buffer_time_stamp(buf->buffer, cpu); in buffer_ftrace_now() 600 ring_buffer_normalize_time_stamp(buf->buffer, cpu, &ts); in buffer_ftrace_now() 862 memcpy(&entry->buf, str, size); in __trace_puts() 865 if (entry->buf[size - 1] != '\n') { in __trace_puts() 866 entry->buf[size] = '\n'; in __trace_puts() 867 entry->buf[size + 1] = '\0'; in __trace_puts() 869 entry->buf[size] = '\0'; in __trace_puts() [all …]
|
D | blktrace.c | 152 char *buf; in __trace_note_message() local 166 buf = this_cpu_ptr(bt->msg_data); in __trace_note_message() 168 n = vscnprintf(buf, BLK_TN_MAX_MSG, fmt, args); in __trace_note_message() 174 trace_note(bt, 0, BLK_TN_MESSAGE, buf, n, in __trace_note_message() 177 trace_note(bt, 0, BLK_TN_MESSAGE, buf, n, NULL); in __trace_note_message() 373 char buf[16]; in blk_dropped_read() local 375 snprintf(buf, sizeof(buf), "%u\n", atomic_read(&bt->dropped)); in blk_dropped_read() 377 return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf)); in blk_dropped_read() 418 static int blk_subbuf_start_callback(struct rchan_buf *buf, void *subbuf, in blk_subbuf_start_callback() argument 423 if (!relay_buf_full(buf)) in blk_subbuf_start_callback() [all …]
|
D | bpf_trace.c | 221 char buf[64]; in BPF_CALL_5() local 265 arg1 = (long) buf; in BPF_CALL_5() 269 arg2 = (long) buf; in BPF_CALL_5() 273 arg3 = (long) buf; in BPF_CALL_5() 276 buf[0] = 0; in BPF_CALL_5() 277 strncpy_from_unsafe(buf, in BPF_CALL_5() 279 sizeof(buf)); in BPF_CALL_5() 393 struct bpf_perf_event_value *, buf, u32, size) in BPF_CALL_4() argument 399 err = get_map_perf_counter(map, flags, &buf->counter, &buf->enabled, in BPF_CALL_4() 400 &buf->running); in BPF_CALL_4() [all …]
|
D | trace_probe.c | 230 char *buf, int offset) in traceprobe_parse_event_name() argument 245 strlcpy(buf, event, slash - event + 1); in traceprobe_parse_event_name() 246 if (!is_good_name(buf)) { in traceprobe_parse_event_name() 250 *pgroup = buf; in traceprobe_parse_event_name() 841 static int __set_print_fmt(struct trace_probe *tp, char *buf, int len, in __set_print_fmt() argument 857 pos += snprintf(buf + pos, LEN_OR_ZERO, "\"%s", fmt); in __set_print_fmt() 861 pos += snprintf(buf + pos, LEN_OR_ZERO, " %s=", parg->name); in __set_print_fmt() 863 pos += snprintf(buf + pos, LEN_OR_ZERO, "{%s", in __set_print_fmt() 866 pos += snprintf(buf + pos, LEN_OR_ZERO, ",%s", in __set_print_fmt() 868 pos += snprintf(buf + pos, LEN_OR_ZERO, "}"); in __set_print_fmt() [all …]
|
/kernel/bpf/ |
D | helpers.c | 191 BPF_CALL_2(bpf_get_current_comm, char *, buf, u32, size) in BPF_CALL_2() argument 198 strncpy(buf, task->comm, size); in BPF_CALL_2() 204 buf[size - 1] = 0; in BPF_CALL_2() 207 memset(buf, 0, size); in BPF_CALL_2() 346 ptr = &READ_ONCE(storage->buf)->data[0]; in BPF_CALL_2() 364 static int __bpf_strtoull(const char *buf, size_t buf_len, u64 flags, in __bpf_strtoull() argument 368 const char *cur_buf = buf; in __bpf_strtoull() 374 if (!buf || !buf_len || !res || !is_negative) in __bpf_strtoull() 383 while (cur_buf < buf + buf_len && isspace(*cur_buf)) in __bpf_strtoull() 386 *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()
|
D | lock_events.c | 64 char buf[64]; in lockevent_read() local 78 len = snprintf(buf, sizeof(buf) - 1, "%llu\n", sum); in lockevent_read() 80 return simple_read_from_buffer(user_buf, count, ppos, buf, len); in lockevent_read()
|
/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 …]
|
/kernel/debug/ |
D | gdbstub.c | 239 char *kgdb_mem2hex(char *mem, char *buf, int count) in kgdb_mem2hex() argument 248 tmp = buf + count; in kgdb_mem2hex() 254 buf = hex_byte_pack(buf, *tmp); in kgdb_mem2hex() 258 *buf = 0; in kgdb_mem2hex() 260 return buf; in kgdb_mem2hex() 268 int kgdb_hex2mem(char *buf, char *mem, int count) in kgdb_hex2mem() argument 277 tmp_raw = buf + count * 2; in kgdb_hex2mem() 280 while (tmp_hex >= buf) { in kgdb_hex2mem() 326 static int kgdb_ebin2mem(char *buf, char *mem, int count) in kgdb_ebin2mem() argument 329 char *c = buf; in kgdb_ebin2mem() [all …]
|
/kernel/debug/kdb/ |
D | kdb_bt.c | 166 char buf[80]; in kdb_bt() local 182 sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); in kdb_bt() 183 kdb_parse(buf); in kdb_bt() 198 sprintf(buf, "btt 0x%px\n", kdb_tsk); in kdb_bt() 199 kdb_parse(buf); in kdb_bt()
|
/kernel/cgroup/ |
D | cgroup.c | 1469 char *buf) in cgroup_file_name() argument 1477 snprintf(buf, CGROUP_FILE_NAME_MAX, "%s%s.%s", in cgroup_file_name() 1481 strscpy(buf, cft->name, CGROUP_FILE_NAME_MAX); in cgroup_file_name() 1483 return buf; in cgroup_file_name() 1793 char *buf = NULL; in cgroup_show_path() local 1797 buf = kmalloc(PATH_MAX, GFP_KERNEL); in cgroup_show_path() 1798 if (!buf) in cgroup_show_path() 1803 len = kernfs_path_from_node(kf_node, ns_cgroup->kn, buf, PATH_MAX); in cgroup_show_path() 1809 seq_escape(sf, buf, " \t\n\\"); in cgroup_show_path() 1812 kfree(buf); in cgroup_show_path() [all …]
|