mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-17 05:38:33 +03:00
implement minimalistic talloc_report(); add 't' command on UART
This helps when debugging the firmware, as it shows the current utliization of the 10-msgb-talloc pool. Change-Id: Ib10c4396cd4c9c4a6257cf45886e367214787927 Related: OS#4251
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "talloc.h"
|
||||
#include "trace.h"
|
||||
@@ -76,6 +77,20 @@ int _talloc_free(void *ptr, const char *location)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void talloc_report(const void *ptr, FILE *f)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
fprintf(f, "talloc_report(): ");
|
||||
for (i = 0; i < ARRAY_SIZE(msgb_inuse); i++) {
|
||||
if (msgb_inuse[i])
|
||||
fputc('X', f);
|
||||
else
|
||||
fputc('_', f);
|
||||
}
|
||||
fprintf(f, "\r\n");
|
||||
}
|
||||
|
||||
void talloc_set_name_const(const void *ptr, const char *name)
|
||||
{
|
||||
/* do nothing */
|
||||
|
||||
Reference in New Issue
Block a user