Re: [PATCH bpf-next v7] selftests/bpf: trace_helpers.c: optimize kallsyms cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> perhaps we could fix that with 2 sets of functions:
> 
>   - load_kallsyms
>     ksym_search
>     ksym_get_addr
> 
>     that work like now on global syms pointer, perhaps we should
>     initialize it before we run tests or use mutex for init
> 
>   - struct ksym *load_kallsyms_local()
>     ksym_search_local(struct ksym *syms, ...)
>     ksym_get_addr_local(struct ksym *syms, ...)
> 
>     that work on local ksyms cache and the test frees it at the end,
>     it would be used in all tests that need updated kallsyms data and
>     use load_kallsyms_refresh for that

Hi, jirka

How about keeping only one type of interface to avoid confusion about use
and mutex locks. Like:

	struct ksyms *load_kallsyms(void);
	struct ksyms *load_kallsyms_refresh(struct ksyms *ksyms);
	void free_kallsyms(struct ksyms *ksyms);

	struct ksym *ksym_search(struct ksyms *ksyms, long key);
	long ksym_get_addr(struct ksyms *ksyms, const char *name);

I just submit v8 [0], please review.

[0] https://lore.kernel.org/lkml/tencent_6D23FE187408D965E95DFAA858BC7E8C760A@xxxxxx/




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux