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