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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
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
zzha zzha
OpenXG-RAN
Commits
4cd5d80d
Commit
4cd5d80d
authored
Jun 08, 2019
by
wujing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log-mem function to collect log
parent
d5d1c195
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
309 additions
and
3 deletions
+309
-3
common/utils/LOG/log.c
common/utils/LOG/log.c
+280
-1
common/utils/LOG/log.h
common/utils/LOG/log.h
+15
-0
common/utils/LOG/log_extern.h
common/utils/LOG/log_extern.h
+3
-1
targets/RT/USER/lte-softmodem-common.c
targets/RT/USER/lte-softmodem-common.c
+8
-0
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+1
-1
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+2
-0
No files found.
common/utils/LOG/log.c
View file @
4cd5d80d
This diff is collapsed.
Click to expand it.
common/utils/LOG/log.h
View file @
4cd5d80d
...
...
@@ -118,6 +118,8 @@ extern "C" {
#define FLAG_NOCOLOR 0x0001
/*!< \brief use colors in log messages, depending on level */
#define FLAG_THREAD 0x0008
/*!< \brief display thread name in log messages */
#define FLAG_LEVEL 0x0010
/*!< \brief display log level in log messages */
#define FLAG_FUNCT 0x0020
#define FLAG_FILE_LINE 0x0040
#define FLAG_TIME 0x0100
#define FLAG_INITIALIZED 0x8000
...
...
@@ -307,6 +309,19 @@ int is_newline( char *str, int size);
int
register_log_component
(
char
*
name
,
char
*
fext
,
int
compidx
);
#define LOG_MEM_SIZE 100*1024*1024
#define LOG_MEM_FILE "./logmem.log"
void
flush_mem_to_file
(
void
);
void
log_output_memory
(
const
char
*
file
,
const
char
*
func
,
int
line
,
int
comp
,
int
level
,
const
char
*
format
,
va_list
args
);
int
logInit_log_mem
(
void
);
void
close_log_mem
(
void
);
typedef
struct
{
char
*
buf_p
;
int
buf_index
;
int
enable_flag
;
}
log_mem_cnt_t
;
/* @}*/
/*!\fn int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, char format);
...
...
common/utils/LOG/log_extern.h
View file @
4cd5d80d
...
...
@@ -27,4 +27,6 @@ extern log_t *g_log;
extern
mapping
log_level_names
[];
extern
mapping
log_options
[];
extern
mapping
log_maskmap
[];
extern
int
log_mem_flag
;
extern
char
*
log_mem_filename
;
extern
char
logmem_filename
[
1024
];
targets/RT/USER/lte-softmodem-common.c
View file @
4cd5d80d
...
...
@@ -60,6 +60,7 @@ void get_common_options(void) {
uint32_t
nonbiot
;
uint32_t
rfsim
;
uint32_t
basicsim
;
char
*
logmem_filename
=
NULL
;
paramdef_t
cmdline_params
[]
=
CMDLINE_PARAMS_DESC
;
paramdef_t
cmdline_logparams
[]
=
CMDLINE_LOGPARAMS_DESC
;
checkedparam_t
cmdline_log_CheckParams
[]
=
CMDLINE_LOGPARAMS_CHECK_DESC
;
...
...
@@ -80,6 +81,13 @@ void get_common_options(void) {
load_module_shlib
(
"telnetsrv"
,
NULL
,
0
,
NULL
);
}
if
(
logmem_filename
!=
NULL
&&
strlen
(
logmem_filename
)
>
0
)
{
log_mem_filename
=
&
logmem_filename
[
0
];
log_mem_flag
=
1
;
printf
(
"Enabling OPT for log save at memory %s
\n
"
,
log_mem_filename
);
logInit_log_mem
();
}
if
(
noS1
)
{
set_softmodem_optmask
(
SOFTMODEM_NOS1_BIT
);
}
...
...
targets/RT/USER/lte-softmodem.c
View file @
4cd5d80d
...
...
@@ -279,7 +279,7 @@ void exit_function(const char *file, const char *function, const int line, const
if
(
s
!=
NULL
)
{
printf
(
"%s:%d %s() Exiting OAI softmodem: %s
\n
"
,
file
,
line
,
function
,
s
);
}
close_log_mem
();
oai_exit
=
1
;
if
(
RC
.
ru
==
NULL
)
...
...
targets/RT/USER/lte-softmodem.h
View file @
4cd5d80d
...
...
@@ -222,6 +222,7 @@
{"g" , CONFIG_HLP_LOGL, 0, uptr:&glog_level, defintval:0, TYPE_UINT, 0}, \
{"telnetsrv", CONFIG_HLP_TELN, PARAMFLAG_BOOL, uptr:&start_telnetsrv, defintval:0, TYPE_UINT, 0}, \
{"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \
{"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \
}
#define CMDLINE_ONLINELOG_IDX 0
#define CMDLINE_GLOGLEVEL_IDX 1
...
...
@@ -233,6 +234,7 @@
{ .s2= { config_check_intrange, {0,4}}}, \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
{ .s5= {NULL }} , \
}
/***************************************************************************************************************************************/
...
...
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