From: Jens Axboe <axboe@kernel.dk>
To: Castor Fu <castor@egocast.org>
Cc: fio@vger.kernel.org
Subject: Re: numerical option parsing broken in engine options
Date: Tue, 25 Feb 2014 09:07:47 -0800 [thread overview]
Message-ID: <530CCDE3.80109@kernel.dk> (raw)
In-Reply-To: <CALKLVuJOou3sLCgnKyfpUaB52M_4L+Xq6_U7ft1YFss_B-+xoQ@mail.gmail.com>
On 2014-02-24 17:51, Castor Fu wrote:
> I was debugging some problems with parsing fio jobs, and found
> options.c:fio_get_kb_base is broken for external engines... The
> parameter
> 'data' is either 0, td, or td->eo. If it's td->eo it's not really
> going to work.
>
> The cleaner fix is probably to unwind passing 'data' so far down the
> stack, but it
> touches a lot of functions, so I thought I'd send this out now.
>
> unsigned int fio_get_kb_base(void *data)
> {
> struct thread_options *o = data;
> unsigned int kb_base = 0;
>
> if (o)
> kb_base = o->kb_base;
> if (!kb_base)
> kb_base = 1024;
>
> return kb_base;
> }
>
>
> If I replace
> if(o)
> by
> if (o && (data - (void *) threads) % sizeof(threads[0]) == 0)
>
> then it behaves as I expect when engine options use the 'k', etc.
Not sure I follow... Are you calling fio_get_kb_base() from the external
engine?
--
Jens Axboe
next prev parent reply other threads:[~2014-02-25 17:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 1:51 numerical option parsing broken in engine options Castor Fu
2014-02-25 17:07 ` Jens Axboe [this message]
2014-02-25 17:34 ` Castor Fu
2014-02-25 18:52 ` Jens Axboe
2014-02-25 19:18 ` Jens Axboe
2014-02-25 19:37 ` Jens Axboe
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=530CCDE3.80109@kernel.dk \
--to=axboe@kernel.dk \
--cc=castor@egocast.org \
--cc=fio@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.