From patchwork Thu Jun 4 07:13:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11587061 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CED42913 for ; Thu, 4 Jun 2020 07:13:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B70552074B for ; Thu, 4 Jun 2020 07:13:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="HKFS/PsD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbgFDHNk (ORCPT ); Thu, 4 Jun 2020 03:13:40 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:7555 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbgFDHNk (ORCPT ); Thu, 4 Jun 2020 03:13:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1591254820; x=1622790820; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s9sdczADB9/Dx/4in2C97//1RLCTHZ80z68kbrq7KPw=; b=HKFS/PsDa5YtL1NSNiT0r2L1Pf/4ts6zn3PIee/iZ1TZYngcMNEbwzwC dnf6qediLIh/xA2ZklpEWprbmRdauzA8nxvHIryyJ9DSvq5Yqi4aQSaAP kzeLoMQ5JYLjRaxakRbeqRZRKQaS4qShuanN1CHNvbLN5C06dzXg8yR8t 0qUjJD0i9y0sY4hQEKbn4DTObEblxdCdxy73OrsoB/uzyvIgwJCSuShzb PYIvDTOEplE2Ix9tZ9em9CJSNHkQeerWWWewJ5JuJ8BrDeD7FtO7iPGlb p1yBa8YZnpjSvWlCY2REnGYT2hGFuml3tmNX4IBXW2WNu2Eqd9dqvB4ih w==; IronPort-SDR: cetzZip2z/n0SwvcRAbLG0uqkQWcH2qwiuksAJpEm9DHgIsfQYTR/ARwJPCgMmNLFHPsx9LCLs Vr7UvxXG+qXiEVAJ4fuEbYhEs0icihYG35DcX419i9UEmQvZOdtO4L9l08RT3eQpcEhHw1s7nZ 5ksIXYZOXngYGafXa3WBbO9K6HHgoJ3SwQJ62x8eYL15atFz95tlw95gBqjKwdF+/SPlJZ8/zN Kudyce/s7QJ+UynOCGYJZptfx9gMfsJSmgvCMWpRvZd7D8vGLyuVeeNBq1AVZCdCdpVAP24Sjq idM= X-IronPort-AV: E=Sophos;i="5.73,471,1583164800"; d="scan'208";a="139494861" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 04 Jun 2020 15:13:40 +0800 IronPort-SDR: KGartIt6c7/ZQ1Mkb+P5t6iHp4hFOECFerWMGsd3xD9VIndHa5Do+LCHJGBOREoU5WpuJn43T3 BfV0l8UrqlsIbmyirTKwB5FI1C3Feq4BA= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 00:03:16 -0700 IronPort-SDR: 5zCvu40Zx3y9viMfW/0U9p+AZ/CE4ZQZdCxEgVYO18GiDY1W+nlHOMXAYjyhmUBRIh6sHaHmyf ZAxIN0zkujNQ== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Jun 2020 00:13:39 -0700 From: Chaitanya Kulkarni To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 1/3] blktrace: use errno instead of bi_status Date: Thu, 4 Jun 2020 00:13:28 -0700 Message-Id: <20200604071330.5086-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200604071330.5086-1-chaitanya.kulkarni@wdc.com> References: <20200604071330.5086-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org In blk_add_trace_spliti() blk_add_trace_bio_remap() use blk_status_to_errno() to pass the error instead of pasing the bi_status. This fixes the sparse warning. Signed-off-by: Chaitanya Kulkarni --- kernel/trace/blktrace.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index ea47f2084087..f6f4fe6ea5d8 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -995,8 +995,10 @@ static void blk_add_trace_split(void *ignore, __blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size, bio_op(bio), bio->bi_opf, - BLK_TA_SPLIT, bio->bi_status, sizeof(rpdu), - &rpdu, blk_trace_bio_get_cgid(q, bio)); + BLK_TA_SPLIT, + blk_status_to_errno(bio->bi_status), + sizeof(rpdu), &rpdu, + blk_trace_bio_get_cgid(q, bio)); } rcu_read_unlock(); } @@ -1033,7 +1035,8 @@ static void blk_add_trace_bio_remap(void *ignore, r.sector_from = cpu_to_be64(from); __blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size, - bio_op(bio), bio->bi_opf, BLK_TA_REMAP, bio->bi_status, + bio_op(bio), bio->bi_opf, BLK_TA_REMAP, + blk_status_to_errno(bio->bi_status), sizeof(r), &r, blk_trace_bio_get_cgid(q, bio)); rcu_read_unlock(); } From patchwork Thu Jun 4 07:13:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11587063 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34630913 for ; Thu, 4 Jun 2020 07:13:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12E272074B for ; Thu, 4 Jun 2020 07:13:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="QlK0IIGk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726664AbgFDHNq (ORCPT ); Thu, 4 Jun 2020 03:13:46 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:51836 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbgFDHNq (ORCPT ); Thu, 4 Jun 2020 03:13:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1591254835; x=1622790835; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8yGTkDOsobK6c9nniHjJXfJgRC3LDKuH21ZPcER8aEU=; b=QlK0IIGkxRkKM/BmfoS0MKLxy4od5pAqleYSe4ZBU6S3mpv97IS5snql fkanDG2qeB34v6eJDU/bvT8TU62vpjwdn9yNOm/J3Pf+00Ktd7gz7dMTR UW4hOPViftE7dh71ea2CrmnMy8VuvUpvK6Q6bEUMhMs1sHzXzwp1asg4X JNlcvGjq6lgpYqpxDI3fnE3CcbkTzcMVrWc9c+cMozraDGDRz2mVFIp4t SY/nD1TdIiww/VxujXoekv9Bb5yoOgp6zbIC/3vdWWifsvmjfA8Nwzse/ mNbhQKHdYnuNQvkMMSVXBciI5dD1OEdubynl8kWY4cpol0u57LAmkdCqD A==; IronPort-SDR: i/h6ByXSE62C8KQviRjrPabTi+0pV4EJFHBjb89TqjXLXnTB3/6co+fyHBmAtPDZob30kyjfzs OvzrTSJflytL2QP/3zWh0Jl9frPnu6TJ1YcvpsOGEta1Lblpdv8W98UbuuFqx5r3xiQK6Pi+TM e5AEzpXYHV2Ka+xnU0/hdfXUsZxnnOJ+YtHvX4VQsde74dAawD9ByZdYWw04MIAnnPksS7iWhj O9e3+O3XdkIzZnYVtXbWgby0mCv9GuXZ/xTZRwHZk2N4hqCjYMlnt+ODqLptPQk0gAwQ6NgPtB u0Q= X-IronPort-AV: E=Sophos;i="5.73,471,1583164800"; d="scan'208";a="242049190" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 04 Jun 2020 15:13:54 +0800 IronPort-SDR: E3oElmDQXXDchJ11beI2qL0I2RE6HeT98TH9836+HbIJmQlWQQ+ZSPtsDUIlqcLRP6OuWtQgsD a7yek2p50bw2eisn/bt3a6tmGkyYGxK48= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 00:03:22 -0700 IronPort-SDR: GoYKl+G0KdJ+wGEsrYbGabOoMtSM32DF0XQKG4n1MMy/TrRD/xzI/ZTOgSCJ6452Ipnfr/j+S2 1pUHrtsJabzA== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Jun 2020 00:13:45 -0700 From: Chaitanya Kulkarni To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 2/3] blktrace: fix endianness in get_pdu_int() Date: Thu, 4 Jun 2020 00:13:29 -0700 Message-Id: <20200604071330.5086-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200604071330.5086-1-chaitanya.kulkarni@wdc.com> References: <20200604071330.5086-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org In function get_pdu_len() replace variable type from __u64 to __be64. This fixes sparse warning. Signed-off-by: Chaitanya Kulkarni --- kernel/trace/blktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index f6f4fe6ea5d8..70aebd95f9bf 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -1256,7 +1256,7 @@ static inline __u16 t_error(const struct trace_entry *ent) static __u64 get_pdu_int(const struct trace_entry *ent, bool has_cg) { - const __u64 *val = pdu_start(ent, has_cg); + const __be64 *val = pdu_start(ent, has_cg); return be64_to_cpu(*val); } From patchwork Thu Jun 4 07:13:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11587065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34E7A913 for ; Thu, 4 Jun 2020 07:13:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D6762074B for ; Thu, 4 Jun 2020 07:13:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="TndEz72K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727105AbgFDHNx (ORCPT ); Thu, 4 Jun 2020 03:13:53 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:53678 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbgFDHNx (ORCPT ); Thu, 4 Jun 2020 03:13:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1591254833; x=1622790833; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=73wzUu0PqPaA5I+UoIjvLyt/GR5xek7lh4xaBv3Gghk=; b=TndEz72KcJRELQc2+RfCftZmDbXzLKOYtfq4b2opcvUlCPka1SR1fSVr mhPhIBLl+pcZUyWR4oKqEraXkKwSXLMv4Yh3h2UhpQM8QTEV9IdsdGSxv Py6u+jjpYdRdJjyQeBT6U6oEtwPn7YJJXWGUjn9Tm55fB6f73SzPbdjSr vkUN2IY/OAJL+387YiEjYwLQtpg0YB0syclZTv3x4KQ6t3jjXVrvRfH8w vq51YZU/ZU37YJ+FQpT+XSN+o9E9WmAf1IEMcdFN7hP+ZPTsrq5HTCzKx NNVMjXfl2YM1gxzbaxO8SIQ+fRRSDhZ2dya0pIAmhnRXYQIrMCAlQvhO1 A==; IronPort-SDR: KwZixmmK3N9526+SX7OQx7uUTn4BBFyOIlpc9npoOsKx0C3FLe49ABYdk412HlzPcLaxCEtluM 3Pv+XU8qIdC7QZ8OTXLbYCMtZkPa6Ao3BwzYQHbRMa+ncLUCBkoO21U7vzEzeLR8we9iscOpqS kWeOH/nYNL64wPuJRxAb+8NAGQAT3tjm0tqi6LAzXJUkPfaT5ZbvuEPEV8g/tfo0uyVxUdaBP8 p/tN7pWr+SNlgOWUFvpjPHafWDRBCWT4k6BUx79I6zFBmpfD3JEFTL2eGnvaK3ATtUXsWshDyB XAg= X-IronPort-AV: E=Sophos;i="5.73,471,1583164800"; d="scan'208";a="140602989" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 04 Jun 2020 15:13:52 +0800 IronPort-SDR: 0CtgE2YsXyQObSBs1/R/c0PP8WcX3eMFmZSbNfABn8oytAbZkZOgEGcqidmKYsQBL/LGo8PKoo 9xZyYPdipRy2nD2qS5j28f8Qw7Iyx3hyI= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2020 00:03:29 -0700 IronPort-SDR: wK2myttvWPuexbXqoCDBJkKzb55qWHvEspNQyoewY8128WVy7wV9Uehsss5vmFiSKgNrsF3jHr sepvDZcU9v2w== WDCIronportException: Internal Received: from iouring.labspan.wdc.com (HELO iouring.sc.wdc.com) ([10.6.138.107]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Jun 2020 00:13:52 -0700 From: Chaitanya Kulkarni To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 3/3] blktrace: fix endianness for blk_log_remap() Date: Thu, 4 Jun 2020 00:13:30 -0700 Message-Id: <20200604071330.5086-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200604071330.5086-1-chaitanya.kulkarni@wdc.com> References: <20200604071330.5086-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The function blk_log_remap() can be simplified by removing the call to get_pdu_remap() that copies the values into extra variable to print the data, which also fixes the endiannness warning reported by sparse. Signed-off-by: Chaitanya Kulkarni --- kernel/trace/blktrace.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 70aebd95f9bf..19e37242d0f5 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -1260,17 +1260,6 @@ static __u64 get_pdu_int(const struct trace_entry *ent, bool has_cg) return be64_to_cpu(*val); } -static void get_pdu_remap(const struct trace_entry *ent, - struct blk_io_trace_remap *r, bool has_cg) -{ - const struct blk_io_trace_remap *__r = pdu_start(ent, has_cg); - __u64 sector_from = __r->sector_from; - - r->device_from = be32_to_cpu(__r->device_from); - r->device_to = be32_to_cpu(__r->device_to); - r->sector_from = be64_to_cpu(sector_from); -} - typedef void (blk_log_action_t) (struct trace_iterator *iter, const char *act, bool has_cg); @@ -1410,13 +1399,13 @@ static void blk_log_with_error(struct trace_seq *s, static void blk_log_remap(struct trace_seq *s, const struct trace_entry *ent, bool has_cg) { - struct blk_io_trace_remap r = { .device_from = 0, }; + const struct blk_io_trace_remap *__r = pdu_start(ent, has_cg); - get_pdu_remap(ent, &r, has_cg); trace_seq_printf(s, "%llu + %u <- (%d,%d) %llu\n", t_sector(ent), t_sec(ent), - MAJOR(r.device_from), MINOR(r.device_from), - (unsigned long long)r.sector_from); + MAJOR(be32_to_cpu(__r->device_from)), + MINOR(be32_to_cpu(__r->device_from)), + be64_to_cpu(__r->sector_from)); } static void blk_log_plug(struct trace_seq *s, const struct trace_entry *ent, bool has_cg)