Skip to content

Commit

Permalink
options: Add support hex value to ignore_error
Browse files Browse the repository at this point in the history
The 'ignore_error=str' option expects either the name or the numeric
value of the errno in string format.  With recent additions like
io_uring_cmd ioengine, it's been possible to check not only errno values
but also the actual status values provided by the storage device.

Given that most status codes in NVMe specs are represented in
hexadecimal, specifying error values in hexadecimal is also useful to
ignore some errors.

For example, DULBE (Deallocated or Unwritten Logical Block Error) status
code can be ignored:

	ignore_error=0x287

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
  • Loading branch information
minwooim committed May 15, 2024
1 parent 78831c6 commit f26af3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion options.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ static int ignore_error_type(struct thread_data *td, enum error_type_bit etype,
if (fname[0] == 'E') {
error[i] = str2error(fname);
} else {
error[i] = atoi(fname);
int base = 10;
if (!strncmp(fname, "0x", 2) ||
!strncmp(fname, "0X", 2))
base = 16;
error[i] = strtol(fname, NULL, base);
if (error[i] < 0)
error[i] = -error[i];
}
Expand Down

0 comments on commit f26af3d

Please sign in to comment.