print summary about allocated buffers when buffer pool is full

This commit is contained in:
Andre Puschmann 2018-02-22 13:51:20 +01:00
parent 3dddae0566
commit a85288566b
1 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,8 @@
#include <pthread.h>
#include <vector>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
/*******************************************************************************
@ -76,8 +78,13 @@ public:
{
printf("%d buffers in queue\n", (int) used.size());
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
std::map<std::string, uint32_t> buffer_cnt;
for (uint32_t i=0;i<used.size();i++) {
printf("%s\n", strlen(used[i]->debug_name)?used[i]->debug_name:"Undefined");
buffer_cnt[strlen(used[i]->debug_name)?used[i]->debug_name:"Undefined"]++;
}
std::map<std::string, uint32_t>::iterator it;
for (it = buffer_cnt.begin(); it != buffer_cnt.end(); it++) {
printf(" - %dx %s\n", it->second, it->first.c_str());
}
#endif
}