lkml.org 
[lkml]   [2022]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] samples: Use KSYM_NAME_LEN for fprobe and kprobes
From
Date


On 06/08/2022 12:17 AM, Masami Hiramatsu (Google) wrote:
> On Tue, 7 Jun 2022 17:35:36 +0800
> Tiezhu Yang <yangtiezhu@loongson.cn> 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

\
 
 \ /
  Last update: 2022-06-08 04:50    [W:0.036 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site