Re: [PATCH blktests] nvme/053: provide time extension alternative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 18, 2024 / 03:13, Luis Chamberlain wrote:
> I get this failure when I run this test:
> 
> awk: ...rescan.awk:2: warning: The time extension is obsolete.
> Use the timex extension from gawkextlib

Hi Luis, thank you for catching this.

> I can't find this extension either, so just use systime() and
> use system(sleep) for the sleep command.

FYI, here I share the link to the past discussion that resulted in the awk
script in nvme/053 [1]. In that discussion, Martin noted that

   'But the fork-and-exec to "awk" is slow.'

So I wonder if this system(sleep) in the awk while loop could be slow also.

Assuming this system(sleep) approach is slow and not preferred, I suggest to go
back to the approach that the Martin's v1 patch took [2]. The while loop is
implemented with bash. The awk script was introduced for the float calculation
to get the random float number from 0.1 to 5.0. However, I think such
calculation can be done with bash as follows:

get_sleep_time() {
        local duration=$((RANDOM % 50 + 1))

	echo "$((duration / 10))"."$((duration % 10))"
}

With this, we should be able to drop the awk script form the test case.

Martin, what do you think?

[1] https://lore.kernel.org/linux-nvme/2cb6f86256803af00557f07e9573331c51111953.camel@xxxxxxxx/
[2] https://lore.kernel.org/linux-nvme/20240822193814.106111-3-mwilck@xxxxxxxx/





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux