Lines Matching refs:kbuf
38 char *kbuf; in user_input_str() local
45 kbuf = kmalloc(count + 1, GFP_KERNEL | __GFP_NOWARN); in user_input_str()
46 if (!kbuf) in user_input_str()
49 ret = simple_write_to_buffer(kbuf, count + 1, ppos, buf, count); in user_input_str()
51 kfree(kbuf); in user_input_str()
54 kbuf[ret] = '\0'; in user_input_str()
56 return kbuf; in user_input_str()
63 char kbuf[128]; in dbgfs_attrs_read() local
67 ret = scnprintf(kbuf, ARRAY_SIZE(kbuf), "%lu %lu %lu %lu %lu\n", in dbgfs_attrs_read()
73 return simple_read_from_buffer(buf, count, ppos, kbuf, ret); in dbgfs_attrs_read()
81 char *kbuf; in dbgfs_attrs_write() local
84 kbuf = user_input_str(buf, count, ppos); in dbgfs_attrs_write()
85 if (IS_ERR(kbuf)) in dbgfs_attrs_write()
86 return PTR_ERR(kbuf); in dbgfs_attrs_write()
88 if (sscanf(kbuf, "%lu %lu %lu %lu %lu", in dbgfs_attrs_write()
109 kfree(kbuf); in dbgfs_attrs_write()
176 char *kbuf; in dbgfs_schemes_read() local
179 kbuf = kmalloc(count, GFP_KERNEL | __GFP_NOWARN); in dbgfs_schemes_read()
180 if (!kbuf) in dbgfs_schemes_read()
184 len = sprint_schemes(ctx, kbuf, count); in dbgfs_schemes_read()
188 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_schemes_read()
191 kfree(kbuf); in dbgfs_schemes_read()
301 char *kbuf; in dbgfs_schemes_write() local
305 kbuf = user_input_str(buf, count, ppos); in dbgfs_schemes_write()
306 if (IS_ERR(kbuf)) in dbgfs_schemes_write()
307 return PTR_ERR(kbuf); in dbgfs_schemes_write()
309 schemes = str_to_schemes(kbuf, count, &nr_schemes); in dbgfs_schemes_write()
329 kfree(kbuf); in dbgfs_schemes_write()
495 char *kbuf; in dbgfs_target_ids_write() local
500 kbuf = user_input_str(buf, count, ppos); in dbgfs_target_ids_write()
501 if (IS_ERR(kbuf)) in dbgfs_target_ids_write()
502 return PTR_ERR(kbuf); in dbgfs_target_ids_write()
504 if (!strncmp(kbuf, "paddr\n", count)) { in dbgfs_target_ids_write()
510 target_pids = str_to_pids(kbuf, count, &nr_targets); in dbgfs_target_ids_write()
548 kfree(kbuf); in dbgfs_target_ids_write()
578 char *kbuf; in dbgfs_init_regions_read() local
581 kbuf = kmalloc(count, GFP_KERNEL | __GFP_NOWARN); in dbgfs_init_regions_read()
582 if (!kbuf) in dbgfs_init_regions_read()
592 len = sprint_init_regions(ctx, kbuf, count); in dbgfs_init_regions_read()
596 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_init_regions_read()
599 kfree(kbuf); in dbgfs_init_regions_read()
673 char *kbuf; in dbgfs_init_regions_write() local
677 kbuf = user_input_str(buf, count, ppos); in dbgfs_init_regions_write()
678 if (IS_ERR(kbuf)) in dbgfs_init_regions_write()
679 return PTR_ERR(kbuf); in dbgfs_init_regions_write()
687 err = set_init_regions(ctx, kbuf, ret); in dbgfs_init_regions_write()
693 kfree(kbuf); in dbgfs_init_regions_write()
701 char *kbuf; in dbgfs_kdamond_pid_read() local
704 kbuf = kmalloc(count, GFP_KERNEL | __GFP_NOWARN); in dbgfs_kdamond_pid_read()
705 if (!kbuf) in dbgfs_kdamond_pid_read()
710 len = scnprintf(kbuf, count, "%d\n", ctx->kdamond->pid); in dbgfs_kdamond_pid_read()
712 len = scnprintf(kbuf, count, "none\n"); in dbgfs_kdamond_pid_read()
716 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_kdamond_pid_read()
719 kfree(kbuf); in dbgfs_kdamond_pid_read()
813 static const char kbuf[512] = DAMON_DBGFS_DEPRECATION_NOTICE; in damon_dbgfs_deprecated_read() local
815 return simple_read_from_buffer(buf, count, ppos, kbuf, strlen(kbuf)); in damon_dbgfs_deprecated_read()
873 char *kbuf; in dbgfs_mk_context_write() local
877 kbuf = user_input_str(buf, count, ppos); in dbgfs_mk_context_write()
878 if (IS_ERR(kbuf)) in dbgfs_mk_context_write()
879 return PTR_ERR(kbuf); in dbgfs_mk_context_write()
882 kfree(kbuf); in dbgfs_mk_context_write()
887 if (sscanf(kbuf, "%s", ctx_name) != 1) { in dbgfs_mk_context_write()
899 kfree(kbuf); in dbgfs_mk_context_write()
979 char *kbuf; in dbgfs_rm_context_write() local
983 kbuf = user_input_str(buf, count, ppos); in dbgfs_rm_context_write()
984 if (IS_ERR(kbuf)) in dbgfs_rm_context_write()
985 return PTR_ERR(kbuf); in dbgfs_rm_context_write()
988 kfree(kbuf); in dbgfs_rm_context_write()
993 if (sscanf(kbuf, "%s", ctx_name) != 1) { in dbgfs_rm_context_write()
1005 kfree(kbuf); in dbgfs_rm_context_write()
1026 char *kbuf; in dbgfs_monitor_on_write() local
1028 kbuf = user_input_str(buf, count, ppos); in dbgfs_monitor_on_write()
1029 if (IS_ERR(kbuf)) in dbgfs_monitor_on_write()
1030 return PTR_ERR(kbuf); in dbgfs_monitor_on_write()
1033 if (sscanf(kbuf, "%s", kbuf) != 1) { in dbgfs_monitor_on_write()
1034 kfree(kbuf); in dbgfs_monitor_on_write()
1039 if (!strncmp(kbuf, "on", count)) { in dbgfs_monitor_on_write()
1044 kfree(kbuf); in dbgfs_monitor_on_write()
1050 } else if (!strncmp(kbuf, "off", count)) { in dbgfs_monitor_on_write()
1059 kfree(kbuf); in dbgfs_monitor_on_write()