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
spbro
OpenXG-RAN
Commits
2129ee3c
Commit
2129ee3c
authored
Mar 01, 2024
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove global visibility of log variables, remove circular .h dependancy
parent
b99e8567
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
36 additions
and
119 deletions
+36
-119
common/utils/LOG/log.c
common/utils/LOG/log.c
+22
-30
common/utils/LOG/log.h
common/utils/LOG/log.h
+2
-3
common/utils/LOG/log_extern.h
common/utils/LOG/log_extern.h
+0
-31
common/utils/LOG/log_if.h
common/utils/LOG/log_if.h
+0
-34
doc/Doxyfile
doc/Doxyfile
+0
-1
executables/nr-gnb.c
executables/nr-gnb.c
+1
-1
executables/softmodem-common.c
executables/softmodem-common.c
+2
-4
openair1/PHY/defs_common.h
openair1/PHY/defs_common.h
+1
-1
openair1/SIMULATION/LTE_PHY/framegen.c
openair1/SIMULATION/LTE_PHY/framegen.c
+1
-1
openair1/SIMULATION/LTE_PHY/pucchsim.c
openair1/SIMULATION/LTE_PHY/pucchsim.c
+1
-1
openair2/E1AP/e1ap_setup.c
openair2/E1AP/e1ap_setup.c
+0
-1
openair2/ENB_APP/NB_IoT_config.c
openair2/ENB_APP/NB_IoT_config.c
+0
-1
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+0
-1
openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c
openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c
+1
-1
openair2/UTIL/CLI/cli_cmd.c
openair2/UTIL/CLI/cli_cmd.c
+0
-1
openair2/UTIL/OPT/opt.h
openair2/UTIL/OPT/opt.h
+1
-1
radio/IRIS/iris_lib.cpp
radio/IRIS/iris_lib.cpp
+1
-1
targets/TEST/AT_COMMANDS/oaisim.c
targets/TEST/AT_COMMANDS/oaisim.c
+1
-2
targets/TEST/PDCP/test_pdcp.c
targets/TEST/PDCP/test_pdcp.c
+1
-1
targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
+1
-2
No files found.
common/utils/LOG/log.c
View file @
2129ee3c
...
...
@@ -46,7 +46,7 @@
#include <time.h>
#include <sys/time.h>
#include <stdatomic.h>
#include "common/utils/LOG/log
_extern
.h"
#include "common/utils/LOG/log.h"
// main log variables
...
...
@@ -58,18 +58,16 @@ void read_cpu_hardware (void) __attribute__ ((constructor));
void
read_cpu_hardware
(
void
)
{}
#endif
log_mem_cnt_t
log_mem_d
[
2
];
int
log_mem_flag
=
0
;
static
log_mem_cnt_t
log_mem_d
[
2
];
static
int
log_mem_flag
=
0
;
volatile
int
log_mem_side
=
0
;
pthread_mutex_t
log_mem_lock
;
pthread_cond_t
log_mem_notify
;
pthread_t
log_mem_thread
;
int
log_mem_file_cnt
=
0
;
static
pthread_mutex_t
log_mem_lock
;
static
pthread_cond_t
log_mem_notify
;
static
pthread_t
log_mem_thread
;
static
int
log_mem_file_cnt
=
0
;
volatile
int
log_mem_write_flag
=
0
;
volatile
int
log_mem_write_side
=
0
;
char
__log_mem_filename
[
1024
]
=
{
0
};
char
*
log_mem_filename
=
&
__log_mem_filename
[
0
];
char
logmem_filename
[
1024
]
=
{
0
};
static
char
*
log_mem_filename
;
const
mapping
log_level_names
[]
=
{{
"error"
,
OAILOG_ERR
},
{
"warn"
,
OAILOG_WARNING
},
...
...
@@ -935,28 +933,22 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
}
}
int
logInit_log_mem
(
void
)
int
logInit_log_mem
(
char
*
filename
)
{
if
(
log_mem_flag
==
1
)
{
log_mem_d
[
0
].
buf_p
=
malloc
(
LOG_MEM_SIZE
);
log_mem_d
[
0
].
buf_index
=
0
;
log_mem_d
[
0
].
enable_flag
=
1
;
log_mem_d
[
1
].
buf_p
=
malloc
(
LOG_MEM_SIZE
);
log_mem_d
[
1
].
buf_index
=
0
;
log_mem_d
[
1
].
enable_flag
=
1
;
log_mem_side
=
0
;
if
((
pthread_mutex_init
(
&
log_mem_lock
,
NULL
)
!=
0
)
||
(
pthread_cond_init
(
&
log_mem_notify
,
NULL
)
!=
0
))
{
log_mem_d
[
1
].
enable_flag
=
0
;
return
-
1
;
}
pthread_create
(
&
log_mem_thread
,
NULL
,
(
void
*
(
*
)(
void
*
))
flush_mem_to_file
,
(
void
*
)
NULL
);
}
else
{
log_mem_d
[
0
].
buf_p
=
NULL
;
log_mem_d
[
1
].
buf_p
=
NULL
;
log_mem_d
[
0
].
enable_flag
=
0
;
log_mem_d
[
1
].
enable_flag
=
0
;
log_mem_flag
=
1
;
log_mem_filename
=
filename
;
// in present code, the parameter is safe permanent pointer
log_mem_d
[
0
].
buf_p
=
malloc
(
LOG_MEM_SIZE
);
log_mem_d
[
0
].
buf_index
=
0
;
log_mem_d
[
0
].
enable_flag
=
1
;
log_mem_d
[
1
].
buf_p
=
malloc
(
LOG_MEM_SIZE
);
log_mem_d
[
1
].
buf_index
=
0
;
log_mem_d
[
1
].
enable_flag
=
1
;
log_mem_side
=
0
;
if
((
pthread_mutex_init
(
&
log_mem_lock
,
NULL
)
!=
0
)
||
(
pthread_cond_init
(
&
log_mem_notify
,
NULL
)
!=
0
))
{
log_mem_d
[
1
].
enable_flag
=
0
;
return
-
1
;
}
pthread_create
(
&
log_mem_thread
,
NULL
,
(
void
*
(
*
)(
void
*
))
flush_mem_to_file
,
(
void
*
)
NULL
);
printf
(
"log init done
\n
"
);
return
0
;
...
...
common/utils/LOG/log.h
View file @
2129ee3c
...
...
@@ -272,8 +272,7 @@ extern "C" {
}
#endif
#endif
/*--- INCLUDES ---------------------------------------------------------------*/
# include "log_if.h"
/*----------------------------------------------------------------------------*/
int
logInit
(
void
);
void
logTerm
(
void
);
...
...
@@ -299,7 +298,7 @@ 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
);
int
logInit_log_mem
(
void
);
int
logInit_log_mem
(
char
*
);
void
close_log_mem
(
void
);
typedef
struct
{
...
...
common/utils/LOG/log_extern.h
deleted
100644 → 0
View file @
b99e8567
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "log.h"
extern
log_t
*
g_log
;
extern
const
mapping
log_level_names
[];
extern
const
mapping
log_options
[];
extern
const
mapping
log_maskmap
[];
extern
int
log_mem_flag
;
extern
char
*
log_mem_filename
;
extern
char
logmem_filename
[
1024
];
common/utils/LOG/log_if.h
deleted
100644 → 0
View file @
b99e8567
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file log_if.h
* \brief log interface
* \author Navid Nikaein
* \date 2009 - 2014
* \version 0.3
* \warning This component can be runned only in user-space
* @ingroup routing
*/
// LTS: kept this file for compatibility
// this file was probably a trial to separate internal functions and external ones
// but it has never been finished, most source code include directly log.h (not log_if.h)
#include "log.h"
doc/Doxyfile
View file @
2129ee3c
...
...
@@ -902,7 +902,6 @@ INPUT = \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/LOG/vcd_signal_dumper.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/LOG/log.c \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/LOG/log.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/LOG/log_extern.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/time_stat.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/ocp_itti/all_msg.h \
@CMAKE_CURRENT_SOURCE_DIR@/../common/utils/ocp_itti/intertask_interface.h \
...
...
executables/nr-gnb.c
View file @
2129ee3c
...
...
@@ -69,7 +69,7 @@
#include "common/ran_context.h"
#include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface.h"
#include "common/utils/LOG/log
_extern
.h"
#include "common/utils/LOG/log.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "UTIL/MATH/oml.h"
...
...
executables/softmodem-common.c
View file @
2129ee3c
...
...
@@ -138,10 +138,8 @@ void get_common_options(configmodule_interface_t *cfg, uint32_t execmask)
}
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
();
printf
(
"Enabling OPT for log save at memory %s
\n
"
,
logmem_filename
);
logInit_log_mem
(
logmem_filename
);
}
if
(
noS1
)
{
...
...
openair1/PHY/defs_common.h
View file @
2129ee3c
...
...
@@ -953,7 +953,7 @@ typedef enum {no_relay=1,unicast_relay_type1,unicast_relay_type2, multicast_rela
#define NB_BANDS_MAX 8
#include "common/utils/LOG/log
_extern
.h"
#include "common/utils/LOG/log.h"
extern
pthread_cond_t
sync_cond
;
extern
pthread_mutex_t
sync_mutex
;
extern
int
sync_var
;
...
...
openair1/SIMULATION/LTE_PHY/framegen.c
View file @
2129ee3c
...
...
@@ -39,7 +39,7 @@
#include "LAYER2/MAC/defs.h"
#include "PHY_INTERFACE/defs.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log
_extern
.h"
#include "UTIL/LOG/log.h"
uint16_t
n_rnti
=
0x1235
;
int
n_users
=
1
;
...
...
openair1/SIMULATION/LTE_PHY/pucchsim.c
View file @
2129ee3c
...
...
@@ -31,7 +31,7 @@
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log
_extern
.h"
#include "UTIL/LOG/log.h"
#include "unitary_defs.h"
...
...
openair2/E1AP/e1ap_setup.c
View file @
2129ee3c
...
...
@@ -24,7 +24,6 @@
#include <arpa/inet.h>
#include "common/utils/LOG/log.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log_extern.h"
#include "assertions.h"
#include "common/utils/ocp_itti/intertask_interface.h"
#include "openair2/GNB_APP/gnb_paramdef.h"
...
...
openair2/ENB_APP/NB_IoT_config.c
View file @
2129ee3c
...
...
@@ -31,7 +31,6 @@
#include <inttypes.h>
#include "log.h"
#include "log_extern.h"
#include "assertions.h"
#include "intertask_interface.h"
#include "s1ap_eNB.h"
...
...
openair2/GNB_APP/gnb_config.c
View file @
2129ee3c
...
...
@@ -32,7 +32,6 @@
#include "common/utils/LOG/log.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log_extern.h"
#include "assertions.h"
#include "oai_asn1.h"
#include "executables/softmodem-common.h"
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_sequence_manager.c
View file @
2129ee3c
...
...
@@ -27,7 +27,7 @@
*/
#include "pdcp_sequence_manager.h"
#include "common/utils//LOG/log
_if
.h"
#include "common/utils//LOG/log.h"
#include "pdcp_util.h"
/*
...
...
openair2/UTIL/CLI/cli_cmd.c
View file @
2129ee3c
...
...
@@ -32,7 +32,6 @@
#include "cli.h"
#include "log.h"
#include "log_extern.h"
extern
cli_config
*
cli_cfg
;
...
...
openair2/UTIL/OPT/opt.h
View file @
2129ee3c
...
...
@@ -48,7 +48,7 @@ This header file must be included */
#endif
#ifndef project_include
#define project_include
#include "common/utils/LOG/log
_if
.h"
#include "common/utils/LOG/log.h"
#include "PHY/defs_RU.h"
#endif
...
...
radio/IRIS/iris_lib.cpp
View file @
2129ee3c
...
...
@@ -19,7 +19,7 @@
#include <cmath>
#include <time.h>
#include <limits>
#include "common/utils/LOG/log
_extern
.h"
#include "common/utils/LOG/log.h"
#include "common_lib.h"
#include <chrono>
...
...
targets/TEST/AT_COMMANDS/oaisim.c
View file @
2129ee3c
...
...
@@ -32,8 +32,7 @@
#include "LAYER2/RLC/AM_v9.3.0/rlc_am.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log_if.h"
#include "UTIL/LOG/log_extern.h"
#include "UTIL/LOG/log.h"
#include "RRC/LTE/vars.h"
#include "PHY_INTERFACE/vars.h"
#include "UTIL/AT_COMMANDS/parser.h"
...
...
targets/TEST/PDCP/test_pdcp.c
View file @
2129ee3c
...
...
@@ -27,7 +27,7 @@
#include "MAC_INTERFACE/vars.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log
_if
.h"
#include "UTIL/LOG/log.h"
#include "test_util.h"
#include "test_pdcp.h"
...
...
targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
View file @
2129ee3c
...
...
@@ -32,8 +32,7 @@
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log_if.h"
#include "UTIL/LOG/log_extern.h"
#include "UTIL/LOG/log.h"
#include "RRC/LTE/vars.h"
#include "PHY_INTERFACE/vars.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
...
...
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