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
Michael Black
OpenXG-RAN
Commits
4a2f9d25
Commit
4a2f9d25
authored
Mar 28, 2017
by
Wilson W.K. Thong
Committed by
Wilson Thong
Mar 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#220 enhance logging to show also thread name
parent
040957c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
openair2/UTIL/LOG/log.c
openair2/UTIL/LOG/log.c
+17
-0
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+1
-1
No files found.
openair2/UTIL/LOG/log.c
View file @
4a2f9d25
...
...
@@ -1032,6 +1032,19 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
if
(
len
>
MAX_LOG_TOTAL
)
len
=
MAX_LOG_TOTAL
;
}
if
(
(
g_log
->
flag
&
FLAG_THREAD
)
||
(
c
->
flag
&
FLAG_THREAD
)
)
{
#define THREAD_NAME_LEN 16
static
char
threadname
[
THREAD_NAME_LEN
];
if
(
pthread_getname_np
(
pthread_self
(),
threadname
,
THREAD_NAME_LEN
)
!=
0
)
{
perror
(
"pthread_getname_np : "
);
}
else
{
len
+=
snprintf
(
&
log_buffer
[
len
],
MAX_LOG_TOTAL
-
len
,
"[%s]"
,
threadname
);
if
(
len
>
MAX_LOG_TOTAL
)
len
=
MAX_LOG_TOTAL
;
}
#undef THREAD_NAME_LEN
}
if
(
(
g_log
->
flag
&
FLAG_FUNCT
)
||
(
c
->
flag
&
FLAG_FUNCT
)
)
{
len
+=
snprintf
(
&
log_buffer
[
len
],
MAX_LOG_TOTAL
-
len
,
"[%s] "
,
func
);
...
...
@@ -1287,11 +1300,15 @@ int set_comp_log(int component, int level, int verbosity, int interval)
LOG_EMERG
);
DevCheck
((
interval
>
0
)
&&
(
interval
<=
0xFF
),
interval
,
0
,
0xFF
);
#if 0
if ((verbosity == LOG_NONE) || (verbosity == LOG_LOW) ||
(verbosity == LOG_MED) || (verbosity == LOG_FULL) ||
(verbosity == LOG_HIGH)) {
g_log->log_component[component].flag = verbosity;
}
#else
g_log
->
log_component
[
component
].
flag
=
verbosity
;
#endif
g_log
->
log_component
[
component
].
level
=
level
;
g_log
->
log_component
[
component
].
interval
=
interval
;
...
...
targets/RT/USER/lte-softmodem.c
View file @
4a2f9d25
...
...
@@ -1417,7 +1417,7 @@ int main( int argc, char **argv ) {
set_comp_log
(
HW
,
LOG_DEBUG
,
LOG_HIGH
,
1
);
set_comp_log
(
PHY
,
LOG_DEBUG
,
LOG_HIGH
,
1
);
set_comp_log
(
MAC
,
LOG_INFO
,
LOG_HIGH
,
1
);
set_comp_log
(
RLC
,
LOG_INFO
,
LOG_HIGH
,
1
);
set_comp_log
(
RLC
,
LOG_INFO
,
LOG_HIGH
|
FLAG_THREAD
,
1
);
set_comp_log
(
PDCP
,
LOG_INFO
,
LOG_HIGH
,
1
);
set_comp_log
(
OTG
,
LOG_INFO
,
LOG_HIGH
,
1
);
set_comp_log
(
RRC
,
LOG_INFO
,
LOG_HIGH
,
1
);
...
...
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