From 0fa30c70d4ba6b7eae3c2dfba851fc6ad073d53c Mon Sep 17 00:00:00 2001 From: Ezekiel Dohmen <ezekiel.dohmen@ligo.org> Date: Fri, 24 Jun 2022 10:07:23 -0700 Subject: [PATCH] DKMS makefile change, and better wording around space dropped var --- src/drv/rts-logger/module/Makefile | 2 +- src/drv/rts-logger/module/rts-logger.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/drv/rts-logger/module/Makefile b/src/drv/rts-logger/module/Makefile index e9ba23109..3454b0245 100644 --- a/src/drv/rts-logger/module/Makefile +++ b/src/drv/rts-logger/module/Makefile @@ -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/ diff --git a/src/drv/rts-logger/module/rts-logger.c b/src/drv/rts-logger/module/rts-logger.c index 053254c55..da2d52cfd 100644 --- a/src/drv/rts-logger/module/rts-logger.c +++ b/src/drv/rts-logger/module/rts-logger.c @@ -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) -- GitLab