Skip to content

Commit

Permalink
typeinfo_alloc_generic stat
Browse files Browse the repository at this point in the history
  • Loading branch information
chzchzchz committed Sep 26, 2010
1 parent 56042dd commit 2a46e75
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ static void fsl_rt_dump_stats(struct fsl_rt_ctx* fctx)
fctx->fctx_stat.s_dyn_copy_c);
fprintf(out_file, "dyn_alloc %"PRIu64"\n",
fctx->fctx_stat.s_dyn_alloc_c);
fprintf(out_file, "typeinfo_alloc %"PRIu64"\n",
fctx->fctx_stat.s_typeinfo_alloc_generic_c);


if (stat_fname != NULL)
fclose(out_file);
Expand Down
1 change: 1 addition & 0 deletions src/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct fsl_rt_stat
uint64_t s_get_offset_c;
uint64_t s_dyn_copy_c;
uint64_t s_dyn_alloc_c;
uint64_t s_typeinfo_alloc_generic_c;
};

#include "io.h"
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/scantool.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static void scan_type(struct type_info* ti)
unsigned int i;

DEBUG_TOOL_ENTER();
DEBUG_TOOL_WRITE("scanning: %s (%d usertypes) voff=%"PRIu64" bits. poff=%"PRIu64" bits. xlate=%p",
printf("scanning: %s (%d usertypes) voff=%"PRIu64" bits. poff=%"PRIu64" bits. xlate=%p\n",
tt_by_ti(ti)->tt_name,
tt_by_ti(ti)->tt_field_c,
ti_offset(ti),
Expand Down
2 changes: 2 additions & 0 deletions src/runtime/type_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ static struct type_info* typeinfo_alloc_generic(
struct fsl_rt_table_type *tt;
struct type_info *ret;

fsl_env->fctx_stat.s_typeinfo_alloc_generic_c++;

ret = malloc(sizeof(struct type_info));

/* set typenum */
Expand Down

0 comments on commit 2a46e75

Please sign in to comment.