Skip to content
Snippets Groups Projects
Commit 8cc52428 authored by Ezekiel Dohmen's avatar Ezekiel Dohmen
Browse files

Merge branch 'logger-module-parts' into logger-module-parts-module-changes

parents b7e6610e 0fa30c70
No related branches found
No related tags found
3 merge requests!439RCG 5.0 release fro deb 10,!395Next dev build,!384Logger module parts module changes
This commit is part of merge request !384. Comments created here will be created in the context of that merge request.
......@@ -4,7 +4,7 @@ mkfile_dir := $(dir $(mkfile_path))
# obj-m specifie we're a kernel module.
obj-m += rts-logger.o
EXTRA_CFLAGS += -I$(mkfile_dir)/../../../include/
EXTRA_CFLAGS += -I$(mkfile_dir)/../../../include/ -I$(mkfile_dir)
# Set the path to the Kernel build utils.
KBUILD=/lib/modules/$(shell uname -r)/build/
......
......@@ -49,7 +49,7 @@ static int next_to_print = 0;
atomic_t g_num_filled = ATOMIC_INIT(0);
spinlock_t g_check_and_dec_lock;
static int num_dropped_space = 0;
static int num_dropped_no_space = 0;
atomic_t g_dump_to_dmesg = ATOMIC_INIT(1);
......@@ -57,7 +57,7 @@ atomic_t g_dump_to_dmesg = ATOMIC_INIT(1);
//
// Sysfs data
//
static ssize_t sysfs_space_dropped(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
static ssize_t sysfs_no_space_dropped(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
static ssize_t sysfs_dump_to_dmesg_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
static ssize_t sysfs_dump_to_dmesg_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count);
static ssize_t sysfs_debug_level_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
......@@ -67,13 +67,13 @@ static ssize_t sysfs_debug_level_store(struct kobject *kobj, struct kobj_attribu
static struct kobject *g_sysfs_dir = NULL;
/* individual sysfs debug attributes */
static struct kobj_attribute sysfs_space_dropped_attr = __ATTR(space_dropped, 0444, sysfs_space_dropped, NULL);
static struct kobj_attribute sysfs_no_space_dropped_attr = __ATTR(no_space_dropped, 0444, sysfs_no_space_dropped, NULL);
static struct kobj_attribute sysfs_dump_to_dmesg_attr = __ATTR(dump_to_dmesg, 0644, sysfs_dump_to_dmesg_show, sysfs_dump_to_dmesg_store);
static struct kobj_attribute sysfs_debug_level_attr = __ATTR(debug_level, 0644, sysfs_debug_level_show, sysfs_debug_level_store);
/* group attributes together for bulk operations */
static struct attribute *g_sysfs_fields[] = {
&sysfs_space_dropped_attr.attr,
&sysfs_no_space_dropped_attr.attr,
&sysfs_dump_to_dmesg_attr.attr,
&sysfs_debug_level_attr.attr,
NULL,
......@@ -106,7 +106,7 @@ void rtslog_print(int level, const char * fmt, ...)
//If we are full return
if(atomic_read(&g_num_filled) == MAX_BUFFERED_MSG)
{
++num_dropped_space;
++num_dropped_no_space;
spin_unlock(&g_check_and_dec_lock);
return;
}
......@@ -124,11 +124,11 @@ void rtslog_print(int level, const char * fmt, ...)
}
EXPORT_SYMBOL(rtslog_print);
int rtslog_get_num_dropped_space( void )
int rtslog_get_num_dropped_no_space( void )
{
return num_dropped_space;
return num_dropped_no_space;
}
EXPORT_SYMBOL(rtslog_get_num_dropped_space);
EXPORT_SYMBOL(rtslog_get_num_dropped_no_space);
int rtslog_get_num_ready_to_print( void)
{
......@@ -285,9 +285,9 @@ bool parseInt(const char *buf, size_t count, int * result, int * error_code)
}
static ssize_t sysfs_space_dropped(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
static ssize_t sysfs_no_space_dropped(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", num_dropped_space);
return sprintf(buf, "%d\n", num_dropped_no_space);
}
static ssize_t sysfs_dump_to_dmesg_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment