From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87CACC433E1 for ; Fri, 21 Aug 2020 02:42:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F5D920758 for ; Fri, 21 Aug 2020 02:42:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Kb+OKV7D" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgHUCmd (ORCPT ); Thu, 20 Aug 2020 22:42:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbgHUCma (ORCPT ); Thu, 20 Aug 2020 22:42:30 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0386C061386 for ; Thu, 20 Aug 2020 19:42:28 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id g20so137402uan.7 for ; Thu, 20 Aug 2020 19:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KRcYINGeMrkJsnhAghPntwftY8YIQTJq9q8O02Dazyc=; b=Kb+OKV7DQOGsISDsb7ycGgBlHZrAF4j+ubIx9mrQK2Af0qCfrWhkHaXe9SDOd6C2Wz xwlxyuo8RO6ENNuOn6U98HAigUM7CS6hiMIUGJkmnwijoXvc/kFLN/oUVAHbRcuhdUfs SObv7Y3Cbn1hrzcGDCUIrUz42utYsodAo4bhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KRcYINGeMrkJsnhAghPntwftY8YIQTJq9q8O02Dazyc=; b=S0wTDoicmJeGKxRgDnjo80pfEQsNpRCFWtQOwnehc0VxvS3UJr5rsNTGiCNJaKHn5T 7R1X9nq2x2rk0XtRMW2ABOu6YUxva+XVxCcIarSo+hWAV7Hk4xwhVUxXKoYY8cKq+cql EQq2WpW8Uh+t9UFTZ5wuZ4F0NyYQyikGKSwD6d6gF+KvErdrgyyTqNhTYLFjnAkYEnya ie8xlPPMP/y0CG5Yaq81Obgsgc7xwggOCZGBhN6YCXpdCLsHif4TnX079sAmRGgMCW10 FCgn3AgWgcis7BpRB/Lx5UBq/KGCcgmU8cC+8MioPocS0AQHtSR0nHuKOt8GnIgsTXhS SA9w== X-Gm-Message-State: AOAM530s60oFulJJyRUfz+pm5+ilfPsL4VPHM+AtiMPrQBuXdbam8LEU W0xlDWwKFvJKAWuMgAOpNum04c852I/2Cre/DwAFPeyYwvcfqA== X-Google-Smtp-Source: ABdhPJwQSw+Mu7CDu/qPHEFFWNOTIiJKWxzRL5Kpq8hObaORvbMqMUkA/5RlPy0vT3897R9VKdnBNAYTanM1LbNkPrA= X-Received: by 2002:ab0:41:: with SMTP id 59mr392357uai.40.1597977745886; Thu, 20 Aug 2020 19:42:25 -0700 (PDT) MIME-Version: 1.0 References: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> <20200820102347.15d2f610@oasis.local.home> <20200820203601.4f70bf98@oasis.local.home> <20200820215701.667f02b2@oasis.local.home> In-Reply-To: From: Nicolas Boichat Date: Fri, 21 Aug 2020 10:42:14 +0800 Message-ID: Subject: Re: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed To: Joe Perches Cc: Steven Rostedt , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andy Shevchenko , Sakari Ailus , devel@driverdev.osuosl.org, lkml , Linux Media Mailing List , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , Douglas Anderson , Guenter Roeck Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 21, 2020 at 10:36 AM Joe Perches wrote: > > On Thu, 2020-08-20 at 21:57 -0400, Steven Rostedt wrote: > > On Fri, 21 Aug 2020 09:39:19 +0800 > > Nicolas Boichat wrote: > [] > > > Some other approaches/ideas: > > > 1. Filter all lkml messages that contain trace_printk. Already found > > > 1 instance, and I can easily reply to those with a semi-canned answer, > > > if I remember to check that filter regularly (not sustainable in the > > > long run...). > > > > Added Joe Perches to the thread. > > > > We can update checkpatch.pl to complain about a trace_printk() that it > > finds in the added code. > > Why? > > I don't see much value in a trace_printk checkpatch warning. > tracing is still dependent on CONFIG_TRACING otherwise > trace_printk is an if (0) > > ELI5 please. This is my "new" canned answer to this: Please do not use trace_printk in production code [1,2], it is only meant for debug use. Consider using trace events, or dev_dbg. [1] https://elixir.bootlin.com/linux/v5.8/source/kernel/trace/trace.c#L3158 [2] https://elixir.bootlin.com/linux/v5.8/source/include/linux/kernel.h#L766 I also had arguments in patch 2/3 notes: There's at least 3 reasons that I can come up with: 1. trace_printk introduces some overhead. [some users, e.g. Android/Chrome OS, want CONFIG_TRACING but _not_ that extra overhead] 2. If the kernel keeps adding always-enabled trace_printk, it will be much harder for developers to make use of trace_printk for debugging. 3. People may assume that trace_printk is for debugging only, and may accidentally output sensitive data (theoretical at this stage). (we'll need to summarize that somehow if we want to add to checkpatch.pl) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7C23C433DF for ; Fri, 21 Aug 2020 02:42:29 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 84BA720758 for ; Fri, 21 Aug 2020 02:42:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Kb+OKV7D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84BA720758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6F259886B5; Fri, 21 Aug 2020 02:42:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e4xH-CnPeShy; Fri, 21 Aug 2020 02:42:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id AB298886AA; Fri, 21 Aug 2020 02:42:28 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3C4221BF9C1 for ; Fri, 21 Aug 2020 02:42:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 36A2E86CD4 for ; Fri, 21 Aug 2020 02:42:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aumDHysE-diZ for ; Fri, 21 Aug 2020 02:42:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ua1-f66.google.com (mail-ua1-f66.google.com [209.85.222.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id F38EC86CD2 for ; Fri, 21 Aug 2020 02:42:26 +0000 (UTC) Received: by mail-ua1-f66.google.com with SMTP id q68so145065uaq.0 for ; Thu, 20 Aug 2020 19:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KRcYINGeMrkJsnhAghPntwftY8YIQTJq9q8O02Dazyc=; b=Kb+OKV7DQOGsISDsb7ycGgBlHZrAF4j+ubIx9mrQK2Af0qCfrWhkHaXe9SDOd6C2Wz xwlxyuo8RO6ENNuOn6U98HAigUM7CS6hiMIUGJkmnwijoXvc/kFLN/oUVAHbRcuhdUfs SObv7Y3Cbn1hrzcGDCUIrUz42utYsodAo4bhA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KRcYINGeMrkJsnhAghPntwftY8YIQTJq9q8O02Dazyc=; b=FO9y1zYYYmYGsqHagf0uYSaDrtKfL4M1xWRu3CbzzK5ydtxIzuDC+QVGl/4uha9lQb P9WhEShEpXpRb2IwMFi/u1T9jcSQHC8SyBFbzJRe7Tfb8vFCT3FSn5A3YGMWIAalW0sH BW+t6SPy8+Ynvg0hAeEv5w50pQdddyrWTOmY+5BgdbUFXjOFqfBqz/xPHS0pc/hY1ryF zG+R51e3QECBX6+wNuHIAr9jJWoVBIzIRdn5pdTooBjOE0n6wYy0kLg4Wi67UqCMUO76 o1Q2tLXjgX4k4c5Tlq04aec1S7yqf38J3zcTk5bmqTul3qODtUFR61chNIFoFY/3Qn6o trWQ== X-Gm-Message-State: AOAM533ue6PP8N/A/cClFWo4zcfCC73q8iCjGiQL/FaN7CDS2VLGKX+0 lMBPZRHtvibbFBW+wpy99RCWI11X9ySyuY1co1s1Ng== X-Google-Smtp-Source: ABdhPJwQSw+Mu7CDu/qPHEFFWNOTIiJKWxzRL5Kpq8hObaORvbMqMUkA/5RlPy0vT3897R9VKdnBNAYTanM1LbNkPrA= X-Received: by 2002:ab0:41:: with SMTP id 59mr392357uai.40.1597977745886; Thu, 20 Aug 2020 19:42:25 -0700 (PDT) MIME-Version: 1.0 References: <20200820170951.v4.1.Ia54fe801f246a0b0aee36fb1f3bfb0922a8842b0@changeid> <20200820170951.v4.3.I066d89f39023956c47fb0a42edf196b3950ffbf7@changeid> <20200820102347.15d2f610@oasis.local.home> <20200820203601.4f70bf98@oasis.local.home> <20200820215701.667f02b2@oasis.local.home> In-Reply-To: From: Nicolas Boichat Date: Fri, 21 Aug 2020 10:42:14 +0800 Message-ID: Subject: Re: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed To: Joe Perches X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Andy Shevchenko , Peter Zijlstra , Greg Kroah-Hartman , lkml , Steven Rostedt , Douglas Anderson , Sakari Ailus , Josh Poimboeuf , Guenter Roeck , Thomas Gleixner , Mauro Carvalho Chehab , Linux Media Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Fri, Aug 21, 2020 at 10:36 AM Joe Perches wrote: > > On Thu, 2020-08-20 at 21:57 -0400, Steven Rostedt wrote: > > On Fri, 21 Aug 2020 09:39:19 +0800 > > Nicolas Boichat wrote: > [] > > > Some other approaches/ideas: > > > 1. Filter all lkml messages that contain trace_printk. Already found > > > 1 instance, and I can easily reply to those with a semi-canned answer, > > > if I remember to check that filter regularly (not sustainable in the > > > long run...). > > > > Added Joe Perches to the thread. > > > > We can update checkpatch.pl to complain about a trace_printk() that it > > finds in the added code. > > Why? > > I don't see much value in a trace_printk checkpatch warning. > tracing is still dependent on CONFIG_TRACING otherwise > trace_printk is an if (0) > > ELI5 please. This is my "new" canned answer to this: Please do not use trace_printk in production code [1,2], it is only meant for debug use. Consider using trace events, or dev_dbg. [1] https://elixir.bootlin.com/linux/v5.8/source/kernel/trace/trace.c#L3158 [2] https://elixir.bootlin.com/linux/v5.8/source/include/linux/kernel.h#L766 I also had arguments in patch 2/3 notes: There's at least 3 reasons that I can come up with: 1. trace_printk introduces some overhead. [some users, e.g. Android/Chrome OS, want CONFIG_TRACING but _not_ that extra overhead] 2. If the kernel keeps adding always-enabled trace_printk, it will be much harder for developers to make use of trace_printk for debugging. 3. People may assume that trace_printk is for debugging only, and may accidentally output sensitive data (theoretical at this stage). (we'll need to summarize that somehow if we want to add to checkpatch.pl) _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel