Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2595351rwb; Sat, 6 Aug 2022 02:14:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR4MrRgpPew8fJFFIsHMoXyvncLxfRtjJG/vtOWSsPXznli4olRswknYzpT7itEVa4DuRIY1 X-Received: by 2002:a63:4503:0:b0:419:7b8c:cb11 with SMTP id s3-20020a634503000000b004197b8ccb11mr8622026pga.446.1659777281324; Sat, 06 Aug 2022 02:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659777281; cv=none; d=google.com; s=arc-20160816; b=Pt4l1hsOt8eo+u5oZKsTPgVuA8nP6bxGDOd7o1Q4rR1gCT+zcJ5caTYqSbNbyTHAQA efXmPbKpRiCzBhZBnxICwAh2zLW1Cd3qWDRRxPeZjpXtftBwyOEMijCb6rJ7347C5k1H tmTSv3TRpefhn1xMMK4WddqrbHzjzX+e2l1Q6X8bAKOWY24bORjOziBT2KB4g64eUcMo nf6eS6SdKjTaOkedZZcLxxQbWQkogMChOPvEQBaAMGeu07WdZD+t1WLvU5g9IiUb2KTM Jss1wNGFyQ3EyfDNcYP7B+6jqaquTKAFSCBvVY94nI0YCteIXg1S4AeCupvYUxQb+4Ck 4KNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject:from :content-language:user-agent:mime-version:date:message-id; bh=4pvPpaKniojSVwCNBxwCSGGSS8pzwA13ueMMLTFNdYI=; b=Q3FZhLtLrsX2kRUf8M8yWV6xVtvg1VTngIMU3UHcrPPN61vRMq4GZpPgAaGy4KIZNK uPbFCkKZqTGq0E0uxekGjWhVTzALPB1IjEp+TcuWpaQ473y2LECm0m4FouSzkkCPdLiX /yD3wGh75kxRAkDCEihjnqfaTEsv2A2wP49pbru8N+kkTPu8yPc1ArKRnoRnd76Q5e2d MDamtEwwYvyg7cpPiDZdWwA5sa+MwNWObrQJAoO90LJ1KEh+lQVxYuefgapgL8jHm4UZ OxXF7gtqKWI1xnKiNLJRMyNOAqU0pgfn4LMGGhNGB9kfNQs1K1cyBjmFVqYDH8G+2ImJ Mvsg== 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 124-20020a630982000000b003fe24378d92si5363803pgj.156.2022.08.06.02.14.27; Sat, 06 Aug 2022 02:14:41 -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 S229609AbiHFIxX (ORCPT + 99 others); Sat, 6 Aug 2022 04:53:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiHFIxV (ORCPT ); Sat, 6 Aug 2022 04:53:21 -0400 Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A15E111C13 for ; Sat, 6 Aug 2022 01:53:19 -0700 (PDT) Received: from [192.168.1.18] ([90.11.190.129]) by smtp.orange.fr with ESMTPA id KFYboXXEJGDTnKFYboaqyZ; Sat, 06 Aug 2022 10:53:18 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 06 Aug 2022 10:53:18 +0200 X-ME-IP: 90.11.190.129 Message-ID: <3eacc364-90b7-7a5d-c936-1ed993428ef6@wanadoo.fr> Date: Sat, 6 Aug 2022 10:53:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 X-Mozilla-News-Host: news://news.gmane.org:119 Content-Language: en-US From: Christophe JAILLET Subject: Question: dev_err_probe() vs Printk Index To: Greg KH Cc: "linux-kernel@vger.kernel.org" , Kernel Janitors Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 Hi, When a driver is using dev_err(), part of it is inlined and it: - takes advantage of dev_fmt() [1] - implements Printk Index [2] Printk Index works with some __builtin_constant_p() magic in it. In case of a use in a probe, 99.99% of the time the log level and the format will be constant and the logic for Printk Index will be put in place. In case dev_err_probe(), the format will be an argument passed to the function and will not be constant, so nothing will be generated in the 'printk'_index section. In case dev_err_probe(), a potential dev_fmt() defined in the drivers' file can't be taken into consideration. (trusting my grep, we never use in files that define dev_fmt() in the .c file. I've not checked if it is true via #include "") Even if I've read [3], I don't fully understand the real need of this Printk Index mechanism (at least for my own needs :)) My questions are: - is my analysis right? - is the lack of these 2 functionalities (dev_fmt and Printk Index) expected, when dev_err_probe() is used? - if not, is it a issue? - should it be at least documented? (not sure who to put in copy of this mail) CJ [1]: https://elixir.bootlin.com/linux/v5.19/source/include/linux/dev_printk.h#L143 [2]: https://elixir.bootlin.com/linux/v5.19/source/include/linux/dev_printk.h#L107 [3]: Documentation/core-api/printk-index.rst