forked from emul8/tlib
-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathprofile-helper.c
More file actions
27 lines (23 loc) · 897 Bytes
/
profile-helper.c
File metadata and controls
27 lines (23 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "tcg/additional.h"
#ifdef GENERATE_PERF_MAP
/*
We place the helper here, since TB internals require cpu.h to be included,
so this is the only util of the labeling pack, that has to be compiled
not into tcg, but into tlibs.
*/
#include "cpu.h"
#include "include/infrastructure.h"
#include <stdio.h>
int tcg_perf_tb_info_to_string(TranslationBlock *tb, char *buffer, int maxsize)
{
snprintf(buffer, maxsize, ";addr:%p;size:%x;jmp_next:%p,%p;jmp_first:%p,icount:%d;", &(*tb), tb->size, tb->jmp_next[0],
tb->jmp_next[1], tb->jmp_first, tb->icount);
return strlen(buffer);
}
void tcg_perf_out_symbol_from_tb(TranslationBlock *tb, int host_size, const char *comment)
{
tcg_perf_out_symbol_s(tb->tc_ptr, host_size, comment, tb);
}
#else
inline void tcg_perf_out_symbol_from_tb(struct TranslationBlock *tb, int host_size, const char *comment) { }
#endif