On 10/14/19 3:49 AM, Alex Bennée wrote:
> Having the plugins grab stdout and spew stuff there is a bit ugly and
> certainly makes the tests look ugly. Provide a hook back into QEMU
> which can be redirected as needed.
> 
> For the newer plugins that use GString already this falls out pretty
> naturally. For the older printf style plugins we convert to
> g_strdup_printf and pass that. While we are at it we can use
> g_autoptr/g_autofree to let the compiler worry about freeing things.
> 
> Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
> ---
>  include/qemu/log.h           |  1 +
>  include/qemu/qemu-plugin.h   |  6 ++++++
>  plugins/api.c                |  8 ++++++++
>  plugins/qemu-plugins.symbols |  1 +
>  tests/plugin/bb.c            | 12 +++++-------
>  tests/plugin/hotblocks.c     | 10 ++--------
>  tests/plugin/hotpages.c      | 12 +++---------
>  tests/plugin/howvec.c        | 15 ++-------------
>  tests/plugin/insn.c          | 10 ++++------
>  tests/plugin/mem.c           | 12 ++++++------
>  tests/tcg/Makefile.target    |  2 ++
>  util/log.c                   |  3 +++
>  12 files changed, 43 insertions(+), 49 deletions(-)

This also would be better sorted earlier, and the plugins done once.


r~

Reply via email to