History

tcc -bench: show text/data/bss binary output sizes

grischka committed 6 years ago

Commit cdc3df91 parent ae1796f3 files · +9 −0Browse files

Unified · Split

3 files
  1. libtcc.c +2 −0
  2. tcc.h +1 −0
  3. tccelf.c +6 −0
libtcc.c+2−0
@@ -2115,6 +2115,8 @@ PUB_FUNC void tcc_print_stats(TCCState *s1, unsigned total_time) · 2114 unmodified lines
2115 (double)total_time/1000,2115 (double)total_time/1000,
2116 (unsigned)total_lines*1000/total_time,2116 (unsigned)total_lines*1000/total_time,
2117 (double)total_bytes/1000/total_time);2117 (double)total_bytes/1000/total_time);
2118 fprintf(stderr, "* text %d, data %d, bss %d bytes\n",
2119 s1->total_output[0], s1->total_output[1], s1->total_output[2]);
2118#ifdef MEM_DEBUG2120#ifdef MEM_DEBUG
2119 fprintf(stderr, "* %d bytes memory used\n", mem_max_size);2121 fprintf(stderr, "* %d bytes memory used\n", mem_max_size);
2120#endif2122#endif
tcc.h+1−0
@@ -918,6 +918,7 @@ struct TCCState { · 917 unmodified lines
918 int total_idents;918 int total_idents;
919 int total_lines;919 int total_lines;
920 int total_bytes;920 int total_bytes;
921 int total_output[3];
921 922
922 /* option -dnum (for general development purposes) */923 /* option -dnum (for general development purposes) */
923 int g_debug;924 int g_debug;
tccelf.c+6−0
@@ -202,6 +202,12 @@ ST_FUNC void tccelf_end_file(TCCState *s1) · 201 unmodified lines
202 }202 }
203 }203 }
204 tcc_free(tr);204 tcc_free(tr);
205
206 /* record text/data/bss output for -bench info */
207 for (i = 0; i < 3; ++i) {
208 s = s1->sections[i + 1];
209 s1->total_output[i] += s->data_offset - s->sh_offset;
210 }
205}211}
206 212
207ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags)213ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t