From patchwork Wed Mar 25 17:49:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11458483 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 3480D92A for ; Wed, 25 Mar 2020 18:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 147222076F for ; Wed, 25 Mar 2020 18:55:12 +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="OaSPysT3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727328AbgCYSzL (ORCPT ); Wed, 25 Mar 2020 14:55:11 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:50381 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbgCYSzL (ORCPT ); Wed, 25 Mar 2020 14:55:11 -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=1585162511; x=1616698511; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bkMzVBDta558kT2wvvFlS6P0DKc8Tj3eUft9+9uROT8=; b=OaSPysT3HB77iDBZx054Px9GEcIKcit8E9CsnKpCxyRzqXbciWyReBVV ayBrjiBh6Rdl3s6a0CRE+1yQb1UfYZPobs6R6I7hObhGhadHicZ4Q3zkn D5uFFZ/3qnwQ9mlCDQR6BB/6KTBBIUmZcDk894lvKTKhz7fcZn1A1i3Ns j9pJJ81bewSE8PB7HOodqvpMl0bcmn+v/COA33Mni5LKTJ/YZQkAxeGnn +EAYTcp7zPj3veptJeBkdxPABMSidPN9ZBenh8R3X577kf2yY5rOrywu3 OWqnFZ/VZzXIUyfMu7j9B+9eoEmcA0yIeKSOy0DcCWeWVZTr2fawzE0/w A==; IronPort-SDR: H7OVvwFjqwNpD3QH9Xr/CHEwVh/UTYF78gT/Q3jQgUaU8Ql5GKa3xbvJyy0sQLDbhO6CknBtpg Rf9o9q0gSvvHA2Q0GgDeKS6xb5RzMvWu2D/zQl2mAbCevQYN0tamh+PIjJkMyV///H1XohWR7D wc5Xw1yQ++7h6dSdgiXolEOFc7eVpKjDJVaaGq9NgGupa12Q0f6n+xTXjtOPrEa5n85+nHEu1L fDzA/jlih2D6VQB6FzhYVa6Aujy3VX/S/jfzFe2G1USYOj3W+mykvQXU0iHwra49t6Rha8V9zO gyM= X-IronPort-AV: E=Sophos;i="5.72,305,1580745600"; d="scan'208";a="241991776" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Mar 2020 02:55:11 +0800 IronPort-SDR: jJTaAhKD5FUVM2sig1QggdxaO8gqK9BwG6YL+dDb6iHyYpMb/2LZo/FUq3crz1q7zigMrTiGKX jjIakjHQj4zSElUp6eGqSHy2SprT5UJbjzcKaVSnri+uZZ3Z+kOoKaxOrMuDxFlMA6wfrC8wYj G9B4jql3THZpDoE29/W+z2HAefoOyl6EHMneEh6Ew6IieYGkwEuxati+ErwK3R2KVxnFrhJsA1 1kdymIqUW0Cbx/C14/P/3tNrOsp77Pq1mrGGE5u/MA0XuifH5h57MWkkI6ufLYDL+n53xUA3QX OsAEFAhitrJQfDgsWCmCq7fF Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 11:46:21 -0700 IronPort-SDR: RJfyZRdBpPzc5tbb/RwaZymtOQuihmeAUyCAGlDDubww2L8qYFdqP5EKPrY/dYg+dw5oPNM3Bk BluWRhFdGVnTUa9RTHLCrvKhPAR2xZjNkUQTNJxvE1+5ywfKvuDVeOhymPD5wpXDsVxRF9iAgK QhUrgig7oJ7W5C3F3eGgZw9NQ3pv/shqm5UUrCFifHLU+2mVRtFma3ZDBP4ycnt/yCFtwaIeLN FuqKCLbkdXHnv6o6nY56KLK4fBZAxSItlaQpl8MexSarqo67rx8XEyaMiEa8CGxQDui/zKmKZ7 2fY= WDCIronportException: Internal Received: from ioprio.labspan.wdc.com (HELO ioprio.sc.wdc.com) ([10.6.139.89]) by uls-op-cesaip01.wdc.com with ESMTP; 25 Mar 2020 11:55:11 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V4 1/3] block: add a zone condition debug helper Date: Wed, 25 Mar 2020 10:49:54 -0700 Message-Id: <20200325174956.16719-2-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200325174956.16719-1-chaitanya.kulkarni@wdc.com> References: <20200325174956.16719-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 Reviewed-by: Damien Le Moal --- block/blk-zoned.c | 32 ++++++++++++++++++++++++++++++++ include/linux/blkdev.h | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 6b442ae96499..f87956e0dcaf 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 53a1325efbc3..8ab1f4526f72 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -952,6 +952,10 @@ static inline unsigned int blk_rq_stats_sectors(const struct request *rq) } #ifdef CONFIG_BLK_DEV_ZONED + +/* Helper to convert BLK_ZONE_ZONE_XXX to its string format XXX */ +const char *blk_zone_cond_str(enum blk_zone_cond zone_cond); + static inline unsigned int blk_rq_zone_no(struct request *rq) { return blk_queue_zone_no(rq->q, blk_rq_pos(rq)); From patchwork Wed Mar 25 17:49:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11458485 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 C16371392 for ; Wed, 25 Mar 2020 18:55:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 993CB20774 for ; Wed, 25 Mar 2020 18:55:18 +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="Gs0KpXdb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727275AbgCYSzS (ORCPT ); Wed, 25 Mar 2020 14:55:18 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:44174 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbgCYSzS (ORCPT ); Wed, 25 Mar 2020 14:55:18 -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=1585162517; x=1616698517; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UTxvAClUXETgUf5DJpiFRfRGG9W8afOr5c6Vq+QrYaA=; b=Gs0KpXdbZ2LAnjyiuzT5K8DME/f8w7Gt8n5cM0nRi+7LTYCNeNJy5WRb yWsanL9a8OHGEG+VupnsPifJ8Ol7DD363o+BVyBXDPsFOeLo/Peku4x+w FXzctLegP2zuMnnY7sbawZoNUJi+WZeMtX88uLaNpeVrQWJrYxdskta09 Y0wJY2SyqK3yQLhDd/+/k4edx3pl+i/1MTKN4Lnt44/+clVs76oIbMxPw panMX3L9Q+jbJ5fhMAd44Ru2izQwM20IdTJSW+1RBUuOJOYFGz8ftpKsR EKRy9/5JkXBm8cAQ+LfRaWS86faBOzU/naVbbTJk+gfac+t6qcMH+OM1p Q==; IronPort-SDR: A+rjrvf5fFkiQNk5utj46Nj+mO2jQiuhYzJiilBvXAYYj4tacYd23llIPBvaZE2b0GJi//gZ8q 9WPUyvT1g/p7VZ23YzE0KaQUCa98lZsIEUx6PThhxyVBgKLHGz3ab/PcQeQOh3LDlmJYrhYGUm kWWwLiUfq+CwSShxTVfBBrBmpoy4EePD4idQ3aIxywYGQFdbWQwIhMum29CO9RSa/J/SEOu9UN BUnmhMcjF0NyoKWCEjNZLPumbZ0ZhvCYhZZQkQT7MGUb+a525+9WoDuztD3GwWQxVEh//gGnEo gAc= X-IronPort-AV: E=Sophos;i="5.72,305,1580745600"; d="scan'208";a="133494478" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Mar 2020 02:55:16 +0800 IronPort-SDR: 3cCq5ll4yUJYIOsm+CQdcG1U7hQHYzXP2yQ8kZ35Rrd/9Mgg+N98A8xjxI1/bx9dCWqvVMXoi9 m9fa3pgNeyauRbQ2oUlLamEczMM+BECqz38Wgr5iiMUlc9631Vnj8ip90aInLBlQ9oYHjU48x6 w/hwiWIUZe3C1AjM54xJfrjMCJVkKeM7hYU9GL62Jo/XNyD4y3Z3pylEuMseyXIRhPHh1iguAG uODRbxfYZfLicuYDzYcGaMtGvlsDcE/QtbY9v9wDK+M2F3LNPd0KjnxcnF7SmUiHWXfkU1s/lq SGTVtCg+UGo5Ai/8XCDDWqKv Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 11:46:27 -0700 IronPort-SDR: ET50n/6soBimuGgfKxbVRYMSfuQlt3VbiQT43zbvzfSiPowk2wULDdJLOryhfuHWC/mCU5XP/t x/XgnOF+3DD4096SVhzSrIfkr97qf+YaM6N/NFDAci57eQPR/Khn5i5lBbr95sL/OsBHbw7aFP 1pUTxYjtap76NJLrqnM+zNYESZVDncw8/+MYA7mvWL/x1w+xrzuH9MsNJqPqioARMZjui3BJxr kWbI6OOXbsaMuivUZCq+dvkhKfxjCOgnj+0FErd8CLBPkG0PKV+psQX7IKjo8Qp3P+ElQfpHOJ oGQ= WDCIronportException: Internal Received: from ioprio.labspan.wdc.com (HELO ioprio.sc.wdc.com) ([10.6.139.89]) by uls-op-cesaip01.wdc.com with ESMTP; 25 Mar 2020 11:55:17 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V4 2/3] null_blk: add tracepoint helpers for zoned mode Date: Wed, 25 Mar 2020 10:49:55 -0700 Message-Id: <20200325174956.16719-3-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200325174956.16719-1-chaitanya.kulkarni@wdc.com> References: <20200325174956.16719-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 Reviewed-by: Damien Le Moal --- drivers/block/Makefile | 6 +++ drivers/block/null_blk_trace.c | 21 +++++++++ drivers/block/null_blk_trace.h | 79 ++++++++++++++++++++++++++++++++++ 3 files changed, 106 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..795facd8cf19 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -6,6 +6,9 @@ # Rewritten to use lists instead of if-statements. # +# needed for trace events +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 +42,9 @@ obj-$(CONFIG_ZRAM) += zram/ obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk.o null_blk-objs := null_blk_main.o +ifeq ($(CONFIG_BLK_DEV_ZONED), y) +null_blk-$(CONFIG_TRACING) += null_blk_trace.o +endif 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..f246e7bff698 --- /dev/null +++ b/drivers/block/null_blk_trace.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * null_blk trace related helpers. + * + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ +#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..4f83032eb544 --- /dev/null +++ b/drivers/block/null_blk_trace.h @@ -0,0 +1,79 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * null_blk device driver tracepoints. + * + * Copyright (C) 2020 Western Digital Corporation or its affiliates. + */ + +#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 Wed Mar 25 17:49:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 11458487 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 65F671392 for ; Wed, 25 Mar 2020 18:55:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4511D20774 for ; Wed, 25 Mar 2020 18:55:23 +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="VEMCsO1r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbgCYSzW (ORCPT ); Wed, 25 Mar 2020 14:55:22 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:44174 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbgCYSzW (ORCPT ); Wed, 25 Mar 2020 14:55:22 -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=1585162521; x=1616698521; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SMqrVIxmyvYEcdfWLdY4bxb+aY3Ae9gNUDcSxMsnEZw=; b=VEMCsO1rYFFOjoVkIdub6wYHAVL4233DfKiOZQA2dzq04bI39F1tx4uH awdj+EIKzuC5U37x1DbCLrSQGmheU388Buuyaml+71EcR/udtNY0jeDRy YmTFLugqBZT+6CUlYw4W2fG6x5Dmc/dHE4bL1qnrAhAHSGGtNBXuvEhfM sB1tTU7VaFxGHCxa4pauO4ASbeNB8YGvayR+nzTe2jT6zARuPPhKIQBEZ tjccPE7SJTCZUlwlx6Y8NyhUvh6YDXugTlZv++UyDLNqREIWGaewKp2xQ JxozThUF+ooaTDbzl73NDPUlTGbaeK3OZHTBvYt7bd48p7tZ2TwLr5mVE Q==; IronPort-SDR: TcC9jFpMxsU6qA/iU95ks46ss0ADUC37Ukm5Sg9fhg2naL8Sofd2NfjIcC5+2hiBORkDh7WtJD h/+lKqXon7/2EuLe0UsfnLVYkN6cnNekfsrcMQq+UIrNmm5zW0gFozipei1tSFRRp+pq5vTKbv IjArFgEQKoU9s0OHiSsrmlUzgjxYzX25bZQfO730wt/AyVljEHPkMqx00ukGcysNtaOgXxxLvh ct3VljDdmbMbNS5Hv6YeMgufv5MaLNIpi6X/cUTtY+PVvXyHUBmYb7BzbVqkhRdOt7RFWW1VN4 WIw= X-IronPort-AV: E=Sophos;i="5.72,305,1580745600"; d="scan'208";a="133494483" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Mar 2020 02:55:21 +0800 IronPort-SDR: UiKs4zX1bW/Rcdz3Vs77itZllb7Mw0XMo2wLZ7HpnWPWOZIasinaNG0ADi8Oi7DonHHSRvUDkE sJcEz3XLNdRbPZYI08/7QbIGL0ZnWva5agGxw7iibzQlTl7iUWLr2Jei3RUvICWtxJFBPK6ep0 NU+gWF6eZneRnLIuoKVnXv3SIbD3Ue2IuWcIDCBnW4fWpKgIPcY9Z9Tz4Y0vKzeTNET1j9Qmte +GHmL5/ckZwFT5nQmofXPsVf6RRRtR+HRTk3Zql9+FOIefpZyR2IGNS3dHZik3wjsOmpL4XoiH QI6msuf3sV+SrLcnaPV3ERJd Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 11:46:32 -0700 IronPort-SDR: NOFjULn9ceRjRiDFEhpfnVCdLEWQCs1MIXnVFZkdirhBuRpYs2W3XZXjxx9axGmBMVhRRFL9Gw m/bY3RVDz1qdSST/tqZxLXuH/x4eZGchcPecvulnxKI/F4wmtlJlCfURzR3frbaRxkHkF07uW9 OykDknPKUB5Jxj+ndyL6/TnWfe6oD45rPnTuXMBEXT+Su8UAUBopUNcpZRwZ2cvqKB7LZTMwfY KI3gYHZ/bviM2+sJDZlGuIhsoVQA22AsItXgJITPDQ3wEtMxVqsszHiibkHOwRUYfCkQuIEII8 gEQ= WDCIronportException: Internal Received: from ioprio.labspan.wdc.com (HELO ioprio.sc.wdc.com) ([10.6.139.89]) by uls-op-cesaip01.wdc.com with ESMTP; 25 Mar 2020 11:55:22 -0700 From: Chaitanya Kulkarni To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, damien.lemoal@wdc.com, Chaitanya Kulkarni Subject: [PATCH V4 3/3] null_blk: add trace in null_blk_zoned.c Date: Wed, 25 Mar 2020 10:49:56 -0700 Message-Id: <20200325174956.16719-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200325174956.16719-1-chaitanya.kulkarni@wdc.com> References: <20200325174956.16719-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. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal --- 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; }