add flag for unused function arguments in common folder CMakeLists

(not enforced because of fmtlog external dependency)
This commit is contained in:
francescomani
2026-03-27 18:06:33 +01:00
parent 2483b68ee4
commit 683d855d97
51 changed files with 203 additions and 162 deletions
+6 -6
View File
@@ -133,7 +133,7 @@ int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoption
return status;
}
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
{
int status = 0;
@@ -193,7 +193,7 @@ int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgo
return status;
}
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
{
int status = 0;
config_check_valptr(cfg, cfgoptions, sizeof(*cfgoptions->dblptr), 1);
@@ -229,7 +229,7 @@ int config_assign_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions
return 0;
}
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix)
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions)
{
int status = 0;
@@ -333,13 +333,13 @@ int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoptio
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
return config_setdefault_intlist(cfg, cfgoption, prefix);
return config_setdefault_intlist(cfg, cfgoption);
case TYPE_DOUBLE:
return config_setdefault_double(cfg, cfgoption, prefix);
return config_setdefault_double(cfg, cfgoption);
case TYPE_IPV4ADDR:
return config_setdefault_ipv4addr(cfg, cfgoption, prefix);
return config_setdefault_ipv4addr(cfg, cfgoption);
case TYPE_LIST:
// No default value for list type
+3 -3
View File
@@ -20,11 +20,11 @@ void config_check_valptr(configmodule_interface_t *cfg, paramdef_t *cfgoptions,
/* functions to set a parameter to its default value */
int config_setdefault_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_int64(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_intlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
int config_setdefault_string(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_stringlist(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions, const char *prefix);
int config_setdefault_double(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
int config_setdefault_ipv4addr(configmodule_interface_t *cfg, paramdef_t *cfgoptions);
void *config_allocate_new(configmodule_interface_t *cfg, int sz, bool autoFree);
void config_assign_int(configmodule_interface_t *cfg, paramdef_t *cfgoptions, char *fullname, int val);
int config_common_getdefault(configmodule_interface_t *cfg, paramdef_t *cfgoption, const char *prefix);
+7 -3
View File
@@ -123,6 +123,10 @@ int config_cmdlineonly_getlist(configmodule_interface_t *cfg,
int numparams,
const char *prefix)
{
UNUSED(cfg);
UNUSED(params);
UNUSED(numparams);
UNUSED(prefix);
ParamList->numelt = 0;
return 0;
}
@@ -162,15 +166,15 @@ int config_cmdlineonly_get(configmodule_interface_t *cfg, paramdef_t *cfgoptions
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
defval = config_setdefault_intlist(cfg, &cfgoptions[i], prefix);
defval = config_setdefault_intlist(cfg, &cfgoptions[i]);
break;
case TYPE_DOUBLE:
defval = config_setdefault_double(cfg, &cfgoptions[i], prefix);
defval = config_setdefault_double(cfg, &cfgoptions[i]);
break;
case TYPE_IPV4ADDR:
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i], prefix);
defval = config_setdefault_ipv4addr(cfg, &cfgoptions[i]);
break;
default:
+3
View File
@@ -177,6 +177,7 @@ void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokva
int config_check_intval(configmodule_interface_t *cfg, paramdef_t *param)
{
UNUSED(cfg);
if ( param == NULL ) {
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
return -1;
@@ -212,6 +213,7 @@ int config_check_modify_integer(configmodule_interface_t *cfg, paramdef_t *param
int config_check_intrange(configmodule_interface_t *cfg, paramdef_t *param)
{
UNUSED(cfg);
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
return 0;
}
@@ -234,6 +236,7 @@ void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numok
int config_check_strval(configmodule_interface_t *cfg, paramdef_t *param)
{
UNUSED(cfg);
if ( param == NULL ) {
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
return -1;
+1
View File
@@ -158,6 +158,7 @@ extern "C" int config_yaml_init(configmodule_interface_t *cfg)
extern "C" void config_yaml_end(configmodule_interface_t *cfg)
{
UNUSED(cfg);
delete config_yaml::config;
}
+5 -9
View File
@@ -519,13 +519,7 @@ void logTerm(void)
}
#include <sys/syscall.h>
static inline int log_header(log_component_t *c,
char *log_buffer,
int buffsize,
const char *file,
const char *func,
int line,
int level)
static inline int log_header(log_component_t *c, char *log_buffer, int buffsize, const char *func, int line, int level)
{
int flag = g_log->flag;
@@ -666,7 +660,7 @@ void log_dump(int component,
if (wbuf != NULL) {
va_start(args, format);
int pos=log_header(c, wbuf,MAX_LOG_TOTAL,"noFile","noFunc",0, OAILOG_INFO);
int pos = log_header(c, wbuf, MAX_LOG_TOTAL, "noFunc", 0, OAILOG_INFO);
pos+=vsprintf(wbuf+pos,format, args);
va_end(args);
@@ -875,6 +869,8 @@ void flush_mem_to_file(void)
static void log_output_memory(log_component_t *c, const char *file, const char *func, int line, int comp, int level, const char* format,va_list args)
{
UNUSED(comp);
UNUSED(file);
//logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args)
int len = 0;
/* The main difference with the version above is the use of this local log_buffer.
@@ -887,7 +883,7 @@ static void log_output_memory(log_component_t *c, const char *file, const char *
// make sure that for log trace the extra info is only printed once, reset when the level changes
if (level < OAILOG_TRACE) {
int n = log_header(c, log_buffer+len, sizeof(log_buffer), file, func, line, level);
int n = log_header(c, log_buffer+len, sizeof(log_buffer), func, line, level);
if (n > 0) {
len += n;
if (len > sizeof(log_buffer)) {
+1
View File
@@ -89,6 +89,7 @@ static int get_message(int s)
static void *T_receive_thread(void *_)
{
UNUSED(_);
int err = 0;
while (!err) err = get_message(T_socket);
+4
View File
@@ -27,6 +27,10 @@
*/
void exit_function(const char *file, const char *function, const int line, const char *s, const int assert)
{
UNUSED(file);
UNUSED(function);
UNUSED(line);
UNUSED(s);
if (assert) {
abort();
} else {
+1 -1
View File
@@ -428,7 +428,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
for (i = 0; i < 8; i++)
timeline_set_subline_background_color(g, timeline_plot, i,
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
timeview = new_view_time(3600, 10, g, timeline_plot);
timeview = new_view_time(10, g, timeline_plot);
/* DL tick logging */
timelog = new_timelog(h, database, "ENB_PHY_DL_TICK");
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
+1
View File
@@ -7,6 +7,7 @@
#include "utils.h"
#include "../T_defs.h"
#include "common/platform_types.h"
#ifdef T_SEND_TIME
#include <time.h>
#endif
+3 -2
View File
@@ -41,6 +41,7 @@ int eval_eq(struct filter *f, event e)
int eval_int(struct filter *f, event e)
{
UNUSED(e);
return f->v.v;
}
@@ -152,9 +153,9 @@ filter *filter_evarg(void *database, char *event_name, char *varname)
return ret;
}
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
void *priv, filter *x)
filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x)
{
UNUSED(database);
struct filter *ret = calloc(1, sizeof(struct filter));
if (ret == NULL) abort();
ret->eval = eval_evfun;
+1 -4
View File
@@ -13,11 +13,8 @@ filter *filter_and(filter *a, filter *b);
filter *filter_eq(filter *a, filter *b);
filter *filter_int(int v);
filter *filter_evarg(void *database, char *event_name, char *varname);
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
void *priv, filter *x);
filter *filter_evfun(void *database, int (*fun)(void *priv, int v), void *priv, filter *x);
int filter_eval(filter *f, event e);
void free_filter(filter *f);
#endif /* _FILTER_H_ */
+5 -4
View File
@@ -52,8 +52,7 @@ event_handler *new_handler(void *database)
return ret;
}
unsigned long register_handler_function(event_handler *_h, int event_id,
void (*f)(void *, event), void *p)
unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p)
{
struct _event_handler *h = _h;
unsigned long ret = h->next_id;
@@ -78,9 +77,11 @@ unsigned long register_handler_function(event_handler *_h, int event_id,
return ret;
}
void remove_handler_function(event_handler *h, int event_id,
unsigned long handler_id)
void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id)
{
UNUSED(h);
UNUSED(event_id);
UNUSED(handler_id);
printf("%s:%d: TODO\n", __FILE__, __LINE__);
abort();
}
+2 -5
View File
@@ -11,10 +11,7 @@ typedef void event_handler;
event_handler *new_handler(void *database);
void handle_event(event_handler *h, event e);
unsigned long register_handler_function(event_handler *_h, int event_id,
void (*f)(void *, event), void *p);
void remove_handler_function(event_handler *h, int event_id,
unsigned long handler_id);
unsigned long register_handler_function(event_handler *_h, int event_id, void (*f)(void *, event), void *p);
void remove_handler_function(event_handler *h, int event_id, unsigned long handler_id);
#endif /* _HANDLER_H_ */
+12 -13
View File
@@ -323,7 +323,7 @@ void dl(void *_d, event e)
}
trace_lte(e.sending_time, d, DIRECTION_DOWNLINK,
e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI, e.e[d->dl_rnti].i,
e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI_T, e.e[d->dl_rnti].i,
e.e[d->dl_frame].i, e.e[d->dl_subframe].i,
e.e[d->dl_data].b, e.e[d->dl_data].bsize,
NO_PREAMBLE, NO_SR_RNTI);
@@ -406,7 +406,7 @@ void sr(void *_d, event e)
void trace_nr(struct timespec sending_time, ev_data *d, int direction,
int rnti_type, int rnti, int frame, int slot, int harq_pid, void *buf,
int bufsize, int preamble)
int bufsize)
{
ssize_t ret;
int i;
@@ -475,7 +475,7 @@ void nr_ul(void *_d, event e)
NR_C_RNTI, e.e[d->nr_ul_rnti].i,
e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i,
e.e[d->nr_ul_harq_pid].i, e.e[d->nr_ul_data].b,
e.e[d->nr_ul_data].bsize, NO_PREAMBLE);
e.e[d->nr_ul_data].bsize);
}
void nr_dl(void *_d, event e)
@@ -494,7 +494,7 @@ void nr_dl(void *_d, event e)
e.e[d->nr_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI,
e.e[d->nr_dl_rnti].i, e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i,
e.e[d->nr_dl_harq_pid].i, e.e[d->nr_dl_data].b,
e.e[d->nr_dl_data].bsize, NO_PREAMBLE);
e.e[d->nr_dl_data].bsize);
}
void nr_dl_retx(void *_d, event e)
@@ -505,7 +505,7 @@ void nr_dl_retx(void *_d, event e)
NR_C_RNTI, e.e[d->nr_dl_retx_rnti].i,
e.e[d->nr_dl_retx_frame].i, e.e[d->nr_dl_retx_slot].i,
e.e[d->nr_dl_retx_harq_pid].i, e.e[d->nr_dl_retx_data].b,
e.e[d->nr_dl_retx_data].bsize, NO_PREAMBLE);
e.e[d->nr_dl_retx_data].bsize);
}
void nr_mib(void *_d, event e)
@@ -520,7 +520,7 @@ void nr_mib(void *_d, event e)
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i, 0 /* harq pid */,
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE);
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize);
}
void nr_ue_mib(void *_d, event e)
@@ -535,7 +535,7 @@ void nr_ue_mib(void *_d, event e)
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
e.e[d->nr_ue_mib_frame].i, e.e[d->nr_ue_mib_slot].i, 0 /* harq pid */,
e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize, NO_PREAMBLE);
e.e[d->nr_ue_mib_data].b, e.e[d->nr_ue_mib_data].bsize);
}
void nr_rar(void *_d, event e)
@@ -545,7 +545,7 @@ void nr_rar(void *_d, event e)
trace_nr(e.sending_time, d, NR_DIRECTION_DOWNLINK,
NR_RA_RNTI, e.e[d->nr_rar_rnti].i,
e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i, 0 /* harq pid */,
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE);
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize);
}
void nr_ue_ul(void *_d, event e)
@@ -556,7 +556,7 @@ void nr_ue_ul(void *_d, event e)
NR_C_RNTI, e.e[d->nr_ue_ul_rnti].i,
e.e[d->nr_ue_ul_frame].i, e.e[d->nr_ue_ul_slot].i,
e.e[d->nr_ue_ul_harq_pid].i, e.e[d->nr_ue_ul_data].b,
e.e[d->nr_ue_ul_data].bsize, NO_PREAMBLE);
e.e[d->nr_ue_ul_data].bsize);
}
void nr_ue_dl(void *_d, event e)
@@ -575,7 +575,7 @@ void nr_ue_dl(void *_d, event e)
e.e[d->nr_ue_dl_rnti].i != 0xffff ? NR_C_RNTI : NR_SI_RNTI,
e.e[d->nr_ue_dl_rnti].i, e.e[d->nr_ue_dl_frame].i,
e.e[d->nr_ue_dl_slot].i, e.e[d->nr_ue_dl_harq_pid].i,
e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize, NO_PREAMBLE);
e.e[d->nr_ue_dl_data].b, e.e[d->nr_ue_dl_data].bsize);
}
void nr_ue_rar(void *_d, event e)
@@ -584,8 +584,7 @@ void nr_ue_rar(void *_d, event e)
trace_nr(e.sending_time, d, DIRECTION_DOWNLINK,
RA_RNTI, e.e[d->nr_ue_rar_rnti].i,
e.e[d->nr_ue_rar_frame].i, e.e[d->nr_ue_rar_slot].i, 0,
e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize,
NO_PREAMBLE);
e.e[d->nr_ue_rar_data].b, e.e[d->nr_ue_rar_data].bsize);
}
/****************************************************************************/
@@ -961,7 +960,7 @@ static int sock = -1;
void force_stop(int x)
{
printf("\ngently quit...\n");
printf("\ngently quit(%d)...\n", x);
close(sock);
sock = -1;
run = 0;
+3 -3
View File
@@ -27,12 +27,12 @@
/* rntiType */
#define NO_RNTI 0
#define P_RNTI 1
#define P_RNTI_T 1
#define RA_RNTI 2
#define C_RNTI 3
#define SI_RNTI 4
#define SI_RNTI_T 4
#define SPS_RNTI 5
#define M_RNTI 6
#define M_RNTI_T 6
#define SL_BCH_RNTI 7
#define SL_RNTI 8
#define SC_RNTI 9
+2 -1
View File
@@ -11,6 +11,7 @@
#include "utils.h"
#include "../T_defs.h"
#include "configuration.h"
#include "common/platform_types.h"
void usage(void)
{
@@ -39,7 +40,7 @@ static int socket = -1;
void force_stop(int x)
{
printf("\ngently quit...\n");
printf("\ngently quit (%d)...\n", x);
close(socket);
socket = -1;
run = 0;
+3 -10
View File
@@ -249,7 +249,7 @@ static int socket_fd = -1;
void force_stop(int x)
{
logi("gently quit...");
logi("gently quit %d", x);
close(socket_fd);
socket_fd = -1;
run = 0;
@@ -785,12 +785,7 @@ uint8_t should_insert(EventBuffer &buf)
return 0;
}
int insert_event(clickhouse_config_t *ch,
void *database,
int event_id,
const char *event_data,
int data_length,
std::chrono::high_resolution_clock::time_point t_start)
int insert_event(clickhouse_config_t *ch, int event_id, const char *event_data, int data_length)
{
auto t_fn_start = std::chrono::high_resolution_clock::now();
@@ -1270,14 +1265,12 @@ int main(int n, char **v)
if (fullread(socket_fd, v + vpos, length) == -1)
goto read_error;
auto t_start = std::chrono::high_resolution_clock::now();
if (type == -1) {
append_received_config_chunk(v + vpos, length);
} else if (type == -2) {
verify_config();
} else if (type >= 0 && type < number_of_events && is_on[type]) {
if (insert_event(&ch_config, database, type, v + vpos, length, t_start) != 0) {
if (insert_event(&ch_config, type, v + vpos, length) != 0) {
loge("Failed to insert event type {}", type);
}
}
+1 -1
View File
@@ -417,7 +417,7 @@ static void ue_main_gui(ue_gui *e, gui *g, event_handler *h, void *database,
for (i = 0; i < 8; i++)
timeline_set_subline_background_color(g, timeline_plot, i,
new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
timeview = new_view_time(3600, 10, g, timeline_plot);
timeview = new_view_time(10, g, timeline_plot);
/* DL tick logging */
timelog = new_timelog(h, database, "UE_PHY_DL_TICK");
subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
+1 -1
View File
@@ -100,7 +100,7 @@ static void vcd_main_gui(gui *g, event_handler *h, void *database)
for (i = 0; i < nb_functions; i++)
timeline_set_subline_background_color(g, w, i,
new_color(g, i & 1 ? "#ddd" : "#eee"));
timeview = new_view_time(3600, 10, g, w);
timeview = new_view_time(10, g, w);
i = 0;
for (j = 0; j < n; j++) {
if (strncmp(ids[j], "VCD_FUNCTION_", 13) != 0) continue;
+1
View File
@@ -70,6 +70,7 @@ static void *scrolltti_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void insert(struct scrolltti *this, double value)
+1
View File
@@ -15,6 +15,7 @@ struct stdout {
static void clear(view *this)
{
/* do nothing */
UNUSED(this);
}
static void append(view *_this, char *s)
+5 -2
View File
@@ -71,6 +71,7 @@ static void *textlist_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void append(view *_this, char *s)
@@ -120,9 +121,11 @@ static void scroll(void *private, gui *g,
if (pthread_mutex_unlock(&this->lock)) abort();
}
static void click(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(notification);
UNUSED(g);
UNUSED(w);
struct textlist *this = private;
int *d = notification_data;
int button = d[1];
+9 -6
View File
@@ -164,9 +164,10 @@ static void *ticktime_thread(void *_this)
return 0;
}
static void scroll(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
struct ticktime *this = private;
int *d = notification_data;
int x = d[0];
@@ -225,9 +226,11 @@ end:
if (pthread_mutex_unlock(&this->lock)) abort();
}
static void click(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
UNUSED(notification);
struct ticktime *this = private;
int *d = notification_data;
int button = *d;
@@ -365,9 +368,9 @@ struct clock_ticktime {
struct ticktime *parent;
};
static void clock_append(view *_this, struct timespec t,
int frame, int subframe)
static void clock_append(view *_this, struct timespec t, int frame, int subframe)
{
UNUSED(t);
struct clock_ticktime *this = (struct clock_ticktime *)_this;
struct ticktime *tt = this->parent;
int64_t diff;
+8 -6
View File
@@ -156,9 +156,10 @@ static void *time_thread(void *_this)
return 0;
}
static void scroll(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void scroll(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
struct time *this = private;
int *d = notification_data;
int x = d[0];
@@ -217,9 +218,11 @@ end:
if (pthread_mutex_unlock(&this->lock)) abort();
}
static void click(void *private, gui *g,
char *notification, widget *w, void *notification_data)
static void click(void *private, gui *g, char *notification, widget *w, void *notification_data)
{
UNUSED(g);
UNUSED(w);
UNUSED(notification);
struct time *this = private;
int *d = notification_data;
int button = *d;
@@ -228,8 +231,7 @@ static void click(void *private, gui *g,
if (button == 1) this->autoscroll = 1;
}
view *new_view_time(int number_of_seconds, float refresh_rate,
gui *g, widget *w)
view *new_view_time(float refresh_rate, gui *g, widget *w)
{
struct time *ret = calloc(1, sizeof(struct time));
if (ret == NULL) abort();
+1
View File
@@ -94,6 +94,7 @@ static void *tti_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void append(view *_this, int frame, int tick, double value)
+5 -8
View File
@@ -6,6 +6,7 @@
#define _VIEW_H_
#include "gui/gui.h"
#include "common/platform_types.h"
/* defines the public API of views */
@@ -19,14 +20,10 @@ enum xy_mode { XY_LOOP_MODE, XY_FORCED_MODE };
view *new_view_stdout(void);
view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w);
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w,
int color, enum xy_mode mode);
view *new_view_tti(float refresh_rate, gui *g, widget *w, int color,
int ticks_per_frame);
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w,
int color, widget *throughput_label, int ticks_per_frame);
view *new_view_time(int number_of_seconds, float refresh_rate,
gui *g, widget *w);
view *new_view_xy(int length, float refresh_rate, gui *g, widget *w, int color, enum xy_mode mode);
view *new_view_tti(float refresh_rate, gui *g, widget *w, int color, int ticks_per_frame);
view *new_view_scrolltti(float refresh_rate, gui *g, widget *w, int color, widget *throughput_label, int ticks_per_frame);
view *new_view_time(float refresh_rate, gui *g, widget *w);
view *new_subview_time(view *time, int line, int color, int size);
view *new_view_ticktime(float refresh_rate, gui *g, widget *w);
view *new_subview_ticktime(view *ticktime, int line, int color, int size);
+1
View File
@@ -42,6 +42,7 @@ static void *xy_thread(void *_this)
static void clear(view *this)
{
/* TODO */
UNUSED(this);
}
static void append_loop(view *_this, float *x, float *y, int length)
+4 -1
View File
@@ -45,7 +45,10 @@ char *hashtable_rc_code2string(hashtable_rc_t rcP)
* hash_free_int_func() is used when this hashtable is used to store int values as data (pointer = value).
*/
void hash_free_int_func(void *memoryP) {}
void hash_free_int_func(void *memoryP)
{
UNUSED(memoryP);
}
//-------------------------------------------------------------------------------------------------------------------------------
/*
+2 -6
View File
@@ -284,12 +284,8 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
// Legacy, pthread_create + thread_top_init() should be replaced by threadCreate
// threadCreate encapsulates the posix pthread api
void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime,
uint64_t deadline,
uint64_t period) {
void thread_top_init(char *thread_name)
{
int policy, s, j;
struct sched_param sparam;
char cpu_affinity[1024];
+1 -5
View File
@@ -36,11 +36,7 @@ void threadCreate(pthread_t *t, void *(*func)(void *), void *param, char *name,
#define OAI_PRIORITY_RT ((sched_get_priority_min(SCHED_OAI)+sched_get_priority_max(SCHED_OAI))/2)
#define OAI_PRIORITY_RT_MAX sched_get_priority_max(SCHED_OAI)-2
void thread_top_init(char *thread_name,
int affinity,
uint64_t runtime,
uint64_t deadline,
uint64_t period);
void thread_top_init(char *thread_name);
/****************************************************
* Functions to check system at runtime.
+15 -11
View File
@@ -81,7 +81,6 @@ int get_phybsize(void) {
};
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
int setoutput(char *buff, int debug, telnet_printfunc_t prnt);
int wsetoutput(char *buff, int debug, telnet_printfunc_t prnt, ...);
int setparam(char *buff, int debug, telnet_printfunc_t prnt);
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...);
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt);
@@ -245,12 +244,9 @@ void redirstd(char *newfname,telnet_printfunc_t prnt ) {
}
}
int wsetoutput(char *buffer, int debug, telnet_printfunc_t prnt, ...)
int setoutput(char *buff, int debug, telnet_printfunc_t prnt)
{
return 0;
}
int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
UNUSED(debug);
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
char *logfname;
char stdout_str[64];
@@ -288,10 +284,16 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...)
{
UNUSED(buff);
UNUSED(debug);
UNUSED(prnt);
return 0;
}
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
int setparam(char *buff, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(prnt);
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
memset(cmds,0,sizeof(cmds));
sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
@@ -322,7 +324,9 @@ int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
return CMDSTATUS_NOTFOUND;
} /* setparam */
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) {
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
memset(cmds,0,sizeof(cmds));
sscanf(buff,"%9s %9s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
@@ -502,7 +506,7 @@ void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t
pushNotifiedFIFO(cmd->qptr, msg);
}
int process_command(char *buf, int iteration)
int process_command(char *buf)
{
int i,j,k;
char modulename[TELNET_CMD_MAXSIZE];
@@ -581,7 +585,7 @@ int process_command(char *buf, int iteration)
char tbuff[64];
client_printf(CSI "1J" CSI "1;10H " STDFMT "%s %i/%i\n",
get_time(tbuff,sizeof(tbuff)),lc,telnetparams.loopcount );
process_command(buf + strlen("loop") + 1, lc);
process_command(buf + strlen("loop") + 1);
errno=0;
int rs = read(telnetparams.new_socket,dummybuff,sizeof(dummybuff));
@@ -710,7 +714,7 @@ void run_telnetsrv(void) {
}
if (strlen(buf) > 2 ) {
status = process_command(buf, 0);
status = process_command(buf);
} else
status=CMDSTATUS_NOCMD;
@@ -28,6 +28,7 @@ static int get_single_ue_rnti(void)
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf)
ERROR_MSG_RET("no parameter allowed\n");
@@ -42,6 +43,7 @@ int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
//void rrc_gNB_trigger_new_bearer(int rnti);
int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int rnti = -1;
if (!buf) {
rnti = get_single_ue_rnti();
@@ -67,6 +69,7 @@ int add_bearer(char *buf, int debug, telnet_printfunc_t prnt)
//void rrc_gNB_trigger_release_bearer(int rnti);
int release_bearer(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int rnti = -1;
if (!buf) {
rnti = get_single_ue_rnti();
+10
View File
@@ -47,6 +47,7 @@ static int get_single_ue_rnti_mac(void)
int get_single_rnti(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf)
ERROR_MSG_RET("no parameter allowed\n");
@@ -81,6 +82,7 @@ rrc_gNB_ue_context_t *get_single_rrc_ue(void)
int get_reestab_count(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
rrc_gNB_ue_context_t *ue = NULL;
@@ -119,6 +121,7 @@ int fetch_rnti(char *buf, telnet_printfunc_t prnt)
int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrmac)
ERROR_MSG_RET("no MAC/RLC present, cannot trigger reestablishment\n");
int rnti = fetch_rnti(buf, prnt);
@@ -134,6 +137,7 @@ extern nr_rrc_du_container_t *get_du_for_ue(gNB_RRC_INST *rrc, uint32_t ue_id);
/** @brief Get connected DU by the UE ID */
int fetch_du_by_ue_id(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
@@ -169,6 +173,7 @@ extern void nr_HO_F1_trigger_telnet(gNB_RRC_INST *rrc, uint32_t rrc_ue_id);
*/
int rrc_gNB_trigger_f1_ho(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
rrc_gNB_ue_context_t *ue = NULL;
@@ -198,6 +203,7 @@ extern void nr_HO_N2_trigger_telnet(gNB_RRC_INST *rrc, uint32_t neighbour_pci, u
* @return 0 on success, -1 on failure */
int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrrrc)
ERROR_MSG_RET("no RRC present, cannot list counts\n");
@@ -238,6 +244,7 @@ int rrc_gNB_trigger_n2_ho(char *buf, int debug, telnet_printfunc_t prnt)
int force_ul_failure(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!RC.nrmac)
ERROR_MSG_RET("no MAC/RLC present, force_ul_failure failed\n");
int rnti = fetch_rnti(buf, prnt);
@@ -263,6 +270,7 @@ int force_ue_release(char *buf, int debug, telnet_printfunc_t prnt)
static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int rnti = fetch_rnti(buf, prnt);
if (rnti < 0)
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
@@ -288,6 +296,7 @@ static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
* @return 0 on success; negative value on error. */
static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf == NULL) {
ERROR_MSG_RET("Missing input. Usage: trigger_pdu_session_release [ue_id=gNB_ue_ngap_id(int,opt)],pdusession_id(int)[,pdusession_id(int)...]\n");
}
@@ -360,6 +369,7 @@ static int trigger_ngap_pdu_session_release(char *buf, int debug, telnet_printfu
static int trigger_bwp_switch(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
char *sbwpId = strtok(buf, " ");
int bwpId = atoi(sbwpId);
char *srnti = strtok(NULL, " ");
+16
View File
@@ -52,6 +52,7 @@ static int get_default_ue_id(void)
*/
int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int ue_id = -1;
if (!buf) {
ERROR_MSG_RET("no UE ID provided to telnet command\n");
@@ -71,6 +72,9 @@ int get_sync_state(char *buf, int debug, telnet_printfunc_t prnt)
*/
int force_rlf(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0);
handle_rlf_detection(rrc);
return 0;
@@ -81,6 +85,9 @@ int force_rlf(char *buf, int debug, telnet_printfunc_t prnt)
*/
int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
NR_UE_RRC_INST_t *rrc = get_NR_UE_rrc_inst(0);
nr_rrc_going_to_IDLE(rrc, OTHER, NULL);
return 0;
@@ -89,6 +96,9 @@ int force_RRC_IDLE(char *buf, int debug, telnet_printfunc_t prnt)
/** @brief Trigger RA with Msg3 C-RNTI */
int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
trigger_MAC_UE_RA(mac, NULL);
return 0;
@@ -96,6 +106,9 @@ int force_crnti_ra(char *buf, int debug, telnet_printfunc_t prnt)
static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
UNUSED(prnt);
MessageDef *msg = itti_alloc_new_message(TASK_NAS_NRUE, 0, NAS_DEREGISTRATION_REQ);
NAS_DEREGISTRATION_REQ(msg).cause = AS_DETACH;
itti_send_msg_to_task(TASK_NAS_NRUE, 0, msg);
@@ -105,6 +118,8 @@ static int force_deregistration(char *buf, int debug, telnet_printfunc_t prnt)
extern float get_prs_max_dl_toa(prs_meas_t *prs_meas);
static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
// TODO multiple antennas, resources, gNBs?
int gNB_id = 0;
int rsc_id = 0;
@@ -124,6 +139,7 @@ static int get_dl_toa(char *buf, int debug, telnet_printfunc_t prnt)
static int add_pdu_session(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
int ue_id = -1;
int pdusession_id = -1;
@@ -46,11 +46,15 @@ void dump_uestats(int debug, telnet_printfunc_t prnt, uint8_t prntflag) {
}
void display_uestats(int debug, telnet_printfunc_t prnt, int ue) {
UNUSED(debug);
UNUSED(prnt);
UNUSED(ue);
for (int cc=0; cc<1 ; cc++) {
}
}
void display_phycounters(char *buf, int debug, telnet_printfunc_t prnt) {
UNUSED(buf);
prnt(" DLSCH kb DLSCH kb/s\n");
dump_uestats(debug, prnt,0);
}
@@ -206,6 +206,7 @@ int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt) {
}
void measurcmd_async_help(telnet_printfunc_t prnt) {
UNUSED(prnt);
}
int measurcmd_async(char *buf, int debug, telnet_printfunc_t prnt) {
+9
View File
@@ -62,6 +62,7 @@ typedef struct ue_stat {
static int get_stats(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (buf)
ERROR_MSG_RET("no parameter allowed\n");
@@ -209,6 +210,7 @@ static int read_long(const char *buf, const char *end, const char *id, long *val
bool running = true; // in the beginning, the softmodem is started automatically
static int set_config(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (!buf)
ERROR_MSG_RET("need param: o1 config param1 val1 [param2 val2 ...]\n");
if (running)
@@ -271,6 +273,7 @@ static int set_config(char *buf, int debug, telnet_printfunc_t prnt)
static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
if (running)
ERROR_MSG_RET("cannot set parameters while L1 is running\n");
if (!buf)
@@ -344,6 +347,8 @@ static int set_bwconfig(char *buf, int debug, telnet_printfunc_t prnt)
extern int stop_L1(module_id_t gnb_id);
static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
if (!running)
ERROR_MSG_RET("cannot stop, nr-softmodem not running\n");
@@ -366,6 +371,8 @@ static int stop_modem(char *buf, int debug, telnet_printfunc_t prnt)
extern int start_L1L2(module_id_t gnb_id);
static int start_modem(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
if (running)
ERROR_MSG_RET("cannot start, nr-softmodem already running\n");
start_L1L2(0);
@@ -377,6 +384,8 @@ static int start_modem(char *buf, int debug, telnet_printfunc_t prnt)
extern void du_clear_all_ue_states();
static int remove_mac_ues(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
du_clear_all_ue_states();
prnt("OK\n");
return 0;
+8 -6
View File
@@ -36,6 +36,7 @@
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt, webdatadef_t *tdata)
{
UNUSED(debug);
char prntline[160];
char *procfile_fields;
char *strtokptr;
@@ -169,10 +170,11 @@ char arecord[1024];
int nullprnt(char *fmt, ...)
{
UNUSED(fmt);
return 0;
}
void proccmd_get_threaddata(char *buf, int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
void proccmd_get_threaddata(int debug, telnet_printfunc_t fprnt, webdatadef_t *tdata)
{
char aname[256];
@@ -222,9 +224,9 @@ char aname[256];
closedir(proc_dir);
} /* proccmd_get_threaddata */
void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
void print_threads(int debug, telnet_printfunc_t prnt)
{
proccmd_get_threaddata(buf, debug, prnt, NULL);
proccmd_get_threaddata(debug, prnt, NULL);
}
#define FLAG_PRINT_DEBUG_DUMP(flag) \
@@ -349,7 +351,7 @@ int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfun
}
}
if (strcasestr(cmdbuff, "threadsched") != NULL) {
proccmd_get_threaddata(cmdbuff, debug, prnt, (webdatadef_t *)data);
proccmd_get_threaddata(debug, prnt, (webdatadef_t *)data);
}
} // show
@@ -373,7 +375,7 @@ int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
if (debug > 0)
prnt(" proccmd_show received %s\n",buf);
if (strcasestr(buf,"thread") != NULL) {
print_threads(buf,debug,prnt);
print_threads(debug, prnt);
}
if (strcasestr(buf,"loglvl") != NULL) {
prnt("\n component level enabled output\n");
@@ -466,7 +468,7 @@ if (buf == NULL) {
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
if(res != 3)
{
print_threads(buf, debug, prnt);
print_threads(debug, prnt);
return 0;
}
+3
View File
@@ -53,6 +53,7 @@ static int get_single_ue_id(void)
*/
int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
ue_id_t ue_id = -1;
if (!buf) {
@@ -91,6 +92,8 @@ int rrc_gNB_trigger_release(char *buf, int debug, telnet_printfunc_t prnt)
*/
int rrc_gNB_trigger_release_all(char *buf, int debug, telnet_printfunc_t prnt)
{
UNUSED(debug);
UNUSED(buf);
rrc_gNB_ue_context_t *ue_context_p = NULL;
gNB_RRC_INST *rrc = RC.nrrrc[0];
+1
View File
@@ -26,6 +26,7 @@ static int tick_functions_count;
*/
static void tick(void *unused)
{
UNUSED(unused);
for (int i = 0; i < tick_functions_count; i++)
tick_functions[i]();
}
+2 -3
View File
@@ -35,10 +35,9 @@ double get_cpu_freq_GHz(void)
void print_meas_now(time_stats_t *ts,
const char *name,
FILE *file_name)
void print_meas_now(time_stats_t *ts, const char *name, FILE *file_name)
{
UNUSED(name);
if (cpu_meas_enabled) {
//static double cpu_freq_GHz = 3.2;