Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
85e198b1
Commit
85e198b1
authored
Aug 13, 2024
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Config module: use printf_params() to print log messages
parent
3e86e457
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
16 deletions
+12
-16
common/config/config_load_configmodule.c
common/config/config_load_configmodule.c
+5
-7
common/config/libconfig/config_libconfig.c
common/config/libconfig/config_libconfig.c
+7
-9
No files found.
common/config/config_load_configmodule.c
View file @
85e198b1
...
...
@@ -302,7 +302,7 @@ configmodule_interface_t *load_configmodule(int argc,
}
static
configmodule_interface_t
*
cfgptr
;
if
(
cfgptr
)
printf
(
"ERROR: Call load_configmodule more than one time
\n
"
);
fprintf
(
stderr
,
"ERROR: Call load_configmodule more than one time
\n
"
);
// The macros are not thread safe print_params and similar
cfgptr
=
calloc
(
sizeof
(
configmodule_interface_t
),
1
);
...
...
@@ -369,8 +369,7 @@ configmodule_interface_t *load_configmodule(int argc,
if
(
strstr
(
cfgparam
,
CONFIG_CMDLINEONLY
)
==
NULL
)
{
i
=
load_config_sharedlib
(
cfgptr
);
if
(
i
==
0
)
{
printf
(
"[CONFIG] config module %s loaded
\n
"
,
cfgmode
);
if
(
i
==
0
)
{
int
idx
=
config_paramidx_fromname
(
Config_Params
,
sizeofArray
(
Config_Params
),
CONFIGP_DEBUGFLAGS
);
Config_Params
[
idx
].
uptr
=
&
(
cfgptr
->
rtflags
);
idx
=
config_paramidx_fromname
(
Config_Params
,
sizeofArray
(
Config_Params
),
CONFIGP_TMPDIR
);
...
...
@@ -387,7 +386,7 @@ configmodule_interface_t *load_configmodule(int argc,
cfgptr
->
end
=
(
configmodule_endfunc_t
)
nooptfunc
;
}
printf
(
"[CONFIG] debug flags: 0x%08x
\n
"
,
cfgptr
->
rtflags
);
printf
_params
(
cfgptr
,
"[CONFIG] debug flags: 0x%08x
\n
"
,
cfgptr
->
rtflags
);
if
(
modeparams
!=
NULL
)
free
(
modeparams
);
...
...
@@ -413,7 +412,7 @@ void write_parsedcfg(configmodule_interface_t *cfgptr)
cfgptr
->
status
->
num_write
);
}
if
(
cfgptr
->
write_parsedcfg
!=
NULL
)
{
printf
(
"[CONFIG] calling config module write_parsedcfg function...
\n
"
);
printf
_params
(
cfgptr
,
"[CONFIG] calling config module write_parsedcfg function...
\n
"
);
cfgptr
->
write_parsedcfg
(
cfgptr
);
}
}
...
...
@@ -425,12 +424,11 @@ void end_configmodule(configmodule_interface_t *cfgptr)
if
(
cfgptr
!=
NULL
)
{
write_parsedcfg
(
cfgptr
);
if
(
cfgptr
->
end
!=
NULL
)
{
printf
(
"[CONFIG] calling config module end function...
\n
"
);
printf
_params
(
cfgptr
,
"[CONFIG] calling config module end function...
\n
"
);
cfgptr
->
end
(
cfgptr
);
}
pthread_mutex_lock
(
&
cfgptr
->
memBlocks_mutex
);
printf
(
"[CONFIG] free %u config value pointers
\n
"
,
cfgptr
->
numptrs
);
for
(
int
i
=
0
;
i
<
cfgptr
->
numptrs
;
i
++
)
{
if
(
cfgptr
->
oneBlock
[
i
].
ptrs
!=
NULL
&&
cfgptr
->
oneBlock
[
i
].
ptrsAllocated
==
true
&&
cfgptr
->
oneBlock
[
i
].
toFree
)
{
...
...
common/config/libconfig/config_libconfig.c
View file @
85e198b1
...
...
@@ -461,13 +461,11 @@ int config_libconfig_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
}
/* switch on param type */
if
(
notfound
==
1
)
{
printf
(
"[LIBCONFIG] %s not found in %s "
,
cfgpath
,
libconfig_privdata
.
configfile
);
fprintf
(
stderr
,
"[LIBCONFIG] %s not found in %s "
,
cfgpath
,
libconfig_privdata
.
configfile
);
if
(
(
cfgoptions
[
i
].
paramflags
&
PARAMFLAG_MANDATORY
)
!=
0
)
{
fatalerror
=
1
;
printf
(
" mandatory parameter missing
\n
"
);
}
else
{
printf
(
"
\n
"
);
fprintf
(
stderr
,
" mandatory parameter missing
\n
"
);
}
}
else
{
if
(
defval
==
1
)
{
...
...
@@ -570,8 +568,8 @@ int config_libconfig_init(configmodule_interface_t *cfg)
}
const
char
*
incp
=
config_get_include_dir
(
&
(
libconfig_privdata
.
cfg
))
;
printf
(
"[LIBCONFIG] Path for include directive set to: %s
\n
"
,
(
incp
!=
NULL
)
?
incp
:
"libconfig defaults"
);
printf
_params
(
cfg
,
"[LIBCONFIG] Path for include directive set to: %s
\n
"
,
(
incp
!=
NULL
)
?
incp
:
"libconfig defaults"
);
/* set convertion option to allow integer to float conversion*/
config_set_auto_convert
(
&
(
libconfig_privdata
.
cfg
),
CONFIG_TRUE
);
/* Read the file. If there is an error, report it and exit. */
...
...
@@ -582,7 +580,7 @@ int config_libconfig_init(configmodule_interface_t *cfg)
config_error_line
(
&
(
libconfig_privdata
.
cfg
)),
config_error_text
(
&
(
libconfig_privdata
.
cfg
)));
config_destroy
(
&
(
libconfig_privdata
.
cfg
));
printf
(
"
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
free
(
tmppath
);
return
-
1
;
}
...
...
@@ -623,11 +621,11 @@ void config_libconfig_write_parsedcfg(configmodule_interface_t *cfg)
config_error_line
(
&
(
libconfig_privdata
.
runtcfg
)),
config_error_text
(
&
(
libconfig_privdata
.
runtcfg
)));
}
else
{
printf
(
"[LIBCONFIG] file %s created successfully
\n
"
,
cfg
->
status
->
debug_cfgname
);
printf
_params
(
cfg
,
"[LIBCONFIG] file %s created successfully
\n
"
,
cfg
->
status
->
debug_cfgname
);
}
free
(
fname
);
}
else
{
printf
(
"[LIBCONFIG] Cannot create config file after parsing: CONFIG_SAVERUNCFG flag not specified
\n
"
);
printf
_params
(
cfg
,
"[LIBCONFIG] Cannot create config file after parsing: CONFIG_SAVERUNCFG flag not specified
\n
"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment