[LTP] [PATCH] max_map_count: fix error by using runtime check

Cui Bixuan cuibixuan@huawei.com
Tue Apr 5 13:47:18 CEST 2016


On 2016/3/31 20:07, Cyril Hrubis wrote:
> Hi!
>> Can we relax the pass condition to allow map_count to be
>> within some tolerance? Then we wouldn't have to worry so much about
>> all arch specifics.
> 
> Looking at the code we skip exactly one mapping on some architectures.
> So it looks like allowing the number of mappings to be greater by one
> uncoditionally should solve the problem.
> 
> But I'm still undecided if we should go this way as we will weaken the
> test assertion since at the moment we skip exact mappings by their
> label.
I have two ideas:
1. Use strcmp() to replace the strstr() and to check x86_64,x86,ia64,armv7b
and so on.
2. Now we only find the problem in aarch64, we just fix it:

#elif defined(__arm__)
	/* Skip it when run it in aarch64 */
	if(strcmp(un.machine, "aarch64"))
		return false;

	/* Older arm kernels didn't label their vdso maps */
	if (!strncmp(line, "ffff0000-ffff1000", 17))
		return true;

And I think the second is better :-D

Thanks
Cui Bixuan
> 



More information about the ltp mailing list