From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib: add tst_read_meminfo / tst_get_avail_mem
Date: Thu, 14 Jul 2016 16:03:11 +0800 [thread overview]
Message-ID: <20160714080311.GA18082@gmail.com> (raw)
In-Reply-To: <57863E28.7020309@redhat.com>
On Wed, Jul 13, 2016 at 03:12:08PM +0200, Jan Stancek wrote:
>
> Latest idea attached.
>
> It's similar to SAFE_FILE_SCANF, but it scanfs each line and first
> matching all scanf directives wins and terminates search, otherwise
> you get non-zero ret code. For example:
>
> if (SAFE_FILE_LINES_SCANF("/proc/meminfo", "MemFree: %ld", &free))
> tst_brk(TBROK, "Could not parse MemFree");
I like this method! And I tend to think that we probably need achive two
macors for different occasions. In fact as the FILE_SCANF() do that.
FILE_LINES_SCANF() and SAFE_FILE_LINES_SCANF()
Regards,
Li Wang
prev parent reply other threads:[~2016-07-14 8:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 11:27 [LTP] [PATCH] lib: add tst_read_meminfo / tst_get_avail_mem Jan Stancek
2016-06-14 14:37 ` Li Wang
2016-06-15 7:34 ` Jan Stancek
2016-06-15 12:51 ` Jan Stancek
2016-06-16 5:25 ` Li Wang
2016-06-16 7:08 ` Jan Stancek
2016-06-16 7:32 ` Li Wang
2016-07-13 9:35 ` Li Wang
2016-07-13 13:12 ` Jan Stancek
2016-07-13 13:54 ` Cyril Hrubis
2016-07-13 14:13 ` Jan Stancek
2016-07-13 14:23 ` Cyril Hrubis
2016-07-14 8:03 ` Li Wang [this message]
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=20160714080311.GA18082@gmail.com \
--to=liwang@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox