Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2534015pxa; Mon, 24 Aug 2020 17:39:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIo9GMjEKWrkDLvedRwOiatxaVnndeMdVhBS+ETjY24R6QcqW4XtLLYHNyJYUv+17dcfCO X-Received: by 2002:a17:906:3393:: with SMTP id v19mr8439199eja.135.1598315969095; Mon, 24 Aug 2020 17:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598315969; cv=none; d=google.com; s=arc-20160816; b=U8Q4/FHF8CFYAp6Vy20Y96/GltPkVFAhqB9+IA+iTXYnTrZlLheh+ZUlf33Wz4sPIu /pCpAxw6We8lHPTvajqeI6cVoSuwsYfa9LnMu/26PtQ7SmNzNOUDLv6n0KKdJBFhj7Ok 2MXvIByGYbLKQP+gUWu/53ZbhkwacUh/74ky3hn4BXeCM4bs8zOuvftpd/+djsKoTHKb a5pPEUbJ1BnfTuShNadY71fadEXx5GlDQtyonOrwLw5GX92iHgfvF3SI0PmazxZQtRKy b1VSw3durMFmJhw7upJa5v286O47fCbapNNhec670+shfhiuYzjwz2SIMhqjXBODUHX0 36+g== 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=y7P6WkRur/Wi1nF0hQV3VdSO9RWelS35A2+LFPlb/Uw=; b=AVB5BjXmRzlcmQffMYWclJ+A6ZMAfhPnjhUVkOLhv0SBr1tXdrIYuUyIg/7xQlKQ7K 2SWoLK/kxgG3PVO40QoacvNoHLJCMpXclLBkdFHsLhOxpq3Df21BEFwzmN7A40w7wNgo /GHaIW/9V4wS6Fcbfv9LNKpqJ46Sm9eYNbO89/B3uY0gkjHjzmb7qp18SuBUrHBwme/F YwGjL6iAnaGk2aiA+T9fTmBXpR6S8Q32A5USPppzR1yLF9GVHPF0AdTAMn9MvmJq8mYo QtYd236ygK2fZoOaXhxGrqxXDJ0IymHaukJdZwkis7k1gyBxTEHQrIRpJTSenL4QJq5d 33xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=A4dLEmZs; 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 b23si7451674ejb.465.2020.08.24.17.39.06; Mon, 24 Aug 2020 17:39:29 -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=A4dLEmZs; 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 S1728141AbgHYAik (ORCPT + 99 others); Mon, 24 Aug 2020 20:38:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbgHYAij (ORCPT ); Mon, 24 Aug 2020 20:38:39 -0400 Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8664C061755 for ; Mon, 24 Aug 2020 17:38:39 -0700 (PDT) Received: by mail-vs1-xe41.google.com with SMTP id y8so5447651vsq.8 for ; Mon, 24 Aug 2020 17:38:39 -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=y7P6WkRur/Wi1nF0hQV3VdSO9RWelS35A2+LFPlb/Uw=; b=A4dLEmZsScgkGVFoBW/ZD/K+W5FlpYsKMIOncqMhANo9TeioVu6heRzICP8VIjCOej X13V/SiFz0gPIZiIuNnsTArDIufgYzWQxLyhszvX/HQ2WdhufUrqfWBvFoXNfaPEFq9R AKm/U+0B9Cl9HksWRnDPx/i8nBlvVajpBfkp4= 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=y7P6WkRur/Wi1nF0hQV3VdSO9RWelS35A2+LFPlb/Uw=; b=lHByfZ8mEbM1hw+O2pXhm3R+FGK8mlbSIK8CizVjzYq5IUmP+Kwcu5tMlJ/KNm0F/L v6aCsl2UOncvtS1lIPbBaXqEGhPZ2rRwQzsfc1zvufcJJI2M+LatHVzADeEO+duQVnzg DI4ieeEu+3i7VQ3aUl9jsZIQLNRzZeZP38xQXX1mdVFLB2T37Tl4vXzgShucAjlmlh4d e/oL5j6x50d99JAxbi2rqNhxfOgcEUlTWzTbuD7RKvUZEZeXSZ3nkMNAIJEIWhPn/nZt 65iV0Nfy8u5xbJDQ+dYKoE5buEWUnbkjvDny070zXQFcw78Wy0KcPEz6R0tMqknZ+3pa wiNQ== X-Gm-Message-State: AOAM5314ICrwNuonkRT4tUxkFVAtnZhE515lhdO34aT1Bz9teWeIE1el rydAA1rE+AjvRIiWSm3EcfFXFlYuFSN4f/9njE/BQw== X-Received: by 2002:a67:bb06:: with SMTP id m6mr4308771vsn.54.1598315918860; Mon, 24 Aug 2020 17:38:38 -0700 (PDT) MIME-Version: 1.0 References: <20200824105852.v5.1.I4feb11d34ce7a0dd5ee2c3327fb5a1a9a646be30@changeid> <20200824093020.073ae8d8@oasis.local.home> In-Reply-To: <20200824093020.073ae8d8@oasis.local.home> From: Nicolas Boichat Date: Tue, 25 Aug 2020 08:38:27 +0800 Message-ID: Subject: Re: [PATCH v5] kernel/trace: Add DISALLOW_TRACE_PRINTK make option To: Steven Rostedt Cc: Douglas Anderson , Guenter Roeck , Andrew Morton , Andy Shevchenko , Daniel Vetter , "Guilherme G. Piccoli" , Kars Mulder , Kees Cook , Masahiro Yamada , Michal Marek , Thomas Gleixner , Tiezhu Yang , Will Deacon , Yue Hu , linux-kbuild@vger.kernel.org, lkml 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 Mon, Aug 24, 2020 at 9:30 PM Steven Rostedt wrote: > > On Mon, 24 Aug 2020 10:59:13 +0800 > Nicolas Boichat wrote: > > > --- > > > > +ifeq ($(KBUILD_DISALLOW_TRACE_PRINTK),1) > > +KBUILD_CFLAGS += -DDISALLOW_TRACE_PRINTK > > +endif > > + > > KBUILD_CFLAGS += $(DEBUG_CFLAGS) > > export DEBUG_CFLAGS > > > > > There's one more thing we need to do, is if you build without this option > then build with it, you should trigger a full kernel rebuild. > Otherwise, if you build without the option, then build with it, and it > doesn't rebuild the tree, it wont catch anything. This already works. I'll be honest, I'm not 100% sure why (and if fully intentional)... The CFLAGS end up in 3 generated assembly files: # grep -R DISALLOW_TRACE_PRINTK * | grep -v ".cmd:" arch/x86/kernel/asm-offsets.s:# -imultiarch x86_64-linux-gnu -D __KERNEL__ -D DISALLOW_TRACE_PRINTK kernel/bounds.s:# -imultiarch x86_64-linux-gnu -D __KERNEL__ -D DISALLOW_TRACE_PRINTK scripts/mod/devicetable-offsets.s:# -D DISALLOW_TRACE_PRINTK (along with all *.cmd files) and I suspect some/all of those force a complete kernel rebuild. > -- Steve