From: Cyril H. <su...@li...> - 2013-10-21 07:51:09
|
The branch, master, has been updated via ba7e78a20a5eb6ab2887c6297d69611bd12c8be2 (commit) from c793aee5f06b46bdc8171814df71df3c90d47c7d (commit) - Log ----------------------------------------------------------------- commit ba7e78a20a5eb6ab2887c6297d69611bd12c8be2 Author: Maxim Uvarov <max...@li...> Date: Fri Oct 4 14:17:11 2013 +0400 max_map_count: filter out not accounted vector stub for arm Arm has following vector stub: ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors] which is not accounted in map_count. There are 8 vector regions on arm, only this one is not accounted. Signed-off-by: Maxim Uvarov <max...@li...> Signed-off-by: Jan Stancek <jst...@re...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/mem/tunable/max_map_count.c | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/testcases/kernel/mem/tunable/max_map_count.c b/testcases/kernel/mem/tunable/max_map_count.c index 01fbe5e..ca28fba 100644 --- a/testcases/kernel/mem/tunable/max_map_count.c +++ b/testcases/kernel/mem/tunable/max_map_count.c @@ -121,12 +121,24 @@ void cleanup(void) * for in the vm_area_struct's map_count. */ #if defined(__x86_64__) || defined(__x86__) -static int filter_map(char *buf) +static int filter_map(char *line) { + char buf[BUFSIZ]; + int ret; + + ret = sscanf(line, "%*p-%*p %*4s %*p %*2d:%*2d %*d %s", buf); + if (ret != 1) + return 0; + return strcmp(buf, "[vsyscall]") == 0; } +#elif defined(__arm__) +static int filter_map(char *line) +{ + return strncmp(line, "ffff0000-ffff1000", 17) == 0; +} #else -static int filter_map(char *buf) +static int filter_map(char *line) { return 0; } @@ -146,8 +158,7 @@ static long count_maps(pid_t pid) tst_brkm(TBROK | TERRNO, cleanup, "fopen %s", buf); while (getline(&line, &len, fp) != -1) { /* exclude vdso and vsyscall */ - if (sscanf(line, "%*p-%*p %*4s %*p %*2d:%*2d %*d %s", buf) == - 1 && filter_map(buf)) + if (filter_map(line)) continue; map_count++; } hooks/post-receive -- ltp |