@@ -17,12 +17,23 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
+#include "qemu/plugins.h"
#include "qemu.h"
#ifdef CONFIG_GCOV
extern void __gcov_dump(void);
#endif
+static void plugin_report(void)
+{
+#ifdef CONFIG_TRACE_PLUGIN
+ GString *plugin_report = qemu_plugin_status("");
+ qemu_log_mask(LOG_TRACE, "%s", plugin_report->str);
+ g_string_free(plugin_report, true);
+#endif
+}
+
+
void preexit_cleanup(CPUArchState *env, int code)
{
#ifdef TARGET_GPROF
@@ -31,5 +42,6 @@ void preexit_cleanup(CPUArchState *env, int code)
#ifdef CONFIG_GCOV
__gcov_dump();
#endif
+ plugin_report();
gdb_exit(env, code);
}
@@ -288,6 +288,8 @@ const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_NOCHAIN, "nochain",
"do not chain compiled TBs so that \"exec\" and \"cpu\" show\n"
"complete traces" },
+ { LOG_TRACE, "plugin",
+ "show summary plugin information at end of run." },
{ 0, NULL, NULL },
};
As we don't have a monitor in linux-user mode we need some way of exporting our data to the world. We introduce a new -d option (plugin) which turns on the existing LOG_TRACE flag which qemu_plugin_status() will dump output to before we finally exit. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- linux-user/exit.c | 12 ++++++++++++ util/log.c | 2 ++ 2 files changed, 14 insertions(+) -- 2.17.1