Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1716668pxa; Thu, 20 Aug 2020 19:44:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6J9j+/bQqo6PMKuOvmp3c4FIBmJ//QTHpdAs6/kZ+tVXgWXvmCxleQJfumigusQYRTyNP X-Received: by 2002:a17:906:374f:: with SMTP id e15mr821051ejc.528.1597977852468; Thu, 20 Aug 2020 19:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597977852; cv=none; d=google.com; s=arc-20160816; b=RU+DmB4zetVm6feRiUZywoHZsumAyF9lINJNSK5e+ee0H2gG8UePblZG0B0PQlP/tW wzwIBD6o6j+ELrfGDI7N4d5OeCtXAjHzNag8rcgwi0m/gWSdlSig9QWBIIk/KgVhy+AS 2RhDRTwuoZWjKgTB1mVG47B0/ZPjsvhAeeLc2sYjbO0k/0bmE3ay4uCzJzSCEtKdW5SZ myHzY+XwdOjz8iM6eMoXEAXZpfmLiXBbFms3hzBBhGtiiutw0HjAkh2xScxvM9bIrIkE xgYdXCNiKzY5A8Bb6uHY2diqJ3vslNJ6wm/05NmtdMgxkLKwQGmsyDgNWqiQvoFKbRNy tH8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KRcYINGeMrkJsnhAghPntwftY8YIQTJq9q8O02Dazyc=; b=AF0pU1GlW19B6cZ96hMpe/fPUfQzakgnJKkMs+7Fbxq7S5D1qK5Y0h9Pg930j3BFpy Cb7U+MrLUT1uLbwbRDHiUdbjgsifYz9ZRiR1nQWXAVfJqf8sliz4ecz7UF4NoJdyxEbr skTzWaecbcb+IgRcs0k5nrNFnU9S6oMvHTIl77wLvO8x4s11GkKKBhEhbF9M/K6yzxxC rG4auigLvUlPyLacrjpOG56URnvBI3hDjtS4OA1jsfOrVeFTBv4QBSw6mNL5pIHp8g7i +H3du3C9pSQQLxgN11Fx/rUJhGcyHW87bwn8hwA0PABsTSutdbPs3jvLqiKt/2hAzo1X nYVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Kb+OKV7D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si264455ejb.629.2020.08.20.19.43.49; Thu, 20 Aug 2020 19:44:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Kb+OKV7D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbgHUCmd (ORCPT + 99 others); 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-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)