From patchwork Tue Feb 18 17:28:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11389169 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 3870F13A4 for ; Tue, 18 Feb 2020 17:28:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1890124656 for ; Tue, 18 Feb 2020 17:28:53 +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="rytp4UNd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbgBRR2v (ORCPT ); Tue, 18 Feb 2020 12:28:51 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:60228 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727193AbgBRR2v (ORCPT ); Tue, 18 Feb 2020 12:28:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1582046930; x=1613582930; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tqoiBrV7Cmx5DfjSGP2AG0toN/Mx6sj7qyTFUXab1Jk=; b=rytp4UNdJ5toNR5u7zQ0cYNMfAy++/CKroquuQLlbKw0UlwaNcuDAvNg UocLPEQDYBr0Lvk4dXlY/0pVxn8aZIc+GvcO2xffhqsbLbTWK+lNtRd/i 24m+hQTVQ7ysavLowyWC8dBe4JlIbS5U82qLmwMsltsTJioWmNHy3lTjY deLZOl2ywUWNrlsr8s6hodRdZrDSroxMVLagj88KemsqS2sg5WBQlyHWs T5yyZ+GlKwFDjhWwL0r1EQuSnIKyrlf5mJ5Q8VCxUwKxbuCk5/TNvC8cj cz8sWs/PrWr+5pxViCLa+dK6F1SAyEImQjrW8DEzSeY5jU6wyjQaI8TUm w==; IronPort-SDR: zP96VV2N9JbUE+MzSjH6ifMldNFh0jv9ZzcE7X7TFgdIDRVDwBtP1DRjIINLnexSX5q7tWa9h3 Eim1zEWI54lUUG0pQYYb/SGm8DtqcvOO5ADndWOLD4yjCj/+Uh1/ovJLPPk0eVA9vJdVYnQ71d vdC0PX1SKqe3ti6qsZq8DSIUa0sEOzPbk7/eqoTGSjVfpmkNg1DFJ/4am/qOEm9wfAvLq2AwSW xaetHiXRJ32ZRhByeSekBs0SIIv/HtKEafTE6SnWl2EHE4/3jHEVSGQkUpDFrdAgol2yMQlVl9 jKg= X-IronPort-AV: E=Sophos;i="5.70,456,1574092800"; d="scan'208";a="130104887" 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; 19 Feb 2020 01:28:50 +0800 IronPort-SDR: +ywhj71ESWQhwoEKZh/kcAxUZORA61SxwzZwAiHWDFgSeJyemqZS7bNtWTfrL5N71aMyPDdzLR 7gpK+XQTLkL7Oo5PVjFjwW7jgqmDHbnBcNCE32ny3GJBKsXYj9/Yt/S2Vzd5/WdgQoBJNJDGA9 wwCgzybbWNB+1Yin1IhHoirn+hoBN8IeqLYedanuZ6b9zFRgncZwB+Ukz9GuRxQgKsyW8omxm/ V1cS9w3OdTlupJ1FpEKkwrk1y5M9fH0odA+CAKcH0dQWkdviDoB3pjyjcw6nyXOBOvD/D5Sull xfRAI3c9mdn7X417qzaYi7Lo 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; 18 Feb 2020 09:21:29 -0800 IronPort-SDR: jok2S76wxRTJsJSvD/I4fpL8wpaiGP6uhPvgEgRSWVHH4H3SDx+n7lR684p8r08M3BBCyLCB+T rWn+8FR5CHWAKExPbZKxxcV7WFDQuSlRmMVDUurciy2jHIFYvicvMeGEVOAJShcwN20noDzJpA MtbX9qUDb/J5H2mcFJrJ0FPGtnBkM/09Zqh6Bg/TxLSpzzhL1MieHq96pvhu+5/e+PdPG100XE Ci/brkyHA5Hhh50Nj2d366iPt3ThcEoEHloUlZj72YAB5slzayGYCXeWNQ6p1ttJgKx3L8YCpQ gPw= 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; 18 Feb 2020 09:28:50 -0800 From: Chaitanya Kulkarni To: damien.lemoal@wdc.com, axboe@kernel.dk Cc: linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 1/3] block: add a zone condition debug helper Date: Tue, 18 Feb 2020 09:28:38 -0800 Message-Id: <20200218172840.4097-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200218172840.4097-1-chaitanya.kulkarni@wdc.com> References: <20200218172840.4097-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 Add a helper to stringify the zone conditions. We use this helper in the next patch to track zone conditions in tracepoints. Signed-off-by: Chaitanya Kulkarni --- Changes from V1 : - 1. Move blk_zone_cond_str() to blk-zoned.c. 2. Mark zone_cond_namd array static. 3. Remove BLK_ZONE_COND_LAST. 4. Get rid of inline prefix for blk_zone_cond_str(). --- block/blk-zoned.c | 32 ++++++++++++++++++++++++++++++++ include/linux/blkdev.h | 10 ++++++++++ 2 files changed, 42 insertions(+) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 05741c6f618b..f18f1ee9d71f 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -20,6 +20,38 @@ #include "blk.h" +#define ZONE_COND_NAME(name) [BLK_ZONE_COND_##name] = #name +static const char *const zone_cond_name[] = { + ZONE_COND_NAME(NOT_WP), + ZONE_COND_NAME(EMPTY), + ZONE_COND_NAME(IMP_OPEN), + ZONE_COND_NAME(EXP_OPEN), + ZONE_COND_NAME(CLOSED), + ZONE_COND_NAME(READONLY), + ZONE_COND_NAME(FULL), + ZONE_COND_NAME(OFFLINE), +}; +#undef ZONE_COND_NAME + +/** + * blk_zone_cond_str - Return string XXX in BLK_ZONE_COND_XXX. + * @zone_cond: BLK_ZONE_COND_XXX. + * + * Description: Centralize block layer function to convert BLK_ZONE_COND_XXX + * into string format. Useful in the debugging and tracing zone conditions. For + * invalid BLK_ZONE_COND_XXX it returns string "UNKNOWN". + */ +const char *blk_zone_cond_str(enum blk_zone_cond zone_cond) +{ + static const char *zone_cond_str = "UNKNOWN"; + + if (zone_cond < ARRAY_SIZE(zone_cond_name) && zone_cond_name[zone_cond]) + zone_cond_str = zone_cond_name[zone_cond]; + + return zone_cond_str; +} +EXPORT_SYMBOL_GPL(blk_zone_cond_str); + static inline sector_t blk_zone_start(struct request_queue *q, sector_t sector) { diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 053ea4b51988..a40a3a27bfbc 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -887,6 +887,16 @@ extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, /* Helper to convert REQ_OP_XXX to its string format XXX */ extern const char *blk_op_str(unsigned int op); +#ifdef CONFIG_BLK_DEV_ZONED +/* Helper to convert BLK_ZONE_ZONE_XXX to its string format XXX */ +extern const char *blk_zone_cond_str(enum blk_zone_cond zone_cond); +#else +static const char *blk_zone_cond_str(unsigned int zone_cond) +{ + return "NOT SUPPORTED"; +} +#endif /* CONFIG_BLK_DEV_ZONED */ + int blk_status_to_errno(blk_status_t status); blk_status_t errno_to_blk_status(int errno); From patchwork Tue Feb 18 17:28:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11389173 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 8CA57139A for ; Tue, 18 Feb 2020 17:28:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CBEA24656 for ; Tue, 18 Feb 2020 17:28:58 +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="HtPrxKTa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbgBRR25 (ORCPT ); Tue, 18 Feb 2020 12:28:57 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:49048 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbgBRR25 (ORCPT ); Tue, 18 Feb 2020 12:28:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1582046937; x=1613582937; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HslBlIkDzsUYjHSLvAZ72qysCx+cr80B5VVH6xglZU4=; b=HtPrxKTaMOn0V2H+ZNwlZVXFkSGPXUirsuXBKpXJK+8q/bkLiVDlOqmt kzt1X41FG6zCw1umEJPwpjnOTbCBK6IOiE0DtrOM2ZQEmPICpC+2PjYLT 7uYJvbIKQOfG3qEY8Kmtzx+1zIgQ8H8Gi5orR5KtR+hAl+G1YJv8V2RnC 0vMs3MhVNIxOOY3aMUX2zvu1U2AXVGANZMVw/JIRTEbh8Lxk8nDRjEsmz rvCwS1+ytq5/kmBmt1JoH9QTKWJb3QPjDiORWOLfYu4Ks1gPSKrF2uh8K PsWe8nVZWraCCSz2r8RuY2cFujcJR+C6SmY+4vitXy2dWaguBB46S27z2 w==; IronPort-SDR: WYL0fQGgLyzizypQRJO+ZK5c9zgjifGBFDGmncW49ncOtitd9OB3Gqis+KShmH9B0k+vE/V5UA GFYiB3+qw14MvPcrUiPNYBcPVT126/5rrL3B25QPECd29Ftu3/L+6L26oI8s2RI85Y0BR44omf XOauLbc5J2Y7VNV0UCRM2/qbs/twv2nyJ2ylyhvF2Eu2QUvorhQgllA6GFgQxTUiuPPJc6NPka lsljTIbsxONXUg/u7/35zhc2WngmIq971opWwaHhRHYuZON39LjO8/++Z3eCPkP1u5520fuU+o PsE= X-IronPort-AV: E=Sophos;i="5.70,456,1574092800"; d="scan'208";a="134466591" 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; 19 Feb 2020 01:28:57 +0800 IronPort-SDR: QWRklh+FGtMLRH+mPJhpaW87Rfy/6w0wEuY2ty0HIQs2D4wKbxo6Ba46u/cFUWFgVBHB2ql0/m u3OeFaDJslJCW8neD3gL2uNS5QsgwGaP3/zBf3IpjcxiTMtdjoD/yuVPH543gApIcKO850Y+ac 2fLVBTLZO6JVcWvofU9Qgfpzx8g3qi1TnryGGnN9kFmc48ue1Vn94VTnoAINs6DaUTkr6I+W5u nNZ5ZzpDPgYiQ4yat8Z2Ey7zoCdD1JsmH3CBuxEMOBImuxF4MmE6J2OSGFC5xWYdrgSFEY6AN7 JI1/rW9V4VQovC/mrVTe4VR1 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; 18 Feb 2020 09:21:35 -0800 IronPort-SDR: S8xO3uFFLRD1TqyKFU8pL6ma5/8B8kwet+yOqr+L3CqCN7yUtxC37O7Lf/aO9h2/qETJDbBicc D7xlWY23U6qTbAIqoJ2ECwN+KIRUmzyer/UqodkAVAH32aYt2sf5E90wvvXj+mTUcqdGXo7O1G elwz685GdBI+xSzP2lCTyOQdaI9vFlZLDq494oPIcOHjQmoLNPwe1CUBRZ+RH/tUP1SByMYUzo kHOSMOvOJiez4+Pqdj7kQaAuvTR8sdeK1rKwNQ7hUXlENF3tsN/vRwbFEOvTQ0skAvnMZ5P49i blk= 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; 18 Feb 2020 09:28:56 -0800 From: Chaitanya Kulkarni To: damien.lemoal@wdc.com, axboe@kernel.dk Cc: linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 2/3] null_blk: add tracepoint helpers for zoned mode Date: Tue, 18 Feb 2020 09:28:39 -0800 Message-Id: <20200218172840.4097-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200218172840.4097-1-chaitanya.kulkarni@wdc.com> References: <20200218172840.4097-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 This patch adds two new tracpoints for null_blk_zoned.c that allows us to trace report-zones, zone-mgmt-op and zone-write operations which has direct effect on the zone condition state machine. Also, we update drivers/block/Makefile so that new null_blk related tracefiles can be compiled. Signed-off-by: Chaitanya Kulkarni --- Changes from V1:- 1. Use CONFIG_BLK_DEV_ZONE for null_blk_trace.o. -- drivers/block/Makefile | 3 ++ drivers/block/null_blk_trace.c | 20 +++++++++ drivers/block/null_blk_trace.h | 78 ++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 drivers/block/null_blk_trace.c create mode 100644 drivers/block/null_blk_trace.h diff --git a/drivers/block/Makefile b/drivers/block/Makefile index a53cc1e3a2d3..675eadbb8a91 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -6,6 +6,8 @@ # Rewritten to use lists instead of if-statements. # +ccflags-y += -I$(src) + obj-$(CONFIG_MAC_FLOPPY) += swim3.o obj-$(CONFIG_BLK_DEV_SWIM) += swim_mod.o obj-$(CONFIG_BLK_DEV_FD) += floppy.o @@ -39,6 +41,7 @@ obj-$(CONFIG_ZRAM) += zram/ obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk.o null_blk-objs := null_blk_main.o +null_blk-$(CONFIG_BLK_DEV_ZONED) += null_blk_trace.o null_blk-$(CONFIG_BLK_DEV_ZONED) += null_blk_zoned.o skd-y := skd_main.o diff --git a/drivers/block/null_blk_trace.c b/drivers/block/null_blk_trace.c new file mode 100644 index 000000000000..bd066130ff39 --- /dev/null +++ b/drivers/block/null_blk_trace.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * All trace related helpers for null_blk goes here. + */ +#include "null_blk_trace.h" + +/* + * Helper to use for all null_blk traces to extract disk name. + */ +const char *nullb_trace_disk_name(struct trace_seq *p, char *name) +{ + const char *ret = trace_seq_buffer_ptr(p); + + if (name && *name) + trace_seq_printf(p, "disk=%s, ", name); + trace_seq_putc(p, 0); + + return ret; +} diff --git a/drivers/block/null_blk_trace.h b/drivers/block/null_blk_trace.h new file mode 100644 index 000000000000..8171bc26f6d1 --- /dev/null +++ b/drivers/block/null_blk_trace.h @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * null_blk device driver tracepoints. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM nullb + +#if !defined(_TRACE_NULLB_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_NULLB_H + +#include +#include + +#include "null_blk.h" + +const char *nullb_trace_disk_name(struct trace_seq *p, char *name); + +#define __print_disk_name(name) \ + nullb_trace_disk_name(p, name) + +#ifndef TRACE_HEADER_MULTI_READ +static inline void __assign_disk_name(char *name, struct gendisk *disk) +{ + if (disk) + memcpy(name, disk->disk_name, DISK_NAME_LEN); + else + memset(name, 0, DISK_NAME_LEN); +} +#endif + +TRACE_EVENT(nullb_zone_op, + TP_PROTO(struct nullb_cmd *cmd, unsigned int zone_no, + unsigned int zone_cond), + TP_ARGS(cmd, zone_no, zone_cond), + TP_STRUCT__entry( + __array(char, disk, DISK_NAME_LEN) + __field(enum req_opf, op) + __field(unsigned int, zone_no) + __field(unsigned int, zone_cond) + ), + TP_fast_assign( + __entry->op = req_op(cmd->rq); + __entry->zone_no = zone_no; + __entry->zone_cond = zone_cond; + __assign_disk_name(__entry->disk, cmd->rq->rq_disk); + ), + TP_printk("%s req=%-15s zone_no=%u zone_cond=%-10s", + __print_disk_name(__entry->disk), + blk_op_str(__entry->op), + __entry->zone_no, + blk_zone_cond_str(__entry->zone_cond)) +); + +TRACE_EVENT(nullb_report_zones, + TP_PROTO(struct nullb *nullb, unsigned int nr_zones), + TP_ARGS(nullb, nr_zones), + TP_STRUCT__entry( + __array(char, disk, DISK_NAME_LEN) + __field(unsigned int, nr_zones) + ), + TP_fast_assign( + __entry->nr_zones = nr_zones; + __assign_disk_name(__entry->disk, nullb->disk); + ), + TP_printk("%s nr_zones=%u", + __print_disk_name(__entry->disk), __entry->nr_zones) +); + +#endif /* _TRACE_NULLB_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE null_blk_trace + +/* This part must be outside protection */ +#include From patchwork Tue Feb 18 17:28:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11389175 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 3B6BF139A for ; Tue, 18 Feb 2020 17:29:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BFB424670 for ; Tue, 18 Feb 2020 17:29:07 +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="N4r3opbr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbgBRR3G (ORCPT ); Tue, 18 Feb 2020 12:29:06 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:15390 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbgBRR3G (ORCPT ); Tue, 18 Feb 2020 12:29:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1582046946; x=1613582946; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IJ7i0rEGmDdG/KotE2lMQ4FxHy3uyDFPZA5C2RNJXu4=; b=N4r3opbrGagUTO9dkMoY6cKteLE/is6wgwbLGRn0e4O9vjrC+XBuWlfC FNieNE2Ug+1+g+JE+n692cQN0FqV2WsM9B84lMqCtLXOjOP4iHFCwLH3r NC+ryYATWLYQ5jwR3Qi1lvWjsC02TapoH8gIQx1V00SIXyLHuULejCPQF w0sOE0gS3bhJYZP1Mm65hfS23EqWZ1BVWMeUd3KHAeVQxlj+xJ7raLV1h o+SxZ4qtqYP+CN3tXv8NnReMwUWmGkN4wp7oLcxFj5Jabekl08fQO2C4L D1KxCaI023l4V8Hps7fy8kXk2BO9quufE/LWiIIrZxryK+hHiTL3RZ0jw g==; IronPort-SDR: nJF1BGeDPaHXI67jh+NSqJGYr06OQGTDrluCwabekG5mUNTuUOKsJk9vmB4yoZ0wyIyT/oRtPa uw7lxF6vZ+Rq9ykKPEUmJ2AAFydg0uJlObKLodUlhui/a+/Hp44ShKw2xr88X+PaMXZ68jMbQo eONdNVuQ/WfVUL2ddWWCIgQ2+KWOC9XGQbnw0aZ2yB/w9lAFknvCsKTbgUr+QkrFjTo0YoW6eJ r+iTnl/AtcTCU6sMZeuQCtpT3J6tekHJWlDc5W5t+5qYxcpLNv2GrF5qeGmGyQOBfZIBNUtEjP pGs= X-IronPort-AV: E=Sophos;i="5.70,456,1574092800"; d="scan'208";a="130638281" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 19 Feb 2020 01:29:03 +0800 IronPort-SDR: QXrJ2lCIn7d+vc/dhoqLE/mjgtbRI00QI8jomSzTWKvW6RuYwGnaEawkpOP/Rynsw/lzK0GTC7 1/ZnQiS0kq6scOT8xJySS1ObMUVLAVGgWIbCvvQSjIcc2cMlAIU8fi+JXkAYqlYcXYKR5l0zDP +wfRUOCKPO1iso4NRIwWT6IaiJCRiV5uXjDf38l16Wz8WHHdc7W0JgZOhTxC17RHgEfIZm1dTo 6p0yoYnXgUIB5/+OnZETGPBBUppbKdOmsNE9RLxszkGxgqyQluxkQh1mJsoT6hHwWuH1Zh1kI7 3/aF1M0J1UiKv78Ewp2SNAeK 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; 18 Feb 2020 09:21:41 -0800 IronPort-SDR: KHfJ0TBlNsthanmot7Beu/Z02SM1k1+OFA3D2vAKLw73F9iAMOx6L+j4Ie3tALL6z0YHDeWR9m WKNXhKQYduAAHUw7I8A6b4BWfs5jS+B84h2VwSh9F0SLs6GEZGYKDX+3+NIX8tJr95mSx5547N RJxGdR1bnP3lPxuIpT3Q6mfTFUv7b+oCv+M+Lbj7IfHASoqkjx2U+NVj4zge65Oi6z41/STNtZ 6Vku7ozl1Ml/XoCRCGQLDdlYs06+0QsnOPdkFOghN42142+P4vXJzRRCVK6yafz5/0tG8L6tmt 32I= 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; 18 Feb 2020 09:29:02 -0800 From: Chaitanya Kulkarni To: damien.lemoal@wdc.com, axboe@kernel.dk Cc: linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 3/3] null_blk: add trace in null_blk_zoned.c Date: Tue, 18 Feb 2020 09:28:40 -0800 Message-Id: <20200218172840.4097-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200218172840.4097-1-chaitanya.kulkarni@wdc.com> References: <20200218172840.4097-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 With the help of previously added tracepoints we can now trace report-zones, zone-write and zone-mgmt ops in null_blk_zoned.c. Reviewed-by: Damien Le Moal Signed-off-by: Chaitanya Kulkarni --- drivers/block/null_blk_zoned.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/block/null_blk_zoned.c b/drivers/block/null_blk_zoned.c index ed34785dd64b..673618d8222a 100644 --- a/drivers/block/null_blk_zoned.c +++ b/drivers/block/null_blk_zoned.c @@ -2,6 +2,9 @@ #include #include "null_blk.h" +#define CREATE_TRACE_POINTS +#include "null_blk_trace.h" + /* zone_size in MBs to sectors. */ #define ZONE_SIZE_SHIFT 11 @@ -80,6 +83,8 @@ int null_report_zones(struct gendisk *disk, sector_t sector, return 0; nr_zones = min(nr_zones, dev->nr_zones - first_zone); + trace_nullb_report_zones(nullb, nr_zones); + for (i = 0; i < nr_zones; i++) { /* * Stacked DM target drivers will remap the zone information by @@ -148,6 +153,8 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector, /* Invalid zone condition */ return BLK_STS_IOERR; } + + trace_nullb_zone_op(cmd, zno, zone->cond); return BLK_STS_OK; } @@ -155,7 +162,8 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op, sector_t sector) { struct nullb_device *dev = cmd->nq->dev; - struct blk_zone *zone = &dev->zones[null_zone_no(dev, sector)]; + unsigned int zone_no = null_zone_no(dev, sector); + struct blk_zone *zone = &dev->zones[zone_no]; size_t i; switch (op) { @@ -203,6 +211,8 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op, default: return BLK_STS_NOTSUPP; } + + trace_nullb_zone_op(cmd, zone_no, zone->cond); return BLK_STS_OK; }