Show a patch.

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

{
    "id": 10291,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10291/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10291/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20201028103151.34575-5-paul.elder@ideasonboard.com>",
    "date": "2020-10-28T10:31:50",
    "name": "[libcamera-devel,v2,5/6] utils: tracepoints: Add simple statistics script",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "57a24bf7ed6f469afb54874618ab70d5604b0da0",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/10291/mbox/",
    "series": [
        {
            "id": 1428,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1428/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1428",
            "date": "2020-10-28T10:31:46",
            "name": "[libcamera-devel,v2,1/6] libcamera: tracing: Implement tracing infrastructure",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1428/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10291/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10291/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B1B5CBDB1E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Oct 2020 10:32:12 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7F66B625F9;\n\tWed, 28 Oct 2020 11:32:12 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDA33625F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Oct 2020 11:32:09 +0100 (CET)",
            "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 45DA799A;\n\tWed, 28 Oct 2020 11:32:07 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ICa8DWQW\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1603881129;\n\tbh=zFRmPxhWd2ZJKQXD7T3TbMRoyG3X0kE1R0Hff/julZY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ICa8DWQWXrGsPHDHc2H3auzDU0LxPk3CNg6mNWZoLqYMkDvwl8gouZJLNXaOP9YY/\n\tESquJdFI4ZnsliDPIfsO1GnOkKWHY1E7j5Typovn4hbrcEHk0j5/EenJxs9W1MTZEu\n\tjU9rzbzB8t1T8o3PdcY+vqzUn/gF0VmgwY6xYjXU=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 28 Oct 2020 19:31:50 +0900",
        "Message-Id": "<20201028103151.34575-5-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20201028103151.34575-1-paul.elder@ideasonboard.com>",
        "References": "<20201028103151.34575-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 5/6] utils: tracepoints: Add simple\n\tstatistics script",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a script that scans a trace for IPA call tracepoints, and returns\nstatistics on the time taken for IPA calls.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nNew in v2\n---\n utils/tracepoints/analyze.py | 64 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 64 insertions(+)\n create mode 100755 utils/tracepoints/analyze.py",
    "diff": "diff --git a/utils/tracepoints/analyze.py b/utils/tracepoints/analyze.py\nnew file mode 100755\nindex 00000000..be56ca28\n--- /dev/null\n+++ b/utils/tracepoints/analyze.py\n@@ -0,0 +1,64 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+# Copyright (C) 2020, Google Inc.\n+#\n+# Author: Paul Elder <paul.elder@ideasonboard.com>\n+#\n+# analyze.py - Analysis tool for libcamera lttng output\n+\n+import argparse\n+import bt2\n+import statistics as stats\n+import sys\n+\n+# pipeline -> {function -> stack(timestamps)}\n+timestamps = {}\n+\n+# pipeline:function -> samples[]\n+samples = {}\n+\n+def main(argv):\n+    parser = argparse.ArgumentParser()\n+    parser.add_argument(\"-p\", \"--pipeline\", type=str,\n+                        help=\"Name of pipeline to filter for\")\n+    parser.add_argument('trace_path', type=str,\n+                        help='Path to lttng trace')\n+    args = parser.parse_args(argv[1:])\n+\n+    traces = bt2.TraceCollectionMessageIterator(args.trace_path)\n+    for msg in traces:\n+        if type(msg) is not bt2._EventMessageConst or \\\n+           (args.pipeline is not None and \\\n+            msg.event.payload_field['pipeline_name'] != args.pipeline):\n+            continue\n+\n+        pipeline = msg.event.payload_field['pipeline_name']\n+        event = msg.event.name\n+        func = msg.event.payload_field[\"function_name\"]\n+        timestamp_ns = msg.default_clock_snapshot.ns_from_origin\n+\n+        if event == 'libcamera:ipa_call_start':\n+            if pipeline not in timestamps:\n+                timestamps[pipeline] = {}\n+            if func not in timestamps[pipeline]:\n+                timestamps[pipeline][func] = []\n+            timestamps[pipeline][func].append(timestamp_ns)\n+\n+        if event == 'libcamera:ipa_call_finish':\n+            ts = timestamps[pipeline][func].pop()\n+            key = f'{pipeline}:{func}'\n+            if key not in samples:\n+                samples[key] = []\n+            samples[key].append(timestamp_ns - ts)\n+\n+    print('pipeline:function\\t:\\tmin\\tmax\\tmean\\tstddev')\n+    for k, v in samples.items():\n+        mean = int(stats.mean(v))\n+        stddev = int(stats.stdev(v))\n+        minv = min(v)\n+        maxv = max(v)\n+        print(f'{k}\\t:\\t{minv}\\t{maxv}\\t{mean}\\t{stddev}')\n+\n+\n+if __name__ == '__main__':\n+    sys.exit(main(sys.argv))\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "5/6"
    ]
}