Flexible I/O Tester development
 help / color / mirror / Atom feed
* [RFC 0/6] Add support of formats for the pattern input
@ 2015-08-19 10:33 Roman Pen
  2015-08-19 10:33 ` [RFC 1/6] lib/strntol: add 'strntol' function Roman Pen
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Roman Pen @ 2015-08-19 10:33 UTC (permalink / raw)
  Cc: Roman Pen, fio

Hello, all.

The intention of this patchset is to support dynamic formats for pattern
input which is used for writing and verifying data, e.g. in the latest patch
I added '%o' format, which means that current block offset will be written to
the buffer and then verified back, i.e. this option can be used as the
following:

 verify_pattern=%o

and the hexdump of generated file in my case is (few last lines):

  ...
  000f5c00  00 5c 0f 00 00 00 00 00  00 5c 0f 00 00 00 00 00  |.\.......\......|
  *
  000fdc00  00 dc 0f 00 00 00 00 00  00 dc 0f 00 00 00 00 00  |................|
  *
  000ffc00  00 fc 0f 00 00 00 00 00  00 fc 0f 00 00 00 00 00  |................|
  *
  00100000

So, each block is filled in with block offset in little endian order and 8 bytes
long.

Unfortunately, 'buffer_pattern' option does not support formats, because it
turned out to be a lot of changes which should be made to pass correct
io_u->offset through the whole stack of calls. I left this task for future.

Additionally, I moved all 'pattern' parsing/substituting logic to separate
library file 'lib/pattern.[ch]'. Also, now 'verify_pattern' and 'buffer_pattern'
support combined input which can consist of strings, numbers and formats
(as was said formats are supported only by 'verify_pattern' option), e.g. let's
consider the following example, where 'in' is a 'verify_pattern' or
'buffer_pattern' and 'out' is an output buffer filled in with bytes regarding
specified pattern:

  #1                 #2                 #3        #4
    in="abcd"          in=-1024           in=66     in=0xFF0X1
   out=61 62 63 64    out=00 fc ff ff    out=42    out=ff 01

  #5                               #6
    in=%o                            in="123"0xFFeeCC
   out=00 00 00 00 00 00 00 00      out=31 32 33 ff ec cc

  #7
    in=-100xab"1"%o"2"
    out=f6 ff ff ff ab 31 00 00 00 00 00 00 00 00 32

  #8
    in=%o0xdeadbeef%o
   out=00 00 00 00 00 00 00 00 de ad be ef 00 00 00 00 00 00 00 00

  #9
     in=0xfefefefefefefefefefefefefefefefefefefefefe
    out=fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe

For %o format 8 bytes reserved in pattern, and when buffer is ready
substitution occurs.

The old behaviour is preserved: strings are in quotes, decimals are in the
range [INT_MIN, INT_MAX], hexidecimals start from 0[Xx] and can be of any
size (the limit is the maximum size of the pattern, which is 512).

New behaviour: now you can combine everything together and additionally
use formats (now %o is supported).

 --
 Roman

Roman Pen (6):
  lib/strntol: add 'strntol' function
  lib/pattern: add set of functions to parse combined pattern input
  replace 'fill_pattern' with 'cpy_pattern' from 'lib/pattern.c'
  verify: use 'cmp_pattern' from 'lib/pattern.c' to compare pattern and
    buffer
  add FIELD_SIZE macro to calculate the size of the specified field
  use 'lib/pattern' to parse patterns and paste formats into buffers

 HOWTO            |  20 ++-
 Makefile         |   9 +-
 fio.h            |   3 +-
 lib/pattern.c    | 464 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/pattern.h    |  47 ++++++
 lib/rand.c       |  31 +---
 lib/rand.h       |   1 -
 lib/strntol.c    |  31 ++++
 lib/strntol.h    |   6 +
 options.c        | 166 ++++----------------
 thread_options.h |   3 +
 verify.c         |  62 +++++---
 verify.h         |   5 +
 13 files changed, 656 insertions(+), 192 deletions(-)
 create mode 100644 lib/pattern.c
 create mode 100644 lib/pattern.h
 create mode 100644 lib/strntol.c
 create mode 100644 lib/strntol.h

-- 
2.4.4


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [RFC 0/6] Add support of formats for the pattern input
@ 2015-08-19 10:15 Roman Pen
  0 siblings, 0 replies; 11+ messages in thread
From: Roman Pen @ 2015-08-19 10:15 UTC (permalink / raw)
  Cc: Roman Pen, fio

Hello, all.

The intention of this patchset is to support dynamic formats for pattern
input which is used for writing and verifying data, e.g. in the latest patch
I added '%o' format, which means that current block offset will be written to
the buffer and then verified back, i.e. this option can be used as the
following:

 verify_pattern=%o

and the hexdump of generated file in my case is (few last lines):

  ...
  000f5c00  00 5c 0f 00 00 00 00 00  00 5c 0f 00 00 00 00 00  |.\.......\......|
  *
  000fdc00  00 dc 0f 00 00 00 00 00  00 dc 0f 00 00 00 00 00  |................|
  *
  000ffc00  00 fc 0f 00 00 00 00 00  00 fc 0f 00 00 00 00 00  |................|
  *
  00100000

So, each block is filled in with block offset in little endian order and 8 bytes
long.

Unfortunately, 'buffer_pattern' option does not support formats, because it
turned out to be a lot of changes which should be made to pass correct
io_u->offset through the whole stack of calls. I left this task for future.

Additionally, I moved all 'pattern' parsing/substituting logic to separate
library file 'lib/pattern.[ch]'. Also, now 'verify_pattern' and 'buffer_pattern'
support combined input which can consist of strings, numbers and formats
(as was said formats are supported only by 'verify_pattern' option), e.g. let's
consider the following example, where 'in' is a 'verify_pattern' or
'buffer_pattern' and 'out' is an output buffer filled in with bytes regarding
specified pattern:

  #1                 #2                 #3        #4
    in="abcd"          in=-1024           in=66     in=0xFF0X1
   out=61 62 63 64    out=00 fc ff ff    out=42    out=ff 01

  #5                               #6
    in=%o                            in="123"0xFFeeCC
   out=00 00 00 00 00 00 00 00      out=31 32 33 ff ec cc

  #7
    in=-100xab"1"%o"2"
    out=f6 ff ff ff ab 31 00 00 00 00 00 00 00 00 32

  #8
    in=%o0xdeadbeef%o
   out=00 00 00 00 00 00 00 00 de ad be ef 00 00 00 00 00 00 00 00

  #9
     in=0xfefefefefefefefefefefefefefefefefefefefefe
    out=fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe

For %o format 8 bytes reserved in pattern, and when buffer is ready
substitution occurs.

The old behaviour is preserved: strings are in quotes, decimals are in the
range [INT_MIN, INT_MAX], hexidecimals start from 0[Xx] and can be of any
size (the limit is the maximum size of the pattern, which is 512).

New behaviour: now you can combine everything together and additionally
use formats (now %o is supported).

 --
 Roman

Roman Pen (6):
  lib/strntol: add 'strntol' function
  lib/pattern: add set of functions to parse combined pattern input
  replace 'fill_pattern' with 'cpy_pattern' from 'lib/pattern.c'
  verify: use 'cmp_pattern' from 'lib/pattern.c' to compare pattern and
    buffer
  add FIELD_SIZE macro to calculate the size of the specified field
  use 'lib/pattern' to parse patterns and paste formats into buffers

 HOWTO            |  20 ++-
 Makefile         |   9 +-
 fio.h            |   3 +-
 lib/pattern.c    | 464 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/pattern.h    |  47 ++++++
 lib/rand.c       |  31 +---
 lib/rand.h       |   1 -
 lib/strntol.c    |  31 ++++
 lib/strntol.h    |   6 +
 options.c        | 166 ++++----------------
 thread_options.h |   3 +
 verify.c         |  62 +++++---
 verify.h         |   5 +
 13 files changed, 656 insertions(+), 192 deletions(-)
 create mode 100644 lib/pattern.c
 create mode 100644 lib/pattern.h
 create mode 100644 lib/strntol.c
 create mode 100644 lib/strntol.h

-- 
2.4.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-09-05 17:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 10:33 [RFC 0/6] Add support of formats for the pattern input Roman Pen
2015-08-19 10:33 ` [RFC 1/6] lib/strntol: add 'strntol' function Roman Pen
2015-08-19 10:33 ` [RFC 2/6] lib/pattern: add set of functions to parse combined pattern input Roman Pen
2015-08-19 10:33 ` [RFC 3/6] replace 'fill_pattern' with 'cpy_pattern' from 'lib/pattern.c' Roman Pen
2015-08-19 10:33 ` [RFC 4/6] verify: use 'cmp_pattern' from 'lib/pattern.c' to compare pattern and buffer Roman Pen
2015-08-19 10:33 ` [RFC 5/6] add FIELD_SIZE macro to calculate the size of the specified field Roman Pen
2015-08-19 10:33 ` [RFC 6/6] use 'lib/pattern' to parse patterns and paste formats into buffers Roman Pen
2015-09-04 19:34 ` [RFC 0/6] Add support of formats for the pattern input Jens Axboe
2015-09-05 16:57   ` Roman Peniaev
2015-09-05 17:01     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2015-08-19 10:15 Roman Pen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox