Received: by 10.192.165.156 with SMTP id m28csp731192imm; Mon, 16 Apr 2018 07:52:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Uzl4zsnTu8Rn9yozhr5Sq7l/WlsbSjv4huRZxwtwbL5Pa7dgJeLs5RrrmBE8uCax2D8k7 X-Received: by 10.98.104.199 with SMTP id d190mr2688709pfc.111.1523890343804; Mon, 16 Apr 2018 07:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523890343; cv=none; d=google.com; s=arc-20160816; b=HS28x/QNX0WBZhl3YgzYWvFmUVb31DAJNvrB0mP/PsksNlwRpwfhZrk0CM1agJV/cY d5IrW12TPc08XNpNFdP2pRufge1PclJMTOpljiKrt6JkDO/+HEHbyc0X7OW2S2v5lxGB tejxVT7FjvEtk8VYV8tRMZqJvl5YFs1GSRv4Nw3dvweu8kUR/dHsYEQmQqWSxxsOXfDU F3mA9nDTdXPNiwTV9dXYkbyNHHal80DoJEDCPLcw21Dk3T4NgUzrju6KQg77qO5XQem1 5Pk+/Q7iGsibt4D4ti2PUuaxwsOiZ+3k+26UssyIgSk6nEI8VYhhKVRat4mEX6o7TfuD cuMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=TB3ZhnDtoIlivjFGguX7+OQwJKP45ZuEvgs4CelkYYc=; b=dyWiVnmUz/1NflBgS78yhS+DStMogBet43l8Vhc5qqovQWBzpsz4B3VGneTMDDeVjs AnHW9ss+ijBaDlaeIcTlGHVZNklD+SPQTogIXEzlkkpp8GCAZANj2Hpnxu6N6pXym55y kuUI/g7vk67HMOLtVJEaa4DOcQ9hjD4kjX2gIbMHrXiaNgLiRfqfTZ18fMjm0o+lyUiz dY7BsdU/CO7UEcTs3Z4guKMGbTVYcrCt66S1HG+yTOoTCey6BopMnQI0KT5jldmrjrE5 Pvy4CL3J/jk2U/WM+vhWG0F0WAHDijNqeSLNNAvtZLJT7ID9o6a2K4wFclZV7l5nA+1U wXsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8si9994289pgf.679.2018.04.16.07.52.09; Mon, 16 Apr 2018 07:52:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752775AbeDPOu0 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 16 Apr 2018 10:50:26 -0400 Received: from mailout.micron.com ([137.201.242.129]:62164 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbeDPOuR (ORCPT ); Mon, 16 Apr 2018 10:50:17 -0400 X-Greylist: delayed 1062 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 Apr 2018 10:50:13 EDT Received: from mail.micron.com (bowex36d.micron.com [137.201.85.223]) by mailout.micron.com (8.14.4/8.14.6) with ESMTP id w3GEXXW6007176; Mon, 16 Apr 2018 08:33:33 -0600 Received: from SIWEX4A.sing.micron.com (10.160.29.65) by bowex36d.micron.com (137.201.85.223) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 16 Apr 2018 08:33:32 -0600 Received: from SIWEX5A.sing.micron.com (10.160.29.59) by SIWEX4A.sing.micron.com (10.160.29.65) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 16 Apr 2018 22:33:30 +0800 Received: from SIWEX5A.sing.micron.com ([fe80::a9c5:8ccb:fd84:268d]) by SIWEX5A.sing.micron.com ([fe80::a9c5:8ccb:fd84:268d%25]) with mapi id 15.00.1347.000; Mon, 16 Apr 2018 22:33:30 +0800 From: "Bean Huo (beanhuo)" To: Steven Rostedt , "axboe@kernel.dk" , "jejb@linux.vnet.ibm.com" , "martin.petersen@oracle.com" CC: "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mingo@redhad.com" , "Bart.VanAssche@sandisk.com" , "linux-kernel@vger.kernel.org" , "Bean Huo (beanhuo)" , "rajatja@google.com" Subject: [RESEND PATCH v1 2/2] trace: events: block: Add tag in block trace events Thread-Topic: [RESEND PATCH v1 2/2] trace: events: block: Add tag in block trace events Thread-Index: AdPVj891kSAdtlOyRKy4BVmHjk9SYA== Date: Mon, 16 Apr 2018 14:33:29 +0000 Message-ID: <64d6073b28b140cda3e5870a54e0a7bc@SIWEX5A.sing.micron.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.160.29.124] X-TM-AS-Product-Ver: SMEX-12.0.0.1782-8.200.1013-23786.005 X-TM-AS-Result: No--7.202700-0.000000-31 X-TM-AS-MatchedID: 707163-703788-121665-851106-188019-700767-706592-851458-7 00200-702097-701646-700079-860560-700264-702474-121224-148004-148050-148980 -42000-42003-29961-63 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No x-mt-checkinternalsenderrule: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 137.201.82.98 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Print the request tag along with other information in block trace events when tracing request , and unplug type (Sync / Async). Signed-off-by: Bean Huo --- include/trace/events/block.h | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 81b43f5..f8c0b9e 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h @@ -81,6 +81,7 @@ TRACE_EVENT(block_rq_requeue, __field( dev_t, dev ) __field( sector_t, sector ) __field( unsigned int, nr_sector ) + __field( int, tag ) __array( char, rwbs, RWBS_LEN ) __dynamic_array( char, cmd, 1 ) ), @@ -89,16 +90,17 @@ TRACE_EVENT(block_rq_requeue, __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; __entry->sector = blk_rq_trace_sector(rq); __entry->nr_sector = blk_rq_trace_nr_sectors(rq); + __entry->tag = rq->tag; blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); __get_str(cmd)[0] = '\0'; ), - TP_printk("%d,%d %s (%s) %llu + %u [%d]", + TP_printk("%d,%d %s (%s) %llu + %u tag=%d [%d]", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, __get_str(cmd), (unsigned long long)__entry->sector, - __entry->nr_sector, 0) + __entry->nr_sector, __entry->tag, 0) ); /** @@ -124,6 +126,7 @@ TRACE_EVENT(block_rq_complete, __field( sector_t, sector ) __field( unsigned int, nr_sector ) __field( int, error ) + __field( int, tag ) __array( char, rwbs, RWBS_LEN ) __dynamic_array( char, cmd, 1 ) ), @@ -133,16 +136,17 @@ TRACE_EVENT(block_rq_complete, __entry->sector = blk_rq_pos(rq); __entry->nr_sector = nr_bytes >> 9; __entry->error = error; + __entry->tag = rq->tag; blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, nr_bytes); __get_str(cmd)[0] = '\0'; ), - TP_printk("%d,%d %s (%s) %llu + %u [%d]", + TP_printk("%d,%d %s (%s) %llu + %u tag=%d [%d]", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, __get_str(cmd), (unsigned long long)__entry->sector, - __entry->nr_sector, __entry->error) + __entry->nr_sector, __entry->tag, __entry->error) ); DECLARE_EVENT_CLASS(block_rq, @@ -156,6 +160,7 @@ DECLARE_EVENT_CLASS(block_rq, __field( sector_t, sector ) __field( unsigned int, nr_sector ) __field( unsigned int, bytes ) + __field( int, tag ) __array( char, rwbs, RWBS_LEN ) __array( char, comm, TASK_COMM_LEN ) __dynamic_array( char, cmd, 1 ) @@ -166,17 +171,18 @@ DECLARE_EVENT_CLASS(block_rq, __entry->sector = blk_rq_trace_sector(rq); __entry->nr_sector = blk_rq_trace_nr_sectors(rq); __entry->bytes = blk_rq_bytes(rq); + __entry->tag = rq->tag; blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); __get_str(cmd)[0] = '\0'; memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), - TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", + TP_printk("%d,%d %s %u (%s) %llu + %u tag=%d [%s]", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, __entry->bytes, __get_str(cmd), (unsigned long long)__entry->sector, - __entry->nr_sector, __entry->comm) + __entry->nr_sector, __entry->tag, __entry->comm) ); /** @@ -297,6 +303,7 @@ DECLARE_EVENT_CLASS(block_bio_merge, __field( dev_t, dev ) __field( sector_t, sector ) __field( unsigned int, nr_sector ) + __field( int, tag ) __array( char, rwbs, RWBS_LEN ) __array( char, comm, TASK_COMM_LEN ) ), @@ -305,14 +312,15 @@ DECLARE_EVENT_CLASS(block_bio_merge, __entry->dev = bio_dev(bio); __entry->sector = bio->bi_iter.bi_sector; __entry->nr_sector = bio_sectors(bio); + __entry->tag = rq->tag; blk_fill_rwbs(__entry->rwbs, bio->bi_opf, bio->bi_iter.bi_size); memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), - TP_printk("%d,%d %s %llu + %u [%s]", + TP_printk("%d,%d %s %llu + %u tag=%d [%s]", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, (unsigned long long)__entry->sector, - __entry->nr_sector, __entry->comm) + __entry->nr_sector, __entry->tag, __entry->comm) ); /** @@ -478,15 +486,18 @@ DECLARE_EVENT_CLASS(block_unplug, TP_STRUCT__entry( __field( int, nr_rq ) + __field( bool, explicit ) __array( char, comm, TASK_COMM_LEN ) ), TP_fast_assign( __entry->nr_rq = depth; + __entry->explicit = explicit; memcpy(__entry->comm, current->comm, TASK_COMM_LEN); ), - TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) + TP_printk("[%s] %d %s", __entry->comm, __entry->nr_rq, + __entry->explicit ? "Sync" : "Async") ); /** @@ -611,6 +622,7 @@ TRACE_EVENT(block_rq_remap, __field( dev_t, dev ) __field( sector_t, sector ) __field( unsigned int, nr_sector ) + __field( int, tag ) __field( dev_t, old_dev ) __field( sector_t, old_sector ) __field( unsigned int, nr_bios ) @@ -621,18 +633,20 @@ TRACE_EVENT(block_rq_remap, __entry->dev = disk_devt(rq->rq_disk); __entry->sector = blk_rq_pos(rq); __entry->nr_sector = blk_rq_sectors(rq); + __entry->tag = rq->tag; __entry->old_dev = dev; __entry->old_sector = from; __entry->nr_bios = blk_rq_count_bios(rq); blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); ), - TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u", + TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u, tag=%d", MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, (unsigned long long)__entry->sector, __entry->nr_sector, MAJOR(__entry->old_dev), MINOR(__entry->old_dev), - (unsigned long long)__entry->old_sector, __entry->nr_bios) + (unsigned long long)__entry->old_sector, __entry->nr_bios, + __entry->tag) ); #endif /* _TRACE_BLOCK_H */ -- 2.7.4