Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp674673pxb; Thu, 21 Jan 2021 17:37:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxk3oI61cKUAhvOnOrBOxVJeZSqvI7FfapTA6fgpja8TZZojRtcEoOCz00DkNfIXF3hV5oG X-Received: by 2002:a17:906:7c57:: with SMTP id g23mr142778ejp.364.1611279436196; Thu, 21 Jan 2021 17:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611279436; cv=none; d=google.com; s=arc-20160816; b=pMhO81g99pSPH3rgDAlOsjsV5tQHFtQwBJbF3EnD/11XTxpWOgggy0tsfwUzr14lso czx76Kv0d6ORROljiYkq/kj+jSoZXfKow5+JwW5Pym0wpT2GA8I4Mv02W863zerk4I1g tRCoUrRoWvU8kxAvDmsPKyuRE8XOTt6R5OLZMNEfbEX/ur/fViqMujUOCqxJTCBr66DX jNxHGLJ1Tysq0jklK+dqWblCXzWH18QKeaqjkK9no0oRAs0MRsalUDlS3nVNZMiMxgfX PsQljzxxPFjdq0l3RmtahntKZ4y9K8JMJ6Bvkr4JquHwAlW5e3coTLjT2LKs41ulhONi Mtfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=J3zUPc3/QcY2myKFIxXj5SI3ce2GEipGTyEZDOPm3Z0=; b=md3jze7pFD0nsdWGn2VhyCAbhrS2sDGgkliMgycTab9ZUJkFW7Zoe9PLB0FAPpXcf7 +iYPVunt/g+B6BqYAFBdtyTDI/Hzpg+a52v01Vn+YEaDz1Q84xMKXs3WKm5609mPhJDO J8igyeAeeB5Kgof4hWOw7WZj8DxmpDV0oJ2oh7dcjVzipNI6tRc73GzJNXnWpckiB+n7 gNAKwyoMHuSTMeBFDFyhblttK+EdI24gCkGnO8gZSP9cdeZBO6GOvTsG5MtpVLsMqhh4 s+5IdLmHGVqmUS8OZRQB6KY8zq6so0+SFAwgzC9+y8x4RCfKGwb/SUSjZYTUHxahzJnL XVGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fDlBOFIQ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a67si3090468edf.198.2021.01.21.17.36.52; Thu, 21 Jan 2021 17:37:16 -0800 (PST) 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=@google.com header.s=20161025 header.b=fDlBOFIQ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726402AbhAVBf3 (ORCPT + 99 others); Thu, 21 Jan 2021 20:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbhAVBfV (ORCPT ); Thu, 21 Jan 2021 20:35:21 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA0F2C0613D6 for ; Thu, 21 Jan 2021 17:34:40 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id cq1so2782706pjb.4 for ; Thu, 21 Jan 2021 17:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J3zUPc3/QcY2myKFIxXj5SI3ce2GEipGTyEZDOPm3Z0=; b=fDlBOFIQ1ZnIVITy+QSWWFAgO/YYu9cZvfCQeBRQWNapdMdNMFUSRhiuMZPLC3UJ8d L3lnVtSYU9/1oToby46J2Cw0y+z9UPOfzmw/DJKKR/8CdR4L2LPivctZvjXtuIhsqzx8 +Az0FIzLer9VTAgpYLKXVKCQ8+6ELlpXrDVmfmj8F4u7wmj8xQ4/DrB9Xip0qJcolohq biILhYvr0lMgqw6d2tEv4qLaAQFqlShtNx5Jt11TC9qiqvlfdfQF0a0jkMFngmFiwfin 017QeCZdJRcIJao6QzHFCOkFNuF62eHAIfmsvRpgRZ8edinalxw4u7/eEnUPRH8uhuFR CcZQ== 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=J3zUPc3/QcY2myKFIxXj5SI3ce2GEipGTyEZDOPm3Z0=; b=e8TTewIghPOA6/zYkic0iNJBhk7OELQsJs1aymCoCMdCXuTt/PYM7VaYnoy1h+CF9f ilqKyIsR+zmeZvqqI8TUODY1a7/5ZDbherqIQf+abYvJHIeLICMFl40y7p/H7scoxWiZ owvEh3k1urNqwdQi0VVKzdFH/0dAGoITHehiKziMBxQCvxMJCEuOQZ+RmY1vE+xIxS/o yR3A6f/q8yW/EFohyQKP+5DuYEFZZbrMZmFgPthuX2MWB6FpMz4XucDox+oWWZsLlysU b3/264bpES8KDAPw/YTAnjwCGNOBamYBspjBP0kG70FMXAg4V/xA79ZOiwsPyPn26U/Z qoSA== X-Gm-Message-State: AOAM531KxpYr03cQgIVWxToKGECu8zR/IOfIetk4DPFAsFT6mJ3GUjsh dC4m/HVYaLVXP09v2/N2TIY9d7YtHX7Y/809Oz4obA== X-Received: by 2002:a17:90b:228f:: with SMTP id kx15mr2605248pjb.32.1611279280043; Thu, 21 Jan 2021 17:34:40 -0800 (PST) MIME-Version: 1.0 References: <20210111081821.3041587-1-morbo@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 21 Jan 2021 17:34:29 -0800 Message-ID: Subject: Re: [PATCH] pgo: add clang's Profile Guided Optimization infrastructure To: Sedat Dilek Cc: Bill Wendling , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , Clang-Built-Linux ML , Andrew Morton , Nathan Chancellor , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 6:21 PM Sedat Dilek wrote: > > Hi, > > When I looked through the code I wondered why we do not add a > "CONFIG_PGO_CLANG_PROFDATA" which can be helpful when doing the PGO > rebuild with a vmlinux.profdata. > > This introduces a "PGO_PROFDATA" to turn on/off to pass > "-fprofile-use=vmlinux.profdata" (see CFLAGS_PGO_CLANG_PROFDATA in > top-level Makefile). > > If we turn off via "PGO_PROFILE := n" in several Makefiles - we should > do the same and add "PGO_PROFDATA := n" to the same Makefiles? > > Please see the attached diff. This is a good idea; something that I brought up in initial code review (on github). Would it be ok with you to land the core first, then follow up with this suggestion? Also, AutoFDO production builds are so incredibly similar to PGO builds that I could see a possible path forward: 1. land PGO upstream 2. adds docs for AutoFDO 3. consider a config for hardcoding the location of the profiling data so that we don't need to specify it at the command line invocation of make. -- Thanks, ~Nick Desaulniers