summaryrefslogtreecommitdiffstats
path: root/tapset/ioblock.stp
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2010-04-07 16:12:10 -0500
committerDavid Smith <dsmith@redhat.com>2010-04-07 16:12:10 -0500
commit354c797ef6684dc64be916678efa85619571fdbb (patch)
treeb7e552bb937d2ef503378037157737f295f5a9c4 /tapset/ioblock.stp
parent65dd4b7405baeee812f6d41f0ee74824b601a47a (diff)
downloadsystemtap-steved-354c797ef6684dc64be916678efa85619571fdbb.tar.gz
systemtap-steved-354c797ef6684dc64be916678efa85619571fdbb.tar.xz
systemtap-steved-354c797ef6684dc64be916678efa85619571fdbb.zip
PR 9871 (partial) fix. Removed embedded-C in ioblock.stp and ipmib.stp.
* tapset/ioblock.stp(__bio_start_sect): Converted from embedded-C to script language. * tapset/ipmib.stp: Replaced all _tcphdr_get_dport()/_tcphdr_get_sport() calls with _tcp_skb_dport()/_tcp_skb_sport() calls. Removed embedded-C functions _tcphdr_get_dport()/_tcphdr_get_sport(). (ipmib.OutRequests): Fixed for RHEL4. (_trn_unspec): New function. (_input_route_type): Originally called __input_route_type_old()/__input_route_type_new(), which were embedded-C functions. Now just does everything in script language. (__input_route_type_old): Deleted. (__input_route_type_new): Ditto. (_output_route_type): Originally called __output_route_type_old()/__output_route_type_new(), which were embedded-C functions. Now just does everything in script language. (__output_route_type_old): Deleted. (__output_route_type_new): Ditto.
Diffstat (limited to 'tapset/ioblock.stp')
-rw-r--r--tapset/ioblock.stp19
1 files changed, 6 insertions, 13 deletions
diff --git a/tapset/ioblock.stp b/tapset/ioblock.stp
index 6376ac23..e5ad2c9b 100644
--- a/tapset/ioblock.stp
+++ b/tapset/ioblock.stp
@@ -1,6 +1,7 @@
// Block I/O tapset
// Copyright (C) 2006 Intel Corp.
// Copyright (C) 2006 IBM Corp.
+// Copyright (C) 2010 Red Hat Inc.
//
// This file is part of systemtap, and is free software. You can
// redistribute it and/or modify it under the terms of the GNU General
@@ -46,19 +47,11 @@ function bio_rw_str(rw)
/* returns start sector */
function __bio_start_sect:long(bio:long)
-%{ /* pure */
- struct bio *bio;
- struct block_device *bi_bdev;
- struct hd_struct *bd_part;
- bio = (struct bio *)(long)THIS->bio;
- bi_bdev = bio? kread(&(bio->bi_bdev)) : NULL;
- bd_part = bi_bdev? kread(&(bi_bdev->bd_part)) : NULL;
- if (bd_part == NULL)
- THIS->__retvalue = -1;
- else
- THIS->__retvalue = kread(&(bd_part->start_sect));
- CATCH_DEREF_FAULT();
-%}
+{
+ bi_bdev = bio ? @cast(bio, "bio")->bi_bdev : 0
+ bd_part = bi_bdev ? @cast(bi_bdev, "block_device")->bd_part : 0
+ return bd_part ? @cast(bd_part, "hd_struct")->start_sect : -1
+}
/* returns the block device name */
function __bio_devname:string(bio:long)