[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_9E8059C821CBE9125DC5F57561341511CA05@qq.com>
Date: Sat, 26 Aug 2023 22:52:00 +0800
From: Rong Tao <rtoax@...mail.com>
To: olsajiri@...il.com
Cc: andrii@...nel.org, ast@...nel.org, bpf@...r.kernel.org,
daniel@...earbox.net, haoluo@...gle.com, john.fastabend@...il.com,
kpsingh@...nel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, martin.lau@...ux.dev,
mykolal@...com, rongtao@...tc.cn, rtoax@...mail.com,
sdf@...gle.com, shuah@...nel.org, song@...nel.org,
yonghong.song@...ux.dev
Subject: Re: [PATCH bpf-next v7] selftests/bpf: trace_helpers.c: optimize kallsyms cache
> 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@qq.com/
Powered by blists - more mailing lists