Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6197833iob; Tue, 10 May 2022 12:35:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydaw8yDQTft+1hFWN1P65NJD6Ir3Y3svrPca3VjntvfI1CPJiCQ8NDqgbiETsg06foNPVr X-Received: by 2002:a17:90b:4f4e:b0:1dc:cafb:d48e with SMTP id pj14-20020a17090b4f4e00b001dccafbd48emr1429413pjb.202.1652211359179; Tue, 10 May 2022 12:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652211359; cv=none; d=google.com; s=arc-20160816; b=oIzDpkl1GiEJWe7TNPnV38eJmVa0VXgUNB9PkV3GHrBILhckatyqbPdzLb9kZYGbKq BvnoxHEKcy6NWTsuL90CKby5zAIDWIqZZaxpMo2WKAKrMW42AvIkdjFztA+yVe1KvbEe Lazq25j0ht+9IJgFBh7IW1P97lShTxzd/Zcu13+Hhn8RIyra9BAH7UY73VjmMaSWMkRB S/VR1HPIvQdW7BY8JGCF62lv3Yakniw5E07GTEcGB00APFSwviJB434Hcx2Lt+DPLC/b UXJZKspcpnFhMNbtjS6r193Dlmo7c8r0teHENVYp6UkCm7Ee56luBK/XKgqJB2bN1BHk 6tVQ== 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=zLO0fcsw3DREyh1nlnIKsuiS2KO2oINjemqK8cK8v6M=; b=WlGdQQXnYawmgj+XaDFBCnfu299DEDS4qXbsfEugR20Sj78N9j9+QlTPj/5SNgoPqp X5XRUxd8VaA0GG8gzV8ev7pDzEx1Bb5moCzxbCEAyvXg5mO3kefPBPCJ0NDMAiLdCcoC Q76brelW+vDct1CR1KyBlnn3Xt60Ri5lSylJ/goFZaEB8PTfOQi1IhdbTHTjzEICNW+G S7TG4tuGvH29PuRsU3td7AO5GZ0XtYNVn7kj0tZTfFg0fv19s17IkvSXr/ekKGvp4JJm c9JHDAb7/FvXIVzXrgfloS8yTs6154h6jEY1ZyuxLG0W2HO5OQD1vXc+jIJgWwt4mBiU 24wA== 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 j4-20020a63cf04000000b003c5d888f2e5si246595pgg.364.2022.05.10.12.35.42; Tue, 10 May 2022 12:35:59 -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 S1348223AbiEJRdd (ORCPT + 99 others); Tue, 10 May 2022 13:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348194AbiEJRd3 (ORCPT ); Tue, 10 May 2022 13:33:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4435229ED3C; Tue, 10 May 2022 10:29:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BFAFB61929; Tue, 10 May 2022 17:29:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E2BFC385C2; Tue, 10 May 2022 17:29:23 +0000 (UTC) Date: Tue, 10 May 2022 13:29:22 -0400 From: Steven Rostedt To: Xiaoming Ni Cc: "Guilherme G. Piccoli" , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Arjan van de Ven , Cong Wang , Sebastian Andrzej Siewior , Valentin Schneider Subject: Re: [PATCH 18/30] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set Message-ID: <20220510132922.61883db0@gandalf.local.home> In-Reply-To: <9f44aae6-ec00-7ede-ec19-6e67ceb74510@huawei.com> References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-19-gpiccoli@igalia.com> <9f44aae6-ec00-7ede-ec19-6e67ceb74510@huawei.com> X-Mailer: Claws Mail 3.17.8 (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=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Thu, 28 Apr 2022 09:01:13 +0800 Xiaoming Ni wrote: > > +#ifdef CONFIG_DEBUG_NOTIFIERS > > + { > > + char sym_name[KSYM_NAME_LEN]; > > + > > + pr_info("notifiers: registered %s()\n", > > + notifier_name(n, sym_name)); > > + } > > Duplicate Code. > > Is it better to use __func__ and %pS? > > pr_info("%s: %pS\n", __func__, n->notifier_call); > > > > +#endif Also, don't sprinkle #ifdef in C code. Instead: if (IS_ENABLED(CONFIG_DEBUG_NOTIFIERS)) pr_info("notifers: regsiter %ps()\n", n->notifer_call); Or define a print macro at the start of the C file that is a nop if it is not defined, and use the macro. -- Steve