From: Jens Axboe <axboe@kernel.dk>
To: Roman Pen <r.peniaev@gmail.com>
Cc: fio@vger.kernel.org
Subject: Re: [RFC 0/6] Add support of formats for the pattern input
Date: Fri, 4 Sep 2015 13:34:02 -0600 [thread overview]
Message-ID: <55E9F22A.6050008@kernel.dk> (raw)
In-Reply-To: <1439980391-2311-1-git-send-email-r.peniaev@gmail.com>
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?
--
Jens Axboe
next prev parent reply other threads:[~2015-09-04 19:34 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 ` Jens Axboe [this message]
2015-09-05 16:57 ` [RFC 0/6] Add support of formats for the pattern input 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
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=55E9F22A.6050008@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