From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib: add tst_read_meminfo / tst_get_avail_mem
Date: Wed, 13 Jul 2016 15:12:08 +0200 [thread overview]
Message-ID: <57863E28.7020309@redhat.com> (raw)
In-Reply-To: <20160713093505.GA6033@gmail.com>
On 07/13/2016 11:35 AM, Li Wang wrote:
> Jan,
>
> On Thu, Jun 16, 2016 at 03:08:18AM -0400, Jan Stancek wrote:
>>
>> I'm now considering exposing just a parse function, I'd like to
>> avoid having separate function for each proc file. And possibly
>> more than one since those 2 proc files you mentioned don't have
>> uniform format for all content.
>
> How is the parse function going?
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");
Regards,
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-add-SAFE_FILE_LINES_SCANF.patch
Type: text/x-patch
Size: 5623 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160713/54918c2b/attachment.bin>
next prev parent reply other threads:[~2016-07-13 13:12 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 [this message]
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
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=57863E28.7020309@redhat.com \
--to=jstancek@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