Re: [PATCH] samples: Use KSYM_NAME_LEN for fprobe and kprobes

From: Tiezhu Yang
Date: Tue Jun 07 2022 - 22:47:40 EST




On 06/08/2022 12:17 AM, Masami Hiramatsu (Google) wrote:
On Tue, 7 Jun 2022 17:35:36 +0800
Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:

It is better and enough to use KSYM_NAME_LEN for fprobe and kprobes
in samples, no need to define and use the other values.


This is good for kprobe and kretprobe examples because it will get
a single symbol name, but not good for the fprobe. It can take
several comma separated symbols.

-----
static int __init fprobe_init(void)
{
...
/* Comma separated symbols */
symbuf = kstrdup(symbol, GFP_KERNEL);
if (!symbuf)
return -ENOMEM;
p = symbuf;
count = 1;
while ((p = strchr(++p, ',')) != NULL)
count++;

pr_info("%d symbols found\n", count);
-----

Can you drop the fprobe_example.c part?


OK, I will send v2 later, thank you.

Thanks,
Tiezhu