Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp138821pxa; Fri, 21 Aug 2020 03:31:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIBDDHK0xVXk+e2dyFvLRFgQIk2eKJML6uPS/WoqxL8M/LSfEJz5BMWIn4q9Ri34gjW22z X-Received: by 2002:a05:6402:3102:: with SMTP id dc2mr2186337edb.152.1598005861205; Fri, 21 Aug 2020 03:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598005861; cv=none; d=google.com; s=arc-20160816; b=Oon1F0t/epsttEEamBzLEW2rU3YlqrVRrAvbUsDc28GXoVycWIbeixfV1WNa9+V3ee TCTcaQsx69UboxNWS8l+IscIJEUpfhy1wQpCA+rsU47yjqyHYRgC8s/VjMopQsaAF3UQ 6aUgsny1pPiFPSZHZngh/nSoLOlO2dWUvIQGkDMNh1bi5MzBqE2zT+UKcHkRA3r1PEua /RRorPmU+TSGGyzew3b260B78ny8mnBLwfz0MZNVMG0ZgtF3MCJHIyYNYw5uKjYyW289 D8Kp8DJfFx9FHNYwSRppQcrqmLtDV+nSP6peIQkfLcVn1NLwR24YHdmtbXffONg1Ubgw kqNQ== 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=tLYcljNGZttH/GCZ/u2OCM/Vr/JknmWHq4l/f3i9MZg=; b=QoYpLfajluewt3Jh2zuGs0Cqsq+3u7HZ5R5mF0kS6lq2X8lGNKMzCFBKndO/hDv3Ee HgdS+CrVYeGzJTJ4YPXucgqV0bYJDU7lP6ncFEB9RSHf9wYTCEGhRDzzKFpHma3O/b5B he111TLHNicexBxgTL/Dyq8eiMgBkuFIKcPyVCd2HYD5Yl38UnVSgHbOgnrCdTHzoyW9 ry/hwZmuaNQU8lMbpuD4tzJcP8gnm+ea4YEJDzD1Pbod+uPcQGLKuc4Z+XiJd15poKfQ Lo4dcn9LmpP3xnlueMNbJXdoJUbJnWESxfAjcpnpy5dpbcrbuV++Vh8InVtkpEm7wpwO Sn9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ITwgGOpR; 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 s22si885375ejv.358.2020.08.21.03.30.36; Fri, 21 Aug 2020 03:31:01 -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=ITwgGOpR; 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 S1728489AbgHUK1r (ORCPT + 99 others); Fri, 21 Aug 2020 06:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728004AbgHUK1q (ORCPT ); Fri, 21 Aug 2020 06:27:46 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E69C061385 for ; Fri, 21 Aug 2020 03:27:44 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id a127so577709vsd.1 for ; Fri, 21 Aug 2020 03:27:44 -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=tLYcljNGZttH/GCZ/u2OCM/Vr/JknmWHq4l/f3i9MZg=; b=ITwgGOpRS/WDjnqmJfAc0eAYsRTBHz8MYA3e73p551BWIzeon7OpZszOJLTMnqlrIT JXNmrQBx3msE7pRgDV2Aq6onKkMYxPleGiByxw0RAQT05Oz2LEF3KzLpkGyfm71SheI6 VIapccfxOLUkzclJScPQVLsL/+V1IfeOqhKrg= 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=tLYcljNGZttH/GCZ/u2OCM/Vr/JknmWHq4l/f3i9MZg=; b=tyyTB5ime2rMS9bzKmBnMTol1DBXGL5F+kiBpiNztr4+fVHBt0Z5CT/mzeQ3xHMUUM b6VQYx4yuPTu6RBY4alDMNgB6RB6j2wfMfVmNAcjC4cvySICM3k7rPgUJW6dGyoHeZZf FHKFjbilWd6ZG7TA+h3etpJm7wx5l1i8cCrMc8TiM/o7aAaFQcJYB/CbG51igvCZ0xVr E9IBBHjUqqJSW8N+nC1oTKQzBP09ddvqn6uYEyLY7oLo+8t0OkEh/0JctYfiPw5PG6H8 6q+IABXp/T9cCz+4dVOLcxTE/mhICsKRm+//MLjxNB80I74HzExYaf5gsek47jUqGUb1 vqLQ== X-Gm-Message-State: AOAM532lqdpUk8aaXkLElbUKzn7EsLppilhvUoHalRt2zhqR6LRNpzLA wh/cFG0iYVVqmAl69YDlu9yuYlgvOenaAH79cWBXgg== X-Received: by 2002:a67:f787:: with SMTP id j7mr1089774vso.79.1598005663199; Fri, 21 Aug 2020 03:27:43 -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> <21fae92da07c4566ba4eed3b5e1bce2d@AcuMS.aculab.com> In-Reply-To: <21fae92da07c4566ba4eed3b5e1bce2d@AcuMS.aculab.com> From: Nicolas Boichat Date: Fri, 21 Aug 2020 18:27:30 +0800 Message-ID: Subject: Re: [PATCH v4 3/3] media: atomisp: Only use trace_printk if allowed To: David Laight 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 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 4:48 PM David Laight wrote: > > From: Steven Rostedt > > Sent: 21 August 2020 01:36 > > On Fri, 21 Aug 2020 08:13:00 +0800 > > Nicolas Boichat wrote: > > > > > On Thu, Aug 20, 2020 at 10:23 PM Steven Rostedt wrote: > > > > > > > > On Thu, 20 Aug 2020 17:14:12 +0800 > > > > Nicolas Boichat wrote: > > > > > > > > > Technically, we could only initialize the trace_printk buffers > > > > > when the print env is switched, to avoid the build error and > > > > > unconditional boot-time warning, but I assume this printing > > > > > framework will eventually get removed when the driver moves out > > > > > of staging? > > > > > > > > Perhaps this should be converting into a trace event. Look at what bpf > > > > did for their bpf_trace_printk(). > > > > > > > > The more I think about it, the less I like this series. > > > > > > To make it clear, the primary goal of this series is to get rid of > > > trace_printk sprinkled in the kernel by making sure some randconfig > > > builds fail. Since my v2, there already has been one more added (the > > > one that this patch removes), so I'd like to land 2/3 ASAP to prevent > > > even more from being added. > > > > > > Looking at your reply on 1/3, I think we are aligned on that goal? Is > > > there some other approach you'd recommend? > > > > > > Now, I'm not pretending my fixes are the best possible ones, but I > > > would much rather have the burden of converting to trace events on the > > > respective driver maintainers. (btw is there a short > > > documentation/tutorial that I could link to in these patches, to help > > > developers understand what is the recommended way now?) > > > > > > > I like the goal, but I guess I never articulated the problem I have > > with the methodology. > > > > trace_printk() is meant to be a debugging tool. Something that people > > can and do sprinkle all over the kernel to help them find a bug in > > areas that are called quite often (where printk() is way too slow). > > > > The last thing I want them to deal with is adding a trace_printk() with > > their distro's config (or a config from someone that triggered the bug) > > only to have the build to fail, because they also need to add a config > > value. > > > > I add to the Cc a few developers I know that use trace_printk() in this > > fashion. I'd like to hear their view on having to add a config option > > to make trace_printk work before they test a config that is sent to > > them. > > Is it worth having three compile-time options: > 1) trace_printk() ignored. CONFIG_TRACE=n (now) > 2) trace_printk() enabled. CONFIG_TRACE=y (now) > 3) trace_printk() generates a compile time error. CONFIG_TRACE=y and CONFIG_TRACING_ALLOW_PRINTK=n (my patch) > > Normal kernel builds would ignore calls. > Either a config option or a module option (etc) would enable it. > A config option that 'rand-config' builds would turn on would > generate compile-time errors. Yes, a config option is exactly what my patch 2/2 does. And see Steven's argument. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >