All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC] [PATCH] syscalls: Add timer measurement library
Date: Wed, 31 May 2017 10:42:45 +0200	[thread overview]
Message-ID: <20170531084245.GB2276@rei.lan> (raw)
In-Reply-To: <20170531083045.GA2276@rei.lan>

Hi!
> > > Hmm, we can also fill in the standard tst_test structure in the test
> > > then "override" some of the fields in the timer test library.
> > > 
> > > I.e. test defines tst_test structure and the sampling function, timer
> > > library main() stores and replaces setup & cleanup, sets the test
> > > function then calls the tst_run_tcases() function. Does that sound
> > > better?
> > 
> > Yes. This would mean we extend tst_test struct and add sampling function.
> > As long as rest of fields continue to work (with some exceptions [1]),
> > it sounds good.
> 
> We can setup the test/sample functions as an union. As we can then
> distinguish between them based on .tcnt being non-zero in a case of
> standard test and expect sampling function to be set in a case of the
> timer test. However this makes the whole interface less type safe and
> also much harder to extend. I was thinking of adding support for NULL
> terminated array of test funcitons as well since we have some testcases
> that use the test() function as dispatcher with a long switch()
> statement...
> 
> So maybe we should just add a few more function pointers there.

Or we may as well avoid adding sampling function to the test structure
and pass it explicitly in the timer library main().

int main(int argc, char *argv[])
{
	tst_run_timer_testcases(argc, argv, test, sample_fn, scall);
}

We do that with the test structure anyway so this would be a small
logical extension. And we may as well pass the syscall name in tid field
of the test stucture...

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2017-05-31  8:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 12:33 [LTP] [RFC] [PATCH] syscalls: Add timer measurement library Cyril Hrubis
2017-05-29 15:53 ` Jan Stancek
2017-05-30 12:15   ` Cyril Hrubis
2017-05-30 13:17     ` Jan Stancek
2017-05-31  8:30       ` Cyril Hrubis
2017-05-31  8:42         ` Cyril Hrubis [this message]
2017-05-31 10:51         ` Jan Stancek
2017-06-01  8:01           ` Cyril Hrubis

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=20170531084245.GB2276@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.