Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808485/?format=api
{ "id": 808485, "url": "http://patchwork.ozlabs.org/api/patches/808485/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170901001502.29915-6-jsnow@redhat.com/", "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": "<20170901001502.29915-6-jsnow@redhat.com>", "list_archive_url": null, "date": "2017-09-01T00:14:58", "name": "[v3,5/9] IDE: replace DEBUG_AIO with trace events", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "add9b4b5d725c488409f1098f1df3f63d3a5df8d", "submitter": { "id": 64343, "url": "http://patchwork.ozlabs.org/api/people/64343/?format=api", "name": "John Snow", "email": "jsnow@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170901001502.29915-6-jsnow@redhat.com/mbox/", "series": [ { "id": 931, "url": "http://patchwork.ozlabs.org/api/series/931/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=931", "date": "2017-09-01T00:14:53", "name": "IDE: replace printfs with tracing", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/931/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808485/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808485/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>)", "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jsnow@redhat.com" ], "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 3xk0Cl43yHz9s7p\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 1 Sep 2017 10:16:35 +1000 (AEST)", "from localhost ([::1]:34578 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 1dnZdR-0000Jl-Gw\n\tfor incoming@patchwork.ozlabs.org; Thu, 31 Aug 2017 20:16:33 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:51699)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1dnZcf-0000Gu-BK\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 20:15:46 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1dnZce-0004ip-1J\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 20:15:45 -0400", "from mx1.redhat.com ([209.132.183.28]:57210)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <jsnow@redhat.com>)\n\tid 1dnZca-0004d1-So; Thu, 31 Aug 2017 20:15:41 -0400", "from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id F28D8C0546F8;\n\tFri, 1 Sep 2017 00:15:39 +0000 (UTC)", "from probe.bos.redhat.com (dhcp-17-130.bos.redhat.com\n\t[10.18.17.130])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 0BE5BA3975;\n\tFri, 1 Sep 2017 00:15:38 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com F28D8C0546F8", "From": "John Snow <jsnow@redhat.com>", "To": "qemu-block@nongnu.org", "Date": "Thu, 31 Aug 2017 20:14:58 -0400", "Message-Id": "<20170901001502.29915-6-jsnow@redhat.com>", "In-Reply-To": "<20170901001502.29915-1-jsnow@redhat.com>", "References": "<20170901001502.29915-1-jsnow@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.13", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tFri, 01 Sep 2017 00:15:40 +0000 (UTC)", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "209.132.183.28", "Subject": "[Qemu-devel] [PATCH v3 5/9] IDE: replace DEBUG_AIO with trace events", "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": "John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org, stefanha@redhat.com,\n\tf4bug@amsat.org", "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: John Snow <jsnow@redhat.com>\n---\n hw/ide/atapi.c | 5 +----\n hw/ide/core.c | 24 +++++++++++++++++-------\n hw/ide/trace-events | 3 +++\n include/hw/ide/internal.h | 6 ++++--\n 4 files changed, 25 insertions(+), 13 deletions(-)", "diff": "diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c\nindex 9b84a1b..c0509c8 100644\n--- a/hw/ide/atapi.c\n+++ b/hw/ide/atapi.c\n@@ -416,10 +416,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)\n s->io_buffer_size = n * 2048;\n data_offset = 0;\n }\n-#ifdef DEBUG_AIO\n- printf(\"aio_read_cd: lba=%u n=%d\\n\", s->lba, n);\n-#endif\n-\n+ trace_ide_atapi_cmd_read_dma_cb_aio(s, s->lba, n);\n s->bus->dma->iov.iov_base = (void *)(s->io_buffer + data_offset);\n s->bus->dma->iov.iov_len = n * ATAPI_SECTOR_SIZE;\n qemu_iovec_init_external(&s->bus->dma->qiov, &s->bus->dma->iov, 1);\ndiff --git a/hw/ide/core.c b/hw/ide/core.c\nindex 82a19b1..2cc2a08 100644\n--- a/hw/ide/core.c\n+++ b/hw/ide/core.c\n@@ -58,6 +58,21 @@ static const int smart_attributes[][12] = {\n { 190, 0x03, 0x00, 0x45, 0x45, 0x1f, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x32},\n };\n \n+const char *IDE_DMA_CMD_lookup[IDE_DMA__COUNT] = {\n+ [IDE_DMA_READ] = \"DMA READ\",\n+ [IDE_DMA_WRITE] = \"DMA WRITE\",\n+ [IDE_DMA_TRIM] = \"DMA TRIM\",\n+ [IDE_DMA_ATAPI] = \"DMA ATAPI\"\n+};\n+\n+static const char *IDE_DMA_CMD_str(enum ide_dma_cmd enval)\n+{\n+ if (enval >= 0 && enval < IDE_DMA__COUNT) {\n+ return IDE_DMA_CMD_lookup[enval];\n+ }\n+ return \"DMA UNKNOWN CMD\";\n+}\n+\n static void ide_dummy_transfer_stop(IDEState *s);\n \n static void padstr(char *str, const char *src, int len)\n@@ -860,10 +875,7 @@ static void ide_dma_cb(void *opaque, int ret)\n goto eot;\n }\n \n-#ifdef DEBUG_AIO\n- printf(\"ide_dma_cb: sector_num=%\" PRId64 \" n=%d, cmd_cmd=%d\\n\",\n- sector_num, n, s->dma_cmd);\n-#endif\n+ trace_ide_dma_cb(s, sector_num, n, IDE_DMA_CMD_str(s->dma_cmd));\n \n if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) &&\n !ide_sect_range_ok(s, sector_num, n)) {\n@@ -2391,9 +2403,7 @@ void ide_bus_reset(IDEBus *bus)\n \n /* pending async DMA */\n if (bus->dma->aiocb) {\n-#ifdef DEBUG_AIO\n- printf(\"aio_cancel\\n\");\n-#endif\n+ trace_ide_bus_reset_aio();\n blk_aio_cancel(bus->dma->aiocb);\n bus->dma->aiocb = NULL;\n }\ndiff --git a/hw/ide/trace-events b/hw/ide/trace-events\nindex 8c79a6c..cc8949c 100644\n--- a/hw/ide/trace-events\n+++ b/hw/ide/trace-events\n@@ -18,6 +18,8 @@ ide_cancel_dma_sync_remaining(void) \"draining all remaining requests\"\n ide_sector_read(int64_t sector_num, int nsectors) \"sector=%\"PRId64\" nsectors=%d\"\n ide_sector_write(int64_t sector_num, int nsectors) \"sector=%\"PRId64\" nsectors=%d\"\n ide_reset(void *s) \"IDEstate %p\"\n+ide_bus_reset_aio(void) \"aio_cancel\"\n+ide_dma_cb(void *s, int64_t sector_num, int n, const char *dma) \"IDEState %p; sector_num=%\"PRId64\" n=%d cmd=%s\"\n \n # BMDMA HBAs:\n \n@@ -51,5 +53,6 @@ ide_atapi_cmd_reply_end_new(void *s, int status) \"IDEState: %p; new transfer sta\n ide_atapi_cmd_check_status(void *s) \"IDEState: %p\"\n ide_atapi_cmd_read(void *s, const char *method, int lba, int nb_sectors) \"IDEState: %p; read %s: LBA=%d nb_sectors=%d\"\n ide_atapi_cmd(void *s, uint8_t cmd) \"IDEState: %p; cmd: 0x%02x\"\n+ide_atapi_cmd_read_dma_cb_aio(void *s, int lba, int n) \"IDEState: %p; aio read: lba=%d n=%d\"\n # Warning: Verbose\n ide_atapi_cmd_packet(void *s, uint16_t limit, const char *packet) \"IDEState: %p; limit=0x%x packet: %s\"\ndiff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h\nindex 74efe8a..db9fde0 100644\n--- a/include/hw/ide/internal.h\n+++ b/include/hw/ide/internal.h\n@@ -14,7 +14,6 @@\n #include \"block/scsi.h\"\n \n /* debug IDE devices */\n-//#define DEBUG_AIO\n #define USE_DMA_CDROM\n \n typedef struct IDEBus IDEBus;\n@@ -333,12 +332,15 @@ struct unreported_events {\n };\n \n enum ide_dma_cmd {\n- IDE_DMA_READ,\n+ IDE_DMA_READ = 0,\n IDE_DMA_WRITE,\n IDE_DMA_TRIM,\n IDE_DMA_ATAPI,\n+ IDE_DMA__COUNT\n };\n \n+extern const char *IDE_DMA_CMD_lookup[IDE_DMA__COUNT];\n+\n #define ide_cmd_is_read(s) \\\n \t((s)->dma_cmd == IDE_DMA_READ)\n \n", "prefixes": [ "v3", "5/9" ] }