get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 20194,
    "url": "http://patches.dpdk.org/api/patches/20194/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1486387756-16865-5-git-send-email-olivier.matz@6wind.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1486387756-16865-5-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1486387756-16865-5-git-send-email-olivier.matz@6wind.com",
    "date": "2017-02-06T13:29:12",
    "name": "[dpdk-dev,RFC,4/8] eal: change specific log levels at startup",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a39ea4497042957c4e6acb5aa1b88b77938b41fc",
    "submitter": {
        "id": 8,
        "url": "http://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1486387756-16865-5-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/20194/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/20194/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 7DB71F614;\n\tMon,  6 Feb 2017 14:30:07 +0100 (CET)",
            "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n\t[62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 57D5A14EC\n\tfor <dev@dpdk.org>; Mon,  6 Feb 2017 14:29:43 +0100 (CET)",
            "from glumotte.dev.6wind.com (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 96AC624A1F;\n\tMon,  6 Feb 2017 14:29:38 +0100 (CET)"
        ],
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org,\n\tdavid.marchand@6wind.com",
        "Date": "Mon,  6 Feb 2017 14:29:12 +0100",
        "Message-Id": "<1486387756-16865-5-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.8.1",
        "In-Reply-To": "<1486387756-16865-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1486387756-16865-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [RFC 4/8] eal: change specific log levels at startup",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Example of use:\n  ./app/test-pmd --log-level='pmd\\.i40e.*,8'\n\n  This enables debug logs for all dynamic logs whose type starts with\n  'pmd.i40e'.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/librte_eal/bsdapp/eal/eal.c            |  4 +--\n lib/librte_eal/common/eal_common_options.c | 48 +++++++++++++++++++++++-------\n lib/librte_eal/linuxapp/eal/eal.c          |  4 +--\n 3 files changed, 39 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex ee7c9de..e945468 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -505,10 +505,8 @@ rte_eal_init(int argc, char **argv)\n \n \tthread_id = pthread_self();\n \n-\teal_log_level_parse(argc, argv);\n-\n \t/* set log level as early as possible */\n-\trte_set_log_level(internal_config.log_level);\n+\teal_log_level_parse(argc, argv);\n \n \tif (rte_eal_cpu_init() < 0)\n \t\trte_panic(\"Cannot detect lcores\\n\");\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex f36bc55..2682881 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -739,25 +739,53 @@ eal_parse_syslog(const char *facility, struct internal_config *conf)\n }\n \n static int\n-eal_parse_log_level(const char *level, uint32_t *log_level)\n+eal_parse_log_level(const char *arg, struct internal_config *conf)\n {\n-\tchar *end;\n+\tchar *end, *str, *type, *level;\n \tunsigned long tmp;\n \n+\tstr = strdup(arg);\n+\tif (str == NULL)\n+\t\treturn -1;\n+\n+\tif (strchr(str, ',') == NULL) {\n+\t\ttype = NULL;\n+\t\tlevel = str;\n+\t} else {\n+\t\ttype = strsep(&str, \",\");\n+\t\tlevel = strsep(&str, \",\");\n+\t}\n+\n \terrno = 0;\n \ttmp = strtoul(level, &end, 0);\n \n \t/* check for errors */\n \tif ((errno != 0) || (level[0] == '\\0') ||\n-\t    end == NULL || (*end != '\\0'))\n-\t\treturn -1;\n+\t\t    end == NULL || (*end != '\\0'))\n+\t\tgoto fail;\n \n \t/* log_level is a uint32_t */\n \tif (tmp >= UINT32_MAX)\n-\t\treturn -1;\n+\t\tgoto fail;\n+\n+\tprintf(\"set log level %s,%lu\\n\",\n+\t\ttype, tmp);\n+\n+\tif (type == NULL) {\n+\t\tconf->log_level = tmp;\n+\t\trte_log_set_global_level(tmp);\n+\t} else if (rte_log_set_level_regexp(type, tmp) < 0) {\n+\t\tprintf(\"cannot set log level %s,%lu\\n\",\n+\t\t\ttype, tmp);\n+\t\tgoto fail;\n+\t}\n \n-\t*log_level = tmp;\n+\tfree(str);\n \treturn 0;\n+\n+fail:\n+\tfree(str);\n+\treturn -1;\n }\n \n static enum rte_proc_type_t\n@@ -898,15 +926,12 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tbreak;\n \n \tcase OPT_LOG_LEVEL_NUM: {\n-\t\tuint32_t log;\n-\n-\t\tif (eal_parse_log_level(optarg, &log) < 0) {\n+\t\tif (eal_parse_log_level(optarg, conf) < 0) {\n \t\t\tRTE_LOG(ERR, EAL,\n \t\t\t\t\"invalid parameters for --\"\n \t\t\t\tOPT_LOG_LEVEL \"\\n\");\n \t\t\treturn -1;\n \t\t}\n-\t\tconf->log_level = log;\n \t\tbreak;\n \t}\n \tcase OPT_LCORES_NUM:\n@@ -1057,7 +1082,8 @@ eal_common_usage(void)\n \t       \"  --\"OPT_VMWARE_TSC_MAP\"    Use VMware TSC map instead of native RDTSC\\n\"\n \t       \"  --\"OPT_PROC_TYPE\"         Type of this process (primary|secondary|auto)\\n\"\n \t       \"  --\"OPT_SYSLOG\"            Set syslog facility\\n\"\n-\t       \"  --\"OPT_LOG_LEVEL\"         Set default log level\\n\"\n+\t       \"  --\"OPT_LOG_LEVEL\"=<int>          Set global log level\\n\"\n+\t       \"  --\"OPT_LOG_LEVEL\"=<type>,<int>   Set specific log level\\n\"\n \t       \"  -v                  Display version information on startup\\n\"\n \t       \"  -h, --help          This help\\n\"\n \t       \"\\nEAL options for DEBUG use only:\\n\"\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex bf6b818..0f61447 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -762,10 +762,8 @@ rte_eal_init(int argc, char **argv)\n \n \tthread_id = pthread_self();\n \n-\teal_log_level_parse(argc, argv);\n-\n \t/* set log level as early as possible */\n-\trte_set_log_level(internal_config.log_level);\n+\teal_log_level_parse(argc, argv);\n \n \tif (rte_eal_cpu_init() < 0)\n \t\trte_panic(\"Cannot detect lcores\\n\");\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "4/8"
    ]
}