mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
Final fixes for 6.0
- plugins physical address changes - syscall tracking plugin - plugin kernel-doc comments (without integration) - libfdt build fix for guest-loader -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAmBRrXsACgkQ+9DbCVqe KkSK1gf+OCHGtOA/ECTldgFnj8pQcZFs7qWLLDaNiI8Oe0Og+2m71lQkZ4SErMC5 MgQvEi+EapddFCxTpHcChmp/e3czexed6eFvIUD0ZXbEFChAifCGZSUtWrU/MCwm hY8QDBK9pVVCgb7HacxzKpjVmjJtI8bjyaRW07ZYzX9/9KYxe6KOfT7/BK1rVWzK aozd9ZkK0qXChCMi6lx5r7RogeN+5Ewvy5WDysjG68QNBKMTwuxF31OGqSYhsmEy UVNUrD+Fymh6OhHYw7/uGk2bHIEMYaUxfNtwecExC/hza+u///fOhhSGuvDmy4eE Dr+Iu44yCvr+QnGQvDoTMyMHCYP3LA== =IYA4 -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/stsquad/tags/pull-misc-6.0-updates-170321-2' into staging Final fixes for 6.0 - plugins physical address changes - syscall tracking plugin - plugin kernel-doc comments (without integration) - libfdt build fix for guest-loader # gpg: Signature made Wed 17 Mar 2021 07:19:23 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-misc-6.0-updates-170321-2: hw/core: Only build guest-loader if libfdt is available plugins: Fixes typo in qemu-plugin.h plugins: getting qemu_plugin_get_hwaddr only expose one function prototype plugins: expand kernel-doc for memory query and instrumentation plugins: expand kernel-doc for instruction query and instrumentation plugins: expand inline exec kernel-doc documentation. plugins: add qemu_plugin_id_t to kernel-doc plugins: add qemu_plugin_cb_flags to kernel-doc plugins: expand the typedef kernel-docs for translation plugins: expand the callback typedef kernel-docs plugins: cleanup kernel-doc for qemu_plugin_install plugins: expand kernel-doc for qemu_info_t plugins: Expose physical addresses instead of device offsets plugins: new syscalls plugin utils: Use fixed-point arithmetic in qemu_strtosz Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
6e71c36557
8 changed files with 261 additions and 59 deletions
|
@ -1,5 +1,5 @@
|
|||
t = []
|
||||
foreach i : ['bb', 'empty', 'insn', 'mem']
|
||||
foreach i : ['bb', 'empty', 'insn', 'mem', 'syscall']
|
||||
t += shared_module(i, files(i + '.c'),
|
||||
include_directories: '../../include/qemu',
|
||||
dependencies: glib)
|
||||
|
|
49
tests/plugin/syscall.c
Normal file
49
tests/plugin/syscall.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (C) 2020, Matthias Weckbecker <matthias@weckbecker.name>
|
||||
*
|
||||
* License: GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include <qemu-plugin.h>
|
||||
|
||||
QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
|
||||
|
||||
static void vcpu_syscall(qemu_plugin_id_t id, unsigned int vcpu_index,
|
||||
int64_t num, uint64_t a1, uint64_t a2,
|
||||
uint64_t a3, uint64_t a4, uint64_t a5,
|
||||
uint64_t a6, uint64_t a7, uint64_t a8)
|
||||
{
|
||||
g_autofree gchar *out = g_strdup_printf("syscall #%" PRIi64 "\n", num);
|
||||
qemu_plugin_outs(out);
|
||||
}
|
||||
|
||||
static void vcpu_syscall_ret(qemu_plugin_id_t id, unsigned int vcpu_idx,
|
||||
int64_t num, int64_t ret)
|
||||
{
|
||||
g_autofree gchar *out;
|
||||
out = g_strdup_printf("syscall #%" PRIi64 " returned -> %" PRIi64 "\n",
|
||||
num, ret);
|
||||
qemu_plugin_outs(out);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
static void plugin_exit(qemu_plugin_id_t id, void *p) {}
|
||||
|
||||
QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
|
||||
const qemu_info_t *info,
|
||||
int argc, char **argv)
|
||||
{
|
||||
qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall);
|
||||
qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret);
|
||||
qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue