Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: ublk: correct last_rw map type in seq_io.bt

The last_rw map is initialized with a value of 0 but later assigned the
value args.sector + args.nr_sector, which has type sector_t = u64.
bpftrace complains about the type mismatch between int64 and uint64:
trace/seq_io.bt:18:3-59: ERROR: Type mismatch for @last_rw: trying to assign value of type 'uint64' when map already contains a value of type 'int64'
@last_rw[$dev, str($2)] = (args.sector + args.nr_sector);

Cast the initial value to uint64 so bpftrace will load the program.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
1fd4b8d7 9637fc3b

+1 -1
+1 -1
tools/testing/selftests/ublk/trace/seq_io.bt
··· 4 4 $3: strlen($2) 5 5 */ 6 6 BEGIN { 7 - @last_rw[$1, str($2)] = 0; 7 + @last_rw[$1, str($2)] = (uint64)0; 8 8 } 9 9 tracepoint:block:block_rq_complete 10 10 {