get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 808384,
    "url": "http://patchwork.ozlabs.org/api/patches/808384/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170831183215.4306-1-naveen.n.rao@linux.vnet.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<20170831183215.4306-1-naveen.n.rao@linux.vnet.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170831183215.4306-1-naveen.n.rao@linux.vnet.ibm.com/",
    "date": "2017-08-31T18:32:15",
    "name": "uprobe: Warn if unable to install breakpoint",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "06d1c8ac0b07e23c67ba0869e2fb69ff9ca9f693",
    "submitter": {
        "id": 15185,
        "url": "http://patchwork.ozlabs.org/api/people/15185/?format=api",
        "name": "Naveen N. Rao",
        "email": "naveen.n.rao@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170831183215.4306-1-naveen.n.rao@linux.vnet.ibm.com/mbox/",
    "series": [
        {
            "id": 891,
            "url": "http://patchwork.ozlabs.org/api/series/891/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=891",
            "date": "2017-08-31T18:32:15",
            "name": "uprobe: Warn if unable to install breakpoint",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/891/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808384/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808384/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjrcb6Vsrz9sPm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 04:34:07 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjrcb5cDKzDqTs\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 04:34:07 +1000 (AEST)",
            "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjrZm5WRCzDqGZ\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  1 Sep 2017 04:32:32 +1000 (AEST)",
            "from pps.filterd (m0098410.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7VIVPjs057904\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 31 Aug 2017 14:32:30 -0400",
            "from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cpnqwp17x-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 31 Aug 2017 14:32:29 -0400",
            "from localhost\n\tby e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from\n\t<naveen.n.rao@linux.vnet.ibm.com>; Fri, 1 Sep 2017 04:32:27 +1000",
            "from d23relay10.au.ibm.com (202.81.31.229)\n\tby e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 1 Sep 2017 04:32:25 +1000",
            "from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139])\n\tby d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv7VIWPDF22741044\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 1 Sep 2017 04:32:25 +1000",
            "from d23av04.au.ibm.com (localhost [127.0.0.1])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv7VIWPEG002713\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 1 Sep 2017 04:32:25 +1000",
            "from naverao1-tp.ibm.com ([9.77.121.212])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv7VIWLmD002630; Fri, 1 Sep 2017 04:32:22 +1000"
        ],
        "From": "\"Naveen N. Rao\" <naveen.n.rao@linux.vnet.ibm.com>",
        "To": "Ingo Molnar <mingo@kernel.org>",
        "Subject": "[PATCH] uprobe: Warn if unable to install breakpoint",
        "Date": "Fri,  1 Sep 2017 00:02:15 +0530",
        "X-Mailer": "git-send-email 2.14.1",
        "X-TM-AS-MML": "disable",
        "x-cbid": "17083118-0016-0000-0000-00000261C512",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17083118-0017-0000-0000-000006E4984F",
        "Message-Id": "<20170831183215.4306-1-naveen.n.rao@linux.vnet.ibm.com>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-31_07:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708310274",
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "Anton Blanchard <anton@samba.org>, linuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,\n\tSrikar Dronamraju <srikar@linux.vnet.ibm.com>",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "When we try to install a uprobe breakpoint in uprobe_mmap(), we ignore\nall errors encountered in the process per this comment at the top of\nthe function:\n    /*\n     * Called from mmap_region/vma_adjust with mm->mmap_sem acquired.\n     *\n     * Currently we ignore all errors and always return 0, the callers\n     * can't handle the failure anyway.\n     */\n\nHowever, this is very confusing for users since no probe hits are\nrecorded nor is an error logged in dmesg.\n\nFix this by logging an error in dmesg so that users can discover that\nthere was an issue with the uprobe. To facilitate use of uprobe_warn(),\nwe move that function to the top of the file.\n\nWith this patch, we see a message similar to this in dmesg:\n    [  201.449213] uprobe: uprobe_t:9740 failed to setup probe at 0x95c (-524)\n\nReported-by: Anton Blanchard <anton@samba.org>\nSigned-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>\n---\n kernel/events/uprobes.c | 21 ++++++++++++++-------\n 1 file changed, 14 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c\nindex 0e137f98a50c..587c591a535c 100644\n--- a/kernel/events/uprobes.c\n+++ b/kernel/events/uprobes.c\n@@ -112,6 +112,12 @@ struct xol_area {\n \tunsigned long \t\t\tvaddr;\t\t/* Page(s) of instruction slots */\n };\n \n+static void uprobe_warn(struct task_struct *t, const char *msg)\n+{\n+\tpr_warn(\"uprobe: %s:%d failed to %s\\n\",\n+\t\t\tcurrent->comm, current->pid, msg);\n+}\n+\n /*\n  * valid_vma: Verify if the specified vma is an executable vma\n  * Relax restrictions while unregistering: vm_flags might have\n@@ -1087,7 +1093,14 @@ int uprobe_mmap(struct vm_area_struct *vma)\n \t\tif (!fatal_signal_pending(current) &&\n \t\t    filter_chain(uprobe, UPROBE_FILTER_MMAP, vma->vm_mm)) {\n \t\t\tunsigned long vaddr = offset_to_vaddr(vma, uprobe->offset);\n-\t\t\tinstall_breakpoint(uprobe, vma->vm_mm, vma, vaddr);\n+\t\t\tint ret = install_breakpoint(uprobe, vma->vm_mm, vma, vaddr);\n+\t\t\tif (ret) {\n+\t\t\t\tchar msg[64];\n+\t\t\t\tsnprintf(msg, sizeof(msg),\n+\t\t\t\t\t\t\"setup probe at 0x%llx (%d)\",\n+\t\t\t\t\t\tuprobe->offset, ret);\n+\t\t\t\tuprobe_warn(current, (const char *)msg);\n+\t\t\t}\n \t\t}\n \t\tput_uprobe(uprobe);\n \t}\n@@ -1470,12 +1483,6 @@ static int dup_utask(struct task_struct *t, struct uprobe_task *o_utask)\n \treturn 0;\n }\n \n-static void uprobe_warn(struct task_struct *t, const char *msg)\n-{\n-\tpr_warn(\"uprobe: %s:%d failed to %s\\n\",\n-\t\t\tcurrent->comm, current->pid, msg);\n-}\n-\n static void dup_xol_work(struct callback_head *work)\n {\n \tif (current->flags & PF_EXITING)\n",
    "prefixes": []
}