* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "tcg/perf.h"
+#include "gdbstub/syscalls.h"
#include "qemu.h"
-#ifdef CONFIG_GPROF
-#include <sys/gmon.h>
-#endif
+#include "user-internals.h"
+#include "qemu/plugin.h"
#ifdef CONFIG_GCOV
extern void __gcov_dump(void);
void preexit_cleanup(CPUArchState *env, int code)
{
-#ifdef CONFIG_GPROF
- _mcleanup();
-#endif
#ifdef CONFIG_GCOV
__gcov_dump();
#endif
- gdb_exit(env, code);
- qemu_plugin_atexit_cb();
+ gdb_exit(code);
+ qemu_plugin_user_exit();
+ perf_exit();
}