nvme: add nvme opcodes, structures and helper functions
[fio.git] / tools / genfio
index 11cf9a4af97f3bbb5e86d38bf8aa5ef66b9dbf8b..c9bc2f764d68dd9f412c712b0a1dba5d0416a90e 100755 (executable)
 #
 #  You should have received a copy of the GNU General Public License
 #  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 BLK_SIZE=
 BLOCK_SIZE=4k
 SEQ=-1
-TEMPLATE=/tmp/template.fio
+TEMPLATE=$(mktemp "${TMPDIR:-${TEMP:-/tmp}}/template.fio.XXXXXX") || exit $?
+trap 'rm -f "$TEMPLATE"' EXIT
 OUTFILE=
 DISKS=
 PRINTABLE_DISKS=
@@ -48,12 +49,14 @@ show_help() {
                                        one test after another then one disk after another
                                        Disabled by default
 -p                             : Run parallel test
-                                       one test after anoter but all disks at the same time
+                                       one test after another but all disks at the same time
                                        Enabled by default
 -D iodepth                     : Run with the specified iodepth
                                        Default is $IODEPTH
 -d disk1[,disk2,disk3,..]      : Run the tests on the selected disks
                                        Separated each disk with a comma
+-z filesize                     : Specify the working file size, if you are passing filepaths to -d
+                                        Disabled by default
 -r seconds                     : Time in seconds per benchmark
                                        0 means till the end of the device
                                        Default is $RUNTIME seconds
@@ -203,7 +206,7 @@ esac
 }
 
 parse_cmdline() {
-while getopts "hacpsd:b:r:m:x:D:A:B:" opt; do
+while getopts "hacpsd:b:r:m:x:z:D:A:B:" opt; do
   case $opt in
     h)
        show_help
@@ -260,6 +263,10 @@ while getopts "hacpsd:b:r:m:x:D:A:B:" opt; do
     A)
        echo "exec_postrun=$OPTARG" >> $TEMPLATE
       ;;
+    z)
+       FSIZE=$OPTARG
+       echo "size=$FSIZE" >> $TEMPLATE
+      ;;
     \?)
       echo "Invalid option: -$OPTARG" >&2
       ;;