Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp217903pxa; Fri, 21 Aug 2020 05:38:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys8784rsAICCzdf+WU4IOyogoDJ46/Ym96Ss+bR+wQ4XF9NEBbGRMdRWJDaT6PjL5I60z6 X-Received: by 2002:a05:6402:c84:: with SMTP id cm4mr2582002edb.20.1598013532410; Fri, 21 Aug 2020 05:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598013532; cv=none; d=google.com; s=arc-20160816; b=aaa9+VfjSyrCKmYIxdV5/pjAE8SGpZtTQNPLBqlyOZNnwhVS57SrUczlLog06NlI4G 4ZtsP9xxxhLJH8fTPxyvlsrXvhwTtTBxbYcVrwGM3RUCxTU780f92vPxkaifRNeIRhQh Qv/CPwr4stDNWQx9ahGg4o9yLzd33h4MAZ8VFzUdaCzQKxgM73QqdcnWuPrzXrwLrOck NebRHoyhOuWtWgQdod6X+2wZ8vsI+8bWl6WbBxwrYA5f28YO8qyH7N4rXWFwNDpx4WD3 0An8O/9EdNI1WzYQIsVjoPToohDZUz17k6yKux2z7Ji1SV8LYILb9+n6vn4ZBCI2jg04 GYVQ== 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=HUgN6ieJhIl8uII5WpVu/u5z15uJplqpBcG4NHNK9Tk=; b=va7T9J7KqyvfU/DhUPL5TqOjljEWXw+PPlwwXMVXnxGIla73CD8S1Ph5wSMaCEcCpl sr+Da7RayTI/oaiSQlDfBsymEINl6dyEHzUMcccSZci0EqVd87TZ8yg0R269hy5E1yuF o3bqX++dyiNbS1cVWL2N3cwv2FHmcUg12Z8pIrzGWDIwUqBPvY5mGC5B56QBlaCKL15S vqMQHg6TR4wa+hRe282wIEZ3rX3gsR32c/CDJq+LR/IWt5b5K/5oUKErTzFhvOOHestS CVDBC/tdIVMdZv1W16SnfGJx/9zNoMbLbF1oDiQQl1MTqSRjTlyRsffoCsq6SXo1nA51 ObyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=B+XDozwp; 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 b13si1136730ejq.223.2020.08.21.05.38.28; Fri, 21 Aug 2020 05:38:52 -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=B+XDozwp; 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 S1727892AbgHUMh2 (ORCPT + 99 others); Fri, 21 Aug 2020 08:37:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727104AbgHUMh2 (ORCPT ); Fri, 21 Aug 2020 08:37:28 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8546C061386 for ; Fri, 21 Aug 2020 05:37:27 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id r7so733513vsq.5 for ; Fri, 21 Aug 2020 05:37:27 -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=HUgN6ieJhIl8uII5WpVu/u5z15uJplqpBcG4NHNK9Tk=; b=B+XDozwpX0mgDxmJ6B/TSWbBDUbxlXICDWzTZ0j1JZrwcVr7nlDnFEkAXLfjy9/mv8 htZLil76tPTHeIHrsH8uDlSs0MDekxxkQFL5tatwS+M8PXeS8Las4CgSNBfkRPfZZY5n Db2XXy4qs3y2Ha+4PSmAEzBhK26XXt/hZh7Hk= 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=HUgN6ieJhIl8uII5WpVu/u5z15uJplqpBcG4NHNK9Tk=; b=ZDRz70Qem2dsGJTomxl9drfqxtuLXU0NlLqRyQCkVj6m+9Im17o7AuItGpViIpfHOc L8E+qiCg7LEWY1auIt/3qBbpQlcNARCsdGj3GJi9tgM7NoKXI3Wfi+Wv/VXroqeFs6oF hF2C6YM7KoMz4GEyR6H82HgtzDoz1Ga8vq9OkTIm6SoKUpYl70wjUlFvIG3frGwmssDO 7OO4LSFNRiYGndrpJqbg4EHeFJKup4+hqSHS/f3CaSQ3k/x7R4VxAi2ToD+JzwS63+n6 cv4IQOUvTFIWKq59qzZFt/u2mqGzQaeSLnjxdrosN3k4zgWLI0l5KrCpxgKR6zUIWfUi aFbg== X-Gm-Message-State: AOAM530Zb08zwJ5tbk4TxTo5wp3rqQ0Pl3+qYtpNHnQmuh3fzjFv5+AE JIF9B5uGxa53IMlOXAJB4R1Zl2ZOgpQQqV7NgnJYlA== X-Received: by 2002:a67:f787:: with SMTP id j7mr1403877vso.79.1598013446831; Fri, 21 Aug 2020 05:37:26 -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> <898c56e4b7ef4c3da1d634fdef5a8898@AcuMS.aculab.com> <6c5249afad274ce49e643d9b05706e3a@AcuMS.aculab.com> In-Reply-To: <6c5249afad274ce49e643d9b05706e3a@AcuMS.aculab.com> From: Nicolas Boichat Date: Fri, 21 Aug 2020 20:37:15 +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 8:18 PM David Laight wrote: > > From: Nicolas Boichat > > Sent: 21 August 2020 13:07 > ... > > > You might also want a #define that can set temporarily > > > to enable traces in a specific file/module even though > > > CONFIG_TRACE=n. > > > > I don't understand how traces are supposed to work with CONFIG_TRACE=n? > > Probably because I meant something different :-) > > You want the kernel built so that there are no (expanded) > calls to trace_printf() but with support for modules that > contain them. > > Then I can load a module into a distro kernel that > contains trace_printf() calls for debug testing. Gotcha. I think it already works this way ,-) So if you have CONFIG_TRACE=y, but no trace_printk in your vmlinux/kernel, no memory is used, and no warning splat (https://elixir.bootlin.com/linux/v5.8/source/kernel/trace/trace.c#L3160) is displayed. But then when you load a module with trace_printk, the buffers are allocated and the warning splat is printed. The magic is here: https://elixir.bootlin.com/linux/v5.8/source/kernel/trace/trace_printk.c#L53 My option wouldn't really change that. I mean, if you have CONFIG_TRACING_ALLOW_PRINTK=n when you compile your module, it'd fail at build time, but if you set it to =y, your module could happily build and load (with the big warning splat), no matter how you built your kernel (I mean, you still need CONFIG_TRACE=y, but CONFIG_TRACING_ALLOW_PRINTK doesn't matter). > Which is why I was suggesting a config option that > only rand-config builds would ever set that would > cause the calls to generate compile-time errors. I think I already answered that one above. We'd want that config option enabled on Chrome OS and we're not a rand-config build (I mean, we're a very carefully selected random config ,-P). Thanks, > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales)