]> sourceware.org Git - systemtap.git/commitdiff
tapset: remove result caching from __find_bdevname
authorFrank Ch. Eigler <fche@redhat.com>
Thu, 29 Sep 2011 21:33:48 +0000 (17:33 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Thu, 29 Sep 2011 21:33:48 +0000 (17:33 -0400)
This function is indirectly used from many vfs tapset probe points.
Since it sets/gets an internal script global variable, the current
optimizer does not elide this function, thus wasting time, space, and
risks @cast/kread runtime errors.  Let's get rid of the cache, until
the optimizer can do this automagically.

* tapset/vfs.ftp (__find_bdevname): Simplify.

tapset/vfs.stp

index 9828bd240dc8f161cb29ac64557662a4f1298b4b..6ca330190693eee8e267ee3dfae2a54fe70ea89f 100644 (file)
@@ -15,9 +15,6 @@
   We don't want to have to do a bdevname() call every time
   we want a devname, so we'll hash them here.
 */
-/* XXX: Is this hashing really that helpful?  The call to bdevname()
- * isn't very involved... */
-global __devnames
 function __find_bdevname:string(dev:long, bdev:long)
 {
        /* bdevname() can't do anything without an actual bdev, so let's just
@@ -25,10 +22,7 @@ function __find_bdevname:string(dev:long, bdev:long)
        if (bdev == 0)
                return "N/A"
 
-       if (dev in __devnames)
-               return __devnames[dev]
-
-       return __devnames[dev] = bdevname(bdev)
+       return bdevname(bdev)
 }
 
 /* deprecated */
This page took 0.0311 seconds and 5 git commands to generate.