.owner = THIS_MODULE,
};
+static struct abox_log_buffer_info abox_log_buffer_info_default;
static struct abox_log_buffer_info abox_log_buffer_info_new;
void abox_log_register_buffer_work_func(struct work_struct *work)
int id;
struct ABOX_LOG_BUFFER *buffer;
struct abox_log_buffer_info *info;
- char name[16];
dev = abox_log_buffer_info_new.dev;
id = abox_log_buffer_info_new.id;
dev_info(dev, "%s(%p, %d, %p)\n", __func__, dev, id, buffer);
- info = vmalloc(sizeof(*info));
+ info = &abox_log_buffer_info_default;
mutex_init(&info->lock);
info->id = id;
info->file_created = false;
info->dev = dev;
info->log_buffer = buffer;
list_add_tail(&info->list, &abox_log_list_head);
-
- snprintf(name, sizeof(name), "log-%02d", id);
- debugfs_create_file(name, 0664, abox_dbg_get_root_dir(), info,
- &abox_log_fops);
}
static DECLARE_WORK(abox_log_register_buffer_work,
debugfs_create_u32("log_auto_save", S_IRWUG, abox_dbg_get_root_dir(),
&abox_log_auto_save);
+ debugfs_create_file("log-00", 0664, abox_dbg_get_root_dir(),
+ &abox_log_buffer_info_default, &abox_log_fops);
#ifdef TEST
abox_log_test_buffer = vzalloc(SZ_128);
abox_log_test_buffer->size = SZ_64;