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

Fixing gpstime build, because of logger module

parent 403f152e
No related branches found
No related tags found
3 merge requests!439RCG 5.0 release fro deb 10,!395Next dev build,!394Gpstime logger fix for new logger module
......@@ -33,8 +33,9 @@ $(MODULENAME)-y := $(MODULENAME)_core.o
$(MODULENAME)-y += ../../include/drv/spectracomGPS.o
$(MODULENAME)-y += ../../include/drv/symmetricomGps.o
$(MODULENAME)-y += ../../include/drv/ligoPcieTiming_core.o
$(MODULENAME)-y += ../../drv/rts-logger/force-printk/printk-rts-logger.o
ccflags-y += -I$(mkfile_dir)/../../include/
ccflags-y += -DRTS_LOG_PREFIX=\"gpstime\" -I$(mkfile_dir)/../../include/
ifeq ($(KERNELRELEASE),)
all:
......
......@@ -41,9 +41,11 @@ sudo journalctl -t kernel -f | grep x1tst
# Structure
```
include/ # Contains shared header file that other modules would use for logger declarations.
module/ # Main logger module implementation.
test/ # Test module that spams the logger from a couple of threads.
userspace/ # Userspace implementation for the logger
force-printk/ # Version that uses printk for logger methods (used by gpstime)
module/ # Main logger module implementation.
test/ # Test module that spams the logger from a couple of threads.
userspace/ # Userspace implementation for the logger
```
## Other Notes
Because the `gpstime` module includes some timing card c files that use RTSLOG functions we provide a printk version for building with `gpstime`.
#include "drv/rts-logger.h"
#include <linux/printk.h>
#include <linux/atomic.h>
static atomic_t g_log_level = ATOMIC_INIT( RTSLOG_LOG_LEVEL_INFO );
void rtslog_print(int level, const char * fmt, ...)
{
va_list args;
if(level < rtslog_get_log_level() ) return;
va_start(args, fmt);
vprintk(fmt, args);
va_end(args);
}
int rtslog_set_log_level(int new_level)
{
if(new_level < RTSLOG_LOG_LEVEL_DEBUG || new_level > RTSLOG_LOG_LEVEL_ERROR) return 0;
atomic_set(&g_log_level, new_level);
return 1;
}
int rtslog_get_log_level( void )
{
return atomic_read(&g_log_level);
}
int rtslog_get_num_dropped_space ( void )
{
return 0;
}
int rtslog_get_num_ready_to_print( void )
{
return 0;
}
......@@ -23,10 +23,13 @@
#if defined(FE_HEADER)
#include FE_HEADER //SYSTEM_NAME_STRING_LOWER
#define RTS_LOG_PREFIX SYSTEM_NAME_STRING_LOWER
#endif
#else
#else //FE_HEADER not defined, so define prefix as "undefined"
#define RTS_LOG_PREFIX "undefined"
#endif //defined(FE_HEADER)
#endif //ifndef RTS_LOG_PREFIX
enum RTSLOG_LOG_LEVEL
......
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