Re: [PATCH 04/16] bpf tools: Collect map definition in bpf_object

2015-11-26 Thread Wangnan (F)
On 2015/11/27 14:16, Wangnan (F) wrote: On 2015/11/27 4:56, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 24, 2015 at 01:36:09PM +, Wang Nan escreveu: [SNIP] [SNIP] + +if ((prev < s) || (prev >= e)) { +pr_warning("error: map handler doesn't belong to object\n"); I wonder

Re: [PATCH 04/16] bpf tools: Collect map definition in bpf_object

2015-11-26 Thread Wangnan (F)
On 2015/11/27 4:56, Arnaldo Carvalho de Melo wrote: Em Tue, Nov 24, 2015 at 01:36:09PM +, Wang Nan escreveu: [SNIP] + } return 0; } @@ -688,37 +707,15 @@ static int bpf_object__create_maps(struct bpf_object *obj) { unsigned int i; - size_t nr_maps;

Re: [PATCH 04/16] bpf tools: Collect map definition in bpf_object

2015-11-26 Thread Arnaldo Carvalho de Melo
Em Tue, Nov 24, 2015 at 01:36:09PM +, Wang Nan escreveu: > bpf_object__init_maps(struct bpf_object *obj, void *data, > size_t size) > { > - if (size == 0) { > + size_t nr_maps; > + int i; > + > + nr_maps = size / sizeof(struct bpf_map_def); > + if (!dat