|
|
|
@ -38,6 +38,7 @@
|
|
|
|
|
|
|
|
|
|
#include "ue.h"
|
|
|
|
|
#include "metrics_stdout.h"
|
|
|
|
|
#include "srslte/common/metrics_hub.h"
|
|
|
|
|
#include "srslte/version.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
@ -320,13 +321,13 @@ void parse_args(all_args_t *args, int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
static bool running = true;
|
|
|
|
|
static bool do_metrics = false;
|
|
|
|
|
metrics_stdout metrics_screen;
|
|
|
|
|
|
|
|
|
|
void sig_int_handler(int signo) {
|
|
|
|
|
running = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *input_loop(void *m) {
|
|
|
|
|
metrics_stdout *metrics = (metrics_stdout *) m;
|
|
|
|
|
char key;
|
|
|
|
|
while (running) {
|
|
|
|
|
cin >> key;
|
|
|
|
@ -337,7 +338,7 @@ void *input_loop(void *m) {
|
|
|
|
|
} else {
|
|
|
|
|
cout << "Enter t to restart trace." << endl;
|
|
|
|
|
}
|
|
|
|
|
metrics->toggle_print(do_metrics);
|
|
|
|
|
metrics_screen.toggle_print(do_metrics);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
@ -345,6 +346,7 @@ void *input_loop(void *m) {
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
srslte::metrics_hub<ue_metrics_t> metricshub;
|
|
|
|
|
signal(SIGINT, sig_int_handler);
|
|
|
|
|
all_args_t args;
|
|
|
|
|
parse_args(&args, argc, argv);
|
|
|
|
@ -361,11 +363,12 @@ int main(int argc, char *argv[])
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
metrics_stdout metrics;
|
|
|
|
|
metrics.init(ue, args.expert.metrics_period_secs);
|
|
|
|
|
|
|
|
|
|
metricshub.init(ue, args.expert.metrics_period_secs);
|
|
|
|
|
metricshub.add_listener(&metrics_screen);
|
|
|
|
|
|
|
|
|
|
pthread_t input;
|
|
|
|
|
pthread_create(&input, NULL, &input_loop, &metrics);
|
|
|
|
|
pthread_create(&input, NULL, &input_loop, &args);
|
|
|
|
|
|
|
|
|
|
bool plot_started = false;
|
|
|
|
|
bool signals_pregenerated = false;
|
|
|
|
@ -383,7 +386,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
sleep(1);
|
|
|
|
|
}
|
|
|
|
|
pthread_cancel(input);
|
|
|
|
|
metrics.stop();
|
|
|
|
|
metricshub.stop();
|
|
|
|
|
ue->stop();
|
|
|
|
|
ue->cleanup();
|
|
|
|
|
cout << "--- exiting ---" << endl;
|
|
|
|
|