Commit 93cadc9d authored by Robert Schmidt's avatar Robert Schmidt

Truncate nrL1_stats.log before writing

Without this, the remainder of the file remains in place, and this can
be confusing if the total file size reduces.
parent 48faffc1
......@@ -314,13 +314,16 @@ void *nrL1_stats_thread(void *param) {
reset_meas(&gNB->dlsch_precoding_stats);
while (!oai_exit) {
sleep(1);
if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) {
LOG_E(NR_MAC, "error while writing nrL1_stats.log: %d, %s\n", errno, strerror(errno));
break;
}
dump_nr_I0_stats(fd,gNB);
dump_pdsch_stats(fd,gNB);
dump_pusch_stats(fd,gNB);
dump_L1_meas_stats(gNB, ru, output, L1STATSSTRLEN);
fprintf(fd,"%s\n",output);
fflush(fd);
fseek(fd,0,SEEK_SET);
}
fclose(fd);
return(NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment