mirror of https://github.com/PentHertz/srsLTE.git
add UE parameter to enable TTI stats calculations
This commit is contained in:
parent
a8bbe551ac
commit
8e4f2a4d59
|
@ -66,6 +66,7 @@ typedef struct {
|
||||||
std::string ue_category_str;
|
std::string ue_category_str;
|
||||||
nas_args_t nas;
|
nas_args_t nas;
|
||||||
gw_args_t gw;
|
gw_args_t gw;
|
||||||
|
bool have_tti_time_stats;
|
||||||
} stack_args_t;
|
} stack_args_t;
|
||||||
|
|
||||||
class ue_stack_base
|
class ue_stack_base
|
||||||
|
|
|
@ -366,7 +366,11 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
|
||||||
|
|
||||||
("general.metrics_csv_filename",
|
("general.metrics_csv_filename",
|
||||||
bpo::value<string>(&args->general.metrics_csv_filename)->default_value("/tmp/ue_metrics.csv"),
|
bpo::value<string>(&args->general.metrics_csv_filename)->default_value("/tmp/ue_metrics.csv"),
|
||||||
"Metrics CSV filename");
|
"Metrics CSV filename")
|
||||||
|
|
||||||
|
("stack.have_tti_time_stats",
|
||||||
|
bpo::value<bool>(&args->stack.have_tti_time_stats)->default_value(true),
|
||||||
|
"Calculate TTI execution statistics");
|
||||||
|
|
||||||
// Positional options - config file location
|
// Positional options - config file location
|
||||||
bpo::options_description position("Positional options");
|
bpo::options_description position("Positional options");
|
||||||
|
|
|
@ -295,8 +295,15 @@ void ue_stack_lte::run_tti_impl(uint32_t tti)
|
||||||
nas.run_tti(tti);
|
nas.run_tti(tti);
|
||||||
timers.step_all();
|
timers.step_all();
|
||||||
|
|
||||||
auto end = std::chrono::steady_clock::now();
|
if (args.have_tti_time_stats) {
|
||||||
calc_tti_stats(std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
|
auto end = std::chrono::steady_clock::now();
|
||||||
|
calc_tti_stats(std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
|
||||||
|
}
|
||||||
|
|
||||||
|
// print warning if PHY pushes new TTI messages faster than we process them
|
||||||
|
if (pending_tasks.size(sync_queue_id) > SYNC_QUEUE_WARN_THRESHOLD) {
|
||||||
|
log.warning("Detected slow task processing (sync_queue_len=%zd).\n", pending_tasks.size(sync_queue_id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ue_stack_lte::calc_tti_stats(const uint32_t duration_us)
|
void ue_stack_lte::calc_tti_stats(const uint32_t duration_us)
|
||||||
|
@ -319,11 +326,6 @@ void ue_stack_lte::calc_tti_stats(const uint32_t duration_us)
|
||||||
|
|
||||||
proc_time.clear();
|
proc_time.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// print warning if PHY pushes new TTI messages faster than we process them
|
|
||||||
if (pending_tasks.size(sync_queue_id) > SYNC_QUEUE_WARN_THRESHOLD) {
|
|
||||||
log.warning("Detected slow task processing (sync_queue_len=%zd).\n", pending_tasks.size(sync_queue_id));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************
|
/********************
|
||||||
|
|
|
@ -348,8 +348,11 @@ enable = false
|
||||||
#
|
#
|
||||||
# metrics_csv_filename: File path to use for CSV metrics.
|
# metrics_csv_filename: File path to use for CSV metrics.
|
||||||
#
|
#
|
||||||
|
# have_tti_time_stats: Calculate TTI execution statistics using system clock
|
||||||
|
#
|
||||||
#####################################################################
|
#####################################################################
|
||||||
[general]
|
[general]
|
||||||
#metrics_csv_enable = false
|
#metrics_csv_enable = false
|
||||||
#metrics_period_secs = 1
|
#metrics_period_secs = 1
|
||||||
#metrics_csv_filename = /tmp/ue_metrics.csv
|
#metrics_csv_filename = /tmp/ue_metrics.csv
|
||||||
|
#have_tti_time_stats = true
|
Loading…
Reference in New Issue