From fb3b52a7346202fea1905ed680a3256d372a7b03 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Fri, 6 Mar 2009 00:16:50 -0500 Subject: PR9871: use @cast in tapset Rewrite some functions using type casting to get rid of embedded C code in nfs, scsi, signal, socket, rpc, task and vfs tapset. Signed-off-by: Wenji Huang --- tapset/scsi.stp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tapset/scsi.stp') diff --git a/tapset/scsi.stp b/tapset/scsi.stp index 76b9a114..b1b2d19b 100644 --- a/tapset/scsi.stp +++ b/tapset/scsi.stp @@ -136,9 +136,7 @@ function scsi_timer_pending:long(var:long) %} function get_devstate_from_req:long(var:long) -%{ /* pure */ - struct request_queue *q = (struct request_queue *)((long)THIS->var); - struct scsi_device *sdev = (struct scsi_device *)kread(&(q->queuedata)); - THIS->__retvalue = kread(&(sdev->sdev_state)); - CATCH_DEREF_FAULT(); -%} +{ + sdev = @cast(var, "request_queue", "kernel")->queuedata + return @cast(sdev, "scsi_device", "kernel")->sdev_state +} -- cgit From 6351f32433edb111b28362963c97d1cd0d1d8561 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 10 Mar 2009 15:46:21 -0700 Subject: PR9932: use @cast module search path The nfs, rpc, and scsi tapsets use @cast on types that may be compiled into a kernel module or into the main kernel binary. The @cast search path separated with colons lets us search both the kernel and the module. For a couple of cases, I also merged sequential @casts that work just fine as a single cast with a multiple-level dereference. --- tapset/scsi.stp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tapset/scsi.stp') diff --git a/tapset/scsi.stp b/tapset/scsi.stp index b1b2d19b..6d332e8b 100644 --- a/tapset/scsi.stp +++ b/tapset/scsi.stp @@ -137,6 +137,6 @@ function scsi_timer_pending:long(var:long) function get_devstate_from_req:long(var:long) { - sdev = @cast(var, "request_queue", "kernel")->queuedata - return @cast(sdev, "scsi_device", "kernel")->sdev_state + sdev = @cast(var, "request_queue", "kernel:scsi_mod")->queuedata + return @cast(sdev, "scsi_device", "kernel:scsi_mod")->sdev_state } -- cgit From 2f440553d602cb3e2903803539216739b21b4c42 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 16 Mar 2009 14:21:51 +1000 Subject: fixed format of non-grabbable comments (for Tapset Reference Guide), added tapsetdescription for man page generator (in development) --- tapset/scsi.stp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tapset/scsi.stp') diff --git a/tapset/scsi.stp b/tapset/scsi.stp index 6d332e8b..8ff3dcca 100644 --- a/tapset/scsi.stp +++ b/tapset/scsi.stp @@ -5,7 +5,9 @@ // redistribute it and/or modify it under the terms of the GNU General // Public License (GPL); either version 2, or (at your option) any // later version. - +// +// This family of probe points is used to probe SCSI activities. +// %{ #include #include @@ -21,7 +23,7 @@ * @disk_minor: The minor number of the disk (-1 if no information) * @device_state: The current state of the device. */ -/* FIXME describe the device_state */ +// FIXME describe the device_state probe scsi.ioentry = module("scsi_mod").function("scsi_prep_fn@drivers/scsi/scsi_lib.c")?, kernel.function("scsi_prep_fn@drivers/scsi/scsi_lib.c")? @@ -107,7 +109,7 @@ probe scsi.iodone * the device * @goodbytes: The bytes completed. */ -/* mid-layer processes the completed IO */ +// mid-layer processes the completed IO probe scsi.iocompleted = module("scsi_mod").function("scsi_io_completion@drivers/scsi/scsi_lib.c")?, kernel.function("scsi_io_completion@drivers/scsi/scsi_lib.c")? -- cgit From 929a278ec01bc14630d247788352a2aaab372ddd Mon Sep 17 00:00:00 2001 From: ddomingo Date: Tue, 17 Mar 2009 13:56:21 +1000 Subject: further cleanup for formatting --- tapset/scsi.stp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tapset/scsi.stp') diff --git a/tapset/scsi.stp b/tapset/scsi.stp index 8ff3dcca..1c52355a 100644 --- a/tapset/scsi.stp +++ b/tapset/scsi.stp @@ -47,8 +47,8 @@ probe scsi.ioentry * @dev_id: The scsi device id * @device_state: The current state of the device. * @data_direction: The data_direction specifies whether this command is from/to - * the device. 0 (DMA_BIDIRECTIONAL), 1 (DMA_TO_DEVICE), - * 2 (DMA_FROM_DEVICE), 3 (DMA_NONE) + * the device. 0 (DMA_BIDIRECTIONAL), 1 (DMA_TO_DEVICE), + * 2 (DMA_FROM_DEVICE), 3 (DMA_NONE) * @request_buffer: The request buffer address * @req_bufflen: The request buffer length */ @@ -81,7 +81,7 @@ probe scsi.iodispatching * @dev_id: The scsi device id * @device_state: The current state of the device * @data_direction: The data_direction specifies whether this command is - * from/to the device. + * from/to the device. */ probe scsi.iodone = module("scsi_mod").function("scsi_done@drivers/scsi/scsi.c")?, @@ -106,7 +106,7 @@ probe scsi.iodone * @dev_id: The scsi device id * @device_state: The current state of the device * @data_direction: The data_direction specifies whether this command is from/to - * the device + * the device * @goodbytes: The bytes completed. */ // mid-layer processes the completed IO -- cgit From 83b85c2b0be729352bae4ea204d814b377b32fcf Mon Sep 17 00:00:00 2001 From: ddomingo Date: Tue, 17 Mar 2009 15:13:23 +1000 Subject: minor edits --- tapset/scsi.stp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tapset/scsi.stp') diff --git a/tapset/scsi.stp b/tapset/scsi.stp index 1c52355a..f8859be2 100644 --- a/tapset/scsi.stp +++ b/tapset/scsi.stp @@ -46,8 +46,8 @@ probe scsi.ioentry * @lun: The lun number * @dev_id: The scsi device id * @device_state: The current state of the device. - * @data_direction: The data_direction specifies whether this command is from/to - * the device. 0 (DMA_BIDIRECTIONAL), 1 (DMA_TO_DEVICE), + * @data_direction: The data_direction specifies whether this command is from/to the device. + * 0 (DMA_BIDIRECTIONAL), 1 (DMA_TO_DEVICE), * 2 (DMA_FROM_DEVICE), 3 (DMA_NONE) * @request_buffer: The request buffer address * @req_bufflen: The request buffer length @@ -142,3 +142,4 @@ function get_devstate_from_req:long(var:long) sdev = @cast(var, "request_queue", "kernel:scsi_mod")->queuedata return @cast(sdev, "scsi_device", "kernel:scsi_mod")->sdev_state } +g \ No newline at end of file -- cgit From dcb8ea7a7d1461bef3ea56ebf65d07e8ff998a00 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 17 Mar 2009 12:50:43 +0100 Subject: Remove trailing 'g' from scsi.stp file. * tapset/scsi.stp: Remove 'g' at end of file. --- tapset/scsi.stp | 1 - 1 file changed, 1 deletion(-) (limited to 'tapset/scsi.stp') diff --git a/tapset/scsi.stp b/tapset/scsi.stp index f8859be2..e1457739 100644 --- a/tapset/scsi.stp +++ b/tapset/scsi.stp @@ -142,4 +142,3 @@ function get_devstate_from_req:long(var:long) sdev = @cast(var, "request_queue", "kernel:scsi_mod")->queuedata return @cast(sdev, "scsi_device", "kernel:scsi_mod")->sdev_state } -g \ No newline at end of file -- cgit