xref: /openbmc/qemu/include/tcg/perf.h (revision e9206163)
1 /*
2  * Linux perf perf-<pid>.map and jit-<pid>.dump integration.
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  */
6 
7 #ifndef TCG_PERF_H
8 #define TCG_PERF_H
9 
10 #if defined(CONFIG_TCG) && defined(CONFIG_LINUX)
11 /* Start writing perf-<pid>.map. */
12 void perf_enable_perfmap(void);
13 
14 /* Start writing jit-<pid>.dump. */
15 void perf_enable_jitdump(void);
16 
17 /* Add information about TCG prologue to profiler maps. */
18 void perf_report_prologue(const void *start, size_t size);
19 
20 /* Add information about JITted guest code to profiler maps. */
21 void perf_report_code(uint64_t guest_pc, TranslationBlock *tb,
22                       const void *start);
23 
24 /* Stop writing perf-<pid>.map and/or jit-<pid>.dump. */
25 void perf_exit(void);
26 #else
27 static inline void perf_enable_perfmap(void)
28 {
29 }
30 
31 static inline void perf_enable_jitdump(void)
32 {
33 }
34 
35 static inline void perf_report_prologue(const void *start, size_t size)
36 {
37 }
38 
39 static inline void perf_report_code(uint64_t guest_pc, TranslationBlock *tb,
40                                     const void *start)
41 {
42 }
43 
44 static inline void perf_exit(void)
45 {
46 }
47 #endif
48 
49 #endif
50