From: Jens Axboe <axboe@kernel.dk>
To: Roman Peniaev <r.peniaev@gmail.com>
Cc: fio@vger.kernel.org
Subject: Re: [RFC 0/6] Add support of formats for the pattern input
Date: Sat, 5 Sep 2015 11:01:12 -0600 [thread overview]
Message-ID: <55EB1FD8.3000507@kernel.dk> (raw)
In-Reply-To: <CACZ9PQU0FenB7sOfFyGns1EfkW9DJmimxxYsy4w+8nVgt2wUog@mail.gmail.com>
On 09/05/2015 10:57 AM, Roman Peniaev wrote:
> On Fri, Sep 4, 2015 at 9:34 PM, Jens Axboe <axboe@kernel.dk> wrote:
>> On 08/19/2015 04:33 AM, Roman Pen wrote:
>>>
>>> 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).
>>
>>
>> Sorry for the late response. This looks good, I have applied it. Care to
>> send updates for the HOWTO/man page as well?
>
> For sure. Frankly, I missed the man, I did update only HOWTO.
Ah you did, I missed the HOWTO update. If you could do the man page as
well, I'd appreciate it.
> Jens, did you forget to review my patch related to moving meta header
> to generic verify_header? I also will resend it with man updates and rebased
> on latest changes.
I did, I've fallen a bit behind on review of fio patches. If you resend
on the new base, I'll take a look at it. Thanks!
--
Jens Axboe
next prev parent reply other threads:[~2015-09-05 17:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-08-19 10:15 Roman Pen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55EB1FD8.3000507@kernel.dk \
--to=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=r.peniaev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox