Cover Letter Detail
Show a cover letter.
GET /api/covers/813272/?format=api
{ "id": 813272, "url": "http://patchwork.ozlabs.org/api/covers/813272/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/cover/150529642278.10902.18234057937634437857.stgit@frigg.lan/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<150529642278.10902.18234057937634437857.stgit@frigg.lan>", "list_archive_url": null, "date": "2017-09-13T09:53:43", "name": "[v6,00/22] instrument: Add basic event instrumentation", "submitter": { "id": 9099, "url": "http://patchwork.ozlabs.org/api/people/9099/?format=api", "name": "Lluís Vilanova", "email": "vilanova@ac.upc.edu" }, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/cover/150529642278.10902.18234057937634437857.stgit@frigg.lan/mbox/", "series": [ { "id": 2857, "url": "http://patchwork.ozlabs.org/api/series/2857/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2857", "date": "2017-09-13T09:53:43", "name": "instrument: Add basic event instrumentation", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/2857/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/813272/comments/", "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xscW0326cz9s76\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 19:56:12 +1000 (AEST)", "from localhost ([::1]:41283 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ds4Ow-0006Iv-Ka\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 05:56:10 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:59720)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vilanova@ac.upc.edu>) id 1ds4Mo-0004pa-4q\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:53:59 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <vilanova@ac.upc.edu>) id 1ds4Mj-0002FT-0R\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:53:58 -0400", "from roura.ac.upc.es ([147.83.33.10]:56147)\n\tby eggs.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vilanova@ac.upc.edu>) id 1ds4Mi-0002F1-G0\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:53:52 -0400", "from correu-1.ac.upc.es (correu-1.ac.upc.es [147.83.30.91])\n\tby roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v8D9rnEa007565;\n\tWed, 13 Sep 2017 11:53:49 +0200", "from localhost (unknown [132.68.137.204])\n\tby correu-1.ac.upc.es (Postfix) with ESMTPSA id 4F14013E;\n\tWed, 13 Sep 2017 11:53:44 +0200 (CEST)" ], "From": "=?utf-8?b?TGx1w61z?= Vilanova <vilanova@ac.upc.edu>", "To": "qemu-devel@nongnu.org", "Date": "Wed, 13 Sep 2017 12:53:43 +0300", "Message-Id": "<150529642278.10902.18234057937634437857.stgit@frigg.lan>", "X-Mailer": "git-send-email 2.14.1", "User-Agent": "StGit/0.18", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "quoted-printable", "X-MIME-Autoconverted": "from 8bit to quoted-printable by roura.ac.upc.es id\n\tv8D9rnEa007565", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy]", "X-Received-From": "147.83.33.10", "Subject": "[Qemu-devel] [PATCH v6 00/22] instrument: Add basic event\n\tinstrumentation", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "\"Emilio G. Cota\" <cota@braap.org>, Markus Armbruster <armbru@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "This series adds an API to add instrumentation events.\n\nIt also provides additional APIs for:\n* Controlling tracing events.\n* Peek/poke guest memory.\n\nTODO:\n* Replace qi_event_gen_* with generating calls to arbitrary functions (e.g.,\n qi_event_gen_call(num_args, va_list)).\n* Flush all TBs when an execution-time event is unset (to ensure it won't be\n called in the future).\n* Flush all TBs when a translation-time event is set (to ensure no future events\n will be lost).\n\nUndecided:\n* Alternatively to the two last points above, provide an API to request a TB\n flush (much more flexible and can be more efficient, but requires instrumentor\n to clearly know differences between translation and execution).\n* Pass a user-provided pointer to events (i.e., to avoid using global\n variables).\n* Provide something like tracing's per-vCPU trace states (i.e., so that each\n vCPU can have different instrumentation code). Useful mainly for sampling\n (enable/disable instrumentation multiple times without re-translating guest\n code) and more complex use cases like tracing a guest process in softmmu mode.\n It's still not clear to me if we should extend the per-vCPU bitmap with\n instrumentation events, or otherwise somehow reuse the bits in tracing events\n (since they're currently limited).\n* Allow multiple callbacks per event (both to support multiple callbacks\n installed by a library, and multiple libraries at the same time).\n* Allow instr libraries to iterate on the list of guest CPUs (info is already\n available through guest_cpu_enter/guest_cpu_exit, but forces libs to be\n prepared for hot-plugging guest CPUs).\n\nFuture APIs (for later series):\n* Peek/poke guest registers.\n* Add breakpoints to trigger instrumentation functions.\n* Trigger instrumentation functions from guest code (former hypertrace).\n* Add events for guest code translation/execution (once the respective tracing\n events are accepted upstream).\n* Add events for exceptions/syscalls.\n* Add events for TB invalidation (necessary for libraries to deallocate any data\n they might have allocated for the TBs they instrumented).\n\nThe instrumentation code is dynamically loaded as a library into QEMU either\nwhen it starts or later using its remote control interfaces. The loaded code\nonly has access to function explicitly exported through the QI_VPUBLIC macro.\n\nThis series is branch 'devel-instrument' in\nhttps://code.gso.ac.upc.edu/git/qemu-dbi.\n\nSigned-off-by: Lluís Vilanova <vilanova@ac.upc.edu>\n---\n\nChanges in v6\n=============\n\n* Fix a minor style warning.\n* Fix a minor compilation error.\n\n\nChanges in v5\n=============\n\n* Rebase on fcea73709b.\n* Minor changes to pass checkpatch.\n* Fix symbol availability to external libraries by adding missing default symbol\n visibility flag.\n* Use a string to identify instrumentation handles [Markus Armbruster].\n* Use stubs for command line initialization.\n* Use stubs to signal unsupported QAPI commands [Markus Armbruster].\n* Use error messages instead of codes in QAPI commands [Markus Armbruster].\n* Move symbol visibility macros to internal \"qemu/compiler.h\" header.\n* Trigger event 'guest_cpu_enter' when library is loaded.\n* Trigger event 'guest_cpu_exit' and flush TBs when library is unloaded.\n* Rename instr_cpu_get/instr_cpu_set into clearer\n instr_cpu_to_qicpu/instr_cpu_from_qicpu.\n* Rename handle_get/handle_put to clearer handle_new/handle_destroy.\n* Ensure qi_event_set_* are called only on the proper mode and targets.\n\n\nChanges in v4\n=============\n\n* Add missing stub function.\n\n\nChanges in v3\n=============\n\n* Use a separate event set for instrumentation (i.e., do not instrument tracing\n events) [Stefan Hajnoczi].\n* Add API for peek/poke guest memory.\n\n\nChanges in v2\n=============\n\n* Update QEMU version in QAPI [Eric Blake].\n* Clarify 'msg' result in QAPI is for humans only.\n* Make 'msg' and 'handle' results optional in QAPI.\n* Use a list of 'str' in 'instr-load' QAPI command.\n* Update MAINTAINERS.\n* Add macros for error-reporting in API.\n\n\nLluís Vilanova (22):\n instrument: Add documentation\n instrument: Add configure-time flag\n instrument: Add generic library loader\n instrument: [linux-user] Add command line library loader\n instrument: [bsd-user] Add command line library loader\n instrument: [softmmu] Add command line library loader\n instrument: [qapi] Add library loader\n instrument: [hmp] Add library loader\n instrument: Add basic control interface\n instrument: Add support for tracing events\n instrument: Track vCPUs\n instrument: Add event 'guest_cpu_enter'\n instrument: Support synchronous modification of vCPU state\n exec: Add function to synchronously flush TB on a stopped vCPU\n instrument: Add event 'guest_cpu_exit'\n instrument: Add event 'guest_cpu_reset'\n trace: Introduce a proper structure to describe memory accesses\n instrument: Add event 'guest_mem_before_trans'\n instrument: Add event 'guest_mem_before_exec'\n instrument: Add event 'guest_user_syscall'\n instrument: Add event 'guest_user_syscall_ret'\n instrument: Add API to manipulate guest memory\n\n\n .gitignore | 1 \n MAINTAINERS | 8 +\n Makefile | 8 +\n Makefile.objs | 4 +\n Makefile.target | 1 \n accel/stubs/tcg-stub.c | 3 \n accel/tcg/translate-all.c | 7 +\n bsd-user/main.c | 17 ++\n bsd-user/syscall.c | 14 ++\n configure | 13 ++\n cpus-common.c | 9 +\n docs/instrument.txt | 173 ++++++++++++++++++++++\n hmp-commands.hx | 32 ++++\n include/exec/cpu_ldst_template.h | 19 +-\n include/exec/cpu_ldst_useronly_template.h | 19 +-\n include/exec/exec-all.h | 1 \n include/exec/helper-gen.h | 1 \n include/exec/helper-proto.h | 1 \n include/exec/helper-tcg.h | 1 \n include/qemu/compiler.h | 19 ++\n instrument/Makefile.objs | 8 +\n instrument/cmdline.c | 128 ++++++++++++++++\n instrument/cmdline.h | 51 ++++++\n instrument/control.c | 228 +++++++++++++++++++++++++++++\n instrument/control.h | 153 +++++++++++++++++++\n instrument/control.inc.h | 67 +++++++++\n instrument/error.h | 34 ++++\n instrument/events.h | 86 +++++++++++\n instrument/events.inc.h | 109 ++++++++++++++\n instrument/helpers.h | 2 \n instrument/load.c | 210 +++++++++++++++++++++++++++\n instrument/load.h | 88 +++++++++++\n instrument/qemu-instr/control.h | 177 +++++++++++++++++++++++\n instrument/qemu-instr/state.h | 104 +++++++++++++\n instrument/qemu-instr/types.h | 115 +++++++++++++++\n instrument/qemu-instr/types.inc.h | 15 ++\n instrument/qmp.c | 82 ++++++++++\n instrument/state.c | 73 +++++++++\n instrument/trace.c | 125 ++++++++++++++++\n linux-user/main.c | 21 +++\n linux-user/syscall.c | 7 +\n monitor.c | 43 +++++\n qapi-schema.json | 3 \n qapi/instrument.json | 49 ++++++\n qemu-options.hx | 19 ++\n qom/cpu.c | 2 \n stubs/Makefile.objs | 1 \n stubs/instrument.c | 73 +++++++++\n tcg/tcg-op.c | 27 ++-\n trace/control-target.c | 2 \n trace/control.c | 4 -\n trace/control.h | 24 +++\n trace/mem-internal.h | 22 ++-\n trace/mem.h | 8 +\n vl.c | 15 ++\n 55 files changed, 2486 insertions(+), 40 deletions(-)\n create mode 100644 docs/instrument.txt\n create mode 100644 instrument/Makefile.objs\n create mode 100644 instrument/cmdline.c\n create mode 100644 instrument/cmdline.h\n create mode 100644 instrument/control.c\n create mode 100644 instrument/control.h\n create mode 100644 instrument/control.inc.h\n create mode 100644 instrument/error.h\n create mode 100644 instrument/events.h\n create mode 100644 instrument/events.inc.h\n create mode 100644 instrument/helpers.h\n create mode 100644 instrument/load.c\n create mode 100644 instrument/load.h\n create mode 100644 instrument/qemu-instr/control.h\n create mode 100644 instrument/qemu-instr/state.h\n create mode 100644 instrument/qemu-instr/types.h\n create mode 100644 instrument/qemu-instr/types.inc.h\n create mode 100644 instrument/qmp.c\n create mode 100644 instrument/state.c\n create mode 100644 instrument/trace.c\n create mode 100644 qapi/instrument.json\n create mode 100644 stubs/instrument.c\n\n\nTo: qemu-devel@nongnu.org\nCc: Stefan Hajnoczi <stefanha@redhat.com>\nCc: Emilio G. Cota <cota@braap.org>\nCc: Eric Blake <eblake@redhat.com>\nCc: Markus Armbruster <armbru@redhat.com>" }