[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230816150407.3d5dbc40@gandalf.local.home>
Date: Wed, 16 Aug 2023 15:04:07 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
John Fastabend <john.fastabend@...il.com>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Song Liu <song@...nel.org>,
Yonghong Song <yonghong.song@...ux.dev>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Kees Cook <keescook@...omium.org>,
Petr Mladek <pmladek@...e.com>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
linux-modules@...r.kernel.org
Subject: Re: [PATCH] [v3] kallsyms: rework symbol lookup return codes
On Wed, 26 Jul 2023 16:12:23 +0200
Arnd Bergmann <arnd@...nel.org> wrote:
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 05c0024815bf9..a949f903c9e66 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -6965,7 +6965,7 @@ allocate_ftrace_mod_map(struct module *mod,
> return mod_map;
> }
>
> -static const char *
> +static int
> ftrace_func_address_lookup(struct ftrace_mod_map *mod_map,
> unsigned long addr, unsigned long *size,
> unsigned long *off, char *sym)
> @@ -6986,21 +6986,18 @@ ftrace_func_address_lookup(struct ftrace_mod_map *mod_map,
> *size = found_func->size;
> if (off)
> *off = addr - found_func->ip;
> - if (sym)
> - strscpy(sym, found_func->name, KSYM_NAME_LEN);
> -
> - return found_func->name;
> + return strscpy(sym, found_func->name, KSYM_NAME_LEN);
> }
>
> - return NULL;
> + return 0;
> }
>
> -const char *
> +int
> ftrace_mod_address_lookup(unsigned long addr, unsigned long *size,
> unsigned long *off, char **modname, char *sym)
> {
> struct ftrace_mod_map *mod_map;
> - const char *ret = NULL;
> + int ret;
>
> /* mod_map is freed via call_rcu() */
> preempt_disable();
Acked-by: Steven Rostedt (Google) <rostedt@...dmis.org>
-- Steve
Powered by blists - more mailing lists