get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/810738/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 810738,
    "url": "http://patchwork.ozlabs.org/api/patches/810738/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150471953040.24907.10182874912246869287.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": "<150471953040.24907.10182874912246869287.stgit@frigg.lan>",
    "list_archive_url": null,
    "date": "2017-09-06T17:38:50",
    "name": "[v4,04/20] instrument: [linux-user] Add command line library loader",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "de49293e1d283e2ec39508f9ff0ba6c9a9f3fce8",
    "submitter": {
        "id": 9099,
        "url": "http://patchwork.ozlabs.org/api/people/9099/?format=api",
        "name": "Lluís Vilanova",
        "email": "vilanova@ac.upc.edu"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150471953040.24907.10182874912246869287.stgit@frigg.lan/mbox/",
    "series": [
        {
            "id": 1859,
            "url": "http://patchwork.ozlabs.org/api/series/1859/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=1859",
            "date": "2017-09-06T17:22:41",
            "name": "instrument: Add basic event instrumentation",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/1859/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/810738/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/810738/checks/",
    "tags": {},
    "related": [],
    "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 3xnW7D0ws0z9t2d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 03:39:51 +1000 (AEST)",
            "from localhost ([::1]:37296 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 1dpeIm-0004mp-Ry\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 13:39:48 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:39232)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vilanova@ac.upc.edu>) id 1dpeIJ-0004lT-8q\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 13:39:20 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <vilanova@ac.upc.edu>) id 1dpeIG-00007L-5M\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 13:39:19 -0400",
            "from roura.ac.upc.es ([147.83.33.10]:57729)\n\tby eggs.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vilanova@ac.upc.edu>) id 1dpeIF-00006u-RO\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 13:39:16 -0400",
            "from correu-2.ac.upc.es (correu-2.ac.upc.es [147.83.30.92])\n\tby roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v86HcwFk004086;\n\tWed, 6 Sep 2017 19:38:58 +0200",
            "from localhost (unknown [31.210.187.58])\n\tby correu-2.ac.upc.es (Postfix) with ESMTPSA id B8BF1126C;\n\tWed,  6 Sep 2017 19:38:52 +0200 (CEST)"
        ],
        "From": "=?utf-8?b?TGx1w61z?= Vilanova <vilanova@ac.upc.edu>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Wed,  6 Sep 2017 20:38:50 +0300",
        "Message-Id": "<150471953040.24907.10182874912246869287.stgit@frigg.lan>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<150471856141.24907.274176769201097378.stgit@frigg.lan>",
        "References": "<150471856141.24907.274176769201097378.stgit@frigg.lan>",
        "User-Agent": "StGit/0.17.1-dirty",
        "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\tv86HcwFk004086",
        "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 v4 04/20] instrument: [linux-user] Add command\n\tline library loader",
        "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": "Riku Voipio <riku.voipio@iki.fi>, \"Emilio G. Cota\" <cota@braap.org>,\n\tLaurent Vivier <laurent@vivier.eu>, Stefan 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": "Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>\n---\n linux-user/main.c    |   19 +++++++++++++++++++\n linux-user/syscall.c |    4 ++++\n 2 files changed, 23 insertions(+)",
    "diff": "diff --git a/linux-user/main.c b/linux-user/main.c\nindex 03666ef657..25253bc28a 100644\n--- a/linux-user/main.c\n+++ b/linux-user/main.c\n@@ -36,6 +36,7 @@\n #include \"exec/log.h\"\n #include \"trace/control.h\"\n #include \"glib-compat.h\"\n+#include \"instrument/cmdline.h\"\n \n char *exec_path;\n \n@@ -4017,6 +4018,17 @@ static void handle_arg_trace(const char *arg)\n     trace_file = trace_opt_parse(arg);\n }\n \n+static char *instrument_path;\n+static int instrument_argc;\n+static const char **instrument_argv;\n+#if defined(CONFIG_INSTRUMENT)\n+static void handle_arg_instrument(const char *arg)\n+{\n+    instr_opt_parse(arg, &instrument_path,\n+                    &instrument_argc, &instrument_argv);\n+}\n+#endif\n+\n struct qemu_argument {\n     const char *argv;\n     const char *env;\n@@ -4066,6 +4078,10 @@ static const struct qemu_argument arg_table[] = {\n      \"\",           \"Seed for pseudo-random number generator\"},\n     {\"trace\",      \"QEMU_TRACE\",       true,  handle_arg_trace,\n      \"\",           \"[[enable=]<pattern>][,events=<file>][,file=<file>]\"},\n+#if defined(CONFIG_INSTRUMENT)\n+    {\"instr\",      \"QEMU_INSTR\",       true,  handle_arg_instrument,\n+     \"\",           \"[file=]<file>[,arg=<string>]\"},\n+#endif\n     {\"version\",    \"QEMU_VERSION\",     false, handle_arg_version,\n      \"\",           \"display version information and exit\"},\n     {NULL, NULL, false, NULL, NULL, NULL}\n@@ -4257,6 +4273,7 @@ int main(int argc, char **argv, char **envp)\n     srand(time(NULL));\n \n     qemu_add_opts(&qemu_trace_opts);\n+    qemu_add_opts(&qemu_instr_opts);\n \n     optind = parse_args(argc, argv);\n \n@@ -4265,6 +4282,8 @@ int main(int argc, char **argv, char **envp)\n     }\n     trace_init_file(trace_file);\n \n+    instr_init(instrument_path, instrument_argc, instrument_argv);\n+\n     /* Zero out regs */\n     memset(regs, 0, sizeof(struct target_pt_regs));\n \ndiff --git a/linux-user/syscall.c b/linux-user/syscall.c\nindex 9b6364a266..e73a07fa6f 100644\n--- a/linux-user/syscall.c\n+++ b/linux-user/syscall.c\n@@ -115,6 +115,8 @@ int __clone2(int (*fn)(void *), void *child_stack_base,\n #include \"uname.h\"\n \n #include \"qemu.h\"\n+#include \"instrument/cmdline.h\"\n+\n \n #ifndef CLONE_IO\n #define CLONE_IO                0x80000000      /* Clone io context */\n@@ -7765,6 +7767,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,\n         _mcleanup();\n #endif\n         gdb_exit(cpu_env, arg1);\n+        instr_fini();\n         _exit(arg1);\n         ret = 0; /* avoid warning */\n         break;\n@@ -9821,6 +9824,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,\n         _mcleanup();\n #endif\n         gdb_exit(cpu_env, arg1);\n+        instr_fini();\n         ret = get_errno(exit_group(arg1));\n         break;\n #endif\n",
    "prefixes": [
        "v4",
        "04/20"
    ]
}