Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1486184rdb; Wed, 16 Aug 2023 12:55:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYVoNyNravSwyMcrU9OfWxJYc/SEuycRdljM47GegEhbQdsBeEu+0lwFYWZ7LWcppte8Dg X-Received: by 2002:a17:903:2341:b0:1bc:8fca:9d59 with SMTP id c1-20020a170903234100b001bc8fca9d59mr3354533plh.29.1692215709664; Wed, 16 Aug 2023 12:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692215709; cv=none; d=google.com; s=arc-20160816; b=KtO0ymgS6rwObH8zm46EHs0mV+bQE8Htz/GIgMMf9dMkLVIfkkLD9QvUGD0fUpmvMz IBxmwuBoLMdL802TJLkMrnPzDJ2mOx3GCGF+dlciQYfQFrxUH2xTqsLpZzeyyLGyGOTK 8fRCJ6GnkYkzzHZHnNARGJPHvfTfm9c0Kf29kYRU8aWPI5kqe1nAK8jsz8urpbgX20dF AP63Nz6pS9Vw5GLbYOKQtq3TJOOqZYI85FdpL9FQENwLMicOpuubvLaXDFsC2hze1TDB AhNbvzxJYHfe6EC5KQSOIW4HTo4+STEROVo4wuMPkDiieZ5sUyCHxBVZKBUxptJE1NC0 osrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=tK3DsK1UKrgIhIVoIsLLaG5oteQgkHId1CdfLRvV1WI=; fh=bHUU3yaK5sXMpUyUxG0Fr7uQcTOE1WirKENpowBk3+c=; b=F4c5JRzcvZijoTWcNGkXBunGs/hUQKRG6hgEDtBnNcOTfpeIJS7cUO3mQF+OUEb4WY SqkV8MGQ91nyheIde4ERrNl3l97BEB+cgwc4i4J1KHxsbY2252VQSIjU/j933tB0pEEm VpWngyUV1N/iSSpNArwG91/kXXH5HvfuNJ4VHwAovNUuVqljVQCkzffzLIeKNw1XBoH6 TJvFljsV7GBOCbDuGXLkZN+1CaJf3AZcZkNHOz3J5VZV7VW4cem+TfCGPySE4EnDDgti e61B7vmvLOUwDEv0Yc65kRlpdLeEP/wexI/e7405eVisa5hMgCRu+BNd/ysVyqB46BK9 eeMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a170902c70c00b001bbb8a65e87si294155plp.59.2023.08.16.12.54.56; Wed, 16 Aug 2023 12:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345671AbjHPTEU (ORCPT + 99 others); Wed, 16 Aug 2023 15:04:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345720AbjHPTEK (ORCPT ); Wed, 16 Aug 2023 15:04:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D282270A; Wed, 16 Aug 2023 12:04:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A269E6246F; Wed, 16 Aug 2023 19:04:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0F9BC433C7; Wed, 16 Aug 2023 19:04:03 +0000 (UTC) Date: Wed, 16 Aug 2023 15:04:07 -0400 From: Steven Rostedt To: Arnd Bergmann Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , Luis Chamberlain , Arnd Bergmann , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mark Rutland , Kees Cook , Petr Mladek , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-modules@vger.kernel.org Subject: Re: [PATCH] [v3] kallsyms: rework symbol lookup return codes Message-ID: <20230816150407.3d5dbc40@gandalf.local.home> In-Reply-To: <20230726141333.3992790-1-arnd@kernel.org> References: <20230726141333.3992790-1-arnd@kernel.org> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Jul 2023 16:12:23 +0200 Arnd Bergmann 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) -- Steve