From 136fbcb747a1c2e7858f6810cab75cee654a5a9c Mon Sep 17 00:00:00 2001 From: William Cohen Date: Thu, 17 Mar 2022 16:01:36 -0400 Subject: [PATCH] Fix deviceseeks.stp example to explicitly cast queue variable The deviceseeks.stp example was failing to build because several uses of the queue variable were not explicitly casted and result in the following error message: semantic error: autocast variable '' may not be used as a structure: operator '->' at testsuite/systemtap.examples/io/deviceseeks.stp:26:8 source: queue->limits->logical_block_size : ^ Used @q_cast(queue) in place of the plain queue to correctly cast the variable and eliminate the error. --- testsuite/systemtap.examples/io/deviceseeks.stp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/systemtap.examples/io/deviceseeks.stp b/testsuite/systemtap.examples/io/deviceseeks.stp index c68b99518..d644cf222 100755 --- a/testsuite/systemtap.examples/io/deviceseeks.stp +++ b/testsuite/systemtap.examples/io/deviceseeks.stp @@ -23,10 +23,10 @@ probe ioblock_trace.request { queue = @defined ($q) ? $q : @choose_defined($bio->bi_bdev->bd_disk->queue, $bio->bi_disk->queue) sectorsize = (@defined(@q_cast(queue)->limits->logical_block_size) ? - queue->limits->logical_block_size : + @q_cast(queue)->limits->logical_block_size : (@defined(@q_cast(queue)->logical_block_size) ? - queue->logical_block_size : - queue->hardsect_size )) + @q_cast(queue)->logical_block_size : + @q_cast(queue)->hardsect_size )) # printf("%s %s\n", devname, rw ? "w" : "r") sec = sector seeks[devname] <<< sec - oldsec[devname] -- 2.43.5