From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 03/13] lib: Add tst_mapping_in_range()
Date: Fri, 27 Dec 2024 11:25:40 +0100 [thread overview]
Message-ID: <20241227102540.GA317565@pevik> (raw)
In-Reply-To: <20241218184518.16190-4-chrubis@suse.cz>
> This moves the range_is_mapped() function from
> testcases/kernel/mem/lib/mem.c to a top level library and renames the
> function to a better fitting name.
+1
> +/**
> + * tst_mapping_in_range()
> + *
> + * @low A lower address inside of the processe address space.
> + * @high A higher address inside of the processe address space.
nit: missing ':' causes "undefined" instead of the documentation.
Please fix that before merge.
> + *
> + * @return Returns true if there is a mapping between low and high addresses in
> + * the process address space.
> + */
> +int tst_mapping_in_range(unsigned long low, unsigned long high);
> +
> #endif /* TST_MEMUTILS_H__ */
> diff --git a/lib/tst_memutils.c b/lib/tst_memutils.c
> index e33f19d29..e49684ba1 100644
> --- a/lib/tst_memutils.c
> +++ b/lib/tst_memutils.c
> @@ -14,6 +14,7 @@
> #include "tst_test.h"
> #include "tst_memutils.h"
> #include "tst_capability.h"
> +#include "tst_safe_stdio.h"
> #include "lapi/syscalls.h"
> #define BLOCKSIZE (16 * 1024 * 1024)
> @@ -184,3 +185,33 @@ void tst_disable_oom_protection(pid_t pid)
> {
> set_oom_score_adj(pid, 0);
> }
> +
> +int tst_mapping_in_range(unsigned long low, unsigned long high)
> +{
> + FILE *fp;
> +
> + fp = SAFE_FOPEN("/proc/self/maps", "r");
nit: it might be better to have const char *file, const int lineno params
and have TST_MAPPING_IN_RANGE(). But I'm OK to keep it this way.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-12-27 10:26 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 18:45 [LTP] [PATCH 00/13] Get rid of testcases/kernel/mem/lib library Cyril Hrubis
2024-12-18 18:45 ` [LTP] [PATCH 01/13] lib: tst_sys_conf: Add two functions Cyril Hrubis
2024-12-19 3:10 ` Li Wang
2024-12-27 9:04 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 02/13] lib: Replace path_exist() with tst_path_exists() Cyril Hrubis
2024-12-19 14:31 ` Petr Vorel
2024-12-19 15:04 ` Cyril Hrubis
2024-12-20 8:02 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 03/13] lib: Add tst_mapping_in_range() Cyril Hrubis
2024-12-27 10:25 ` Petr Vorel [this message]
2024-12-18 18:45 ` [LTP] [PATCH 04/13] testcases/kernel/mem: Move get_a_numa_node() Cyril Hrubis
2024-12-27 10:27 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 05/13] testcases/kernel/mem: Move update_shm_size() Cyril Hrubis
2024-12-27 10:34 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 06/13] testcases/kernel/mem: Move check_hugepage() + PATH_THP Cyril Hrubis
2024-12-27 10:48 ` Petr Vorel
2025-02-07 17:00 ` Cyril Hrubis
2025-02-10 9:16 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 07/13] testcases/kernel/mem: Move NUMA bits to numa_helper.h Cyril Hrubis
2024-12-27 11:01 ` Petr Vorel
2024-12-27 11:09 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 08/13] testcases/kernel/mem: Move oom() fucntions to oom tests Cyril Hrubis
2024-12-27 11:06 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 09/13] testcases/kernel/mem: Move KSM bits to ksm tests Cyril Hrubis
2024-12-19 2:52 ` Li Wang
2024-12-19 2:55 ` Li Wang
2024-12-19 9:08 ` Cyril Hrubis
2024-12-19 9:11 ` Li Wang
2024-12-27 11:15 ` Petr Vorel
2024-12-27 11:36 ` Petr Vorel
2025-02-10 11:17 ` Cyril Hrubis
2024-12-27 11:37 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 10/13] mem/swapping: Remove mem/lib refrence Cyril Hrubis
2024-12-27 11:42 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 11/13] mem/vma: Remove mem/lib dependency Cyril Hrubis
2024-12-27 11:44 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 12/13] mem/hugetlb: Remove mem/lib depenency Cyril Hrubis
2024-12-27 11:47 ` Petr Vorel
2024-12-18 18:45 ` [LTP] [PATCH 13/13] testcases/kernel/mem: Remove library Cyril Hrubis
2024-12-27 11:48 ` Petr Vorel
2024-12-18 18:58 ` [LTP] [PATCH 00/13] Get rid of testcases/kernel/mem/lib library Petr Vorel
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=20241227102540.GA317565@pevik \
--to=pvorel@suse.cz \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox