From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C857CC48BCF for ; Sat, 12 Jun 2021 03:36:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5DA16113E for ; Sat, 12 Jun 2021 03:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230455AbhFLDhu (ORCPT ); Fri, 11 Jun 2021 23:37:50 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:43869 "EHLO mail-lf1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhFLDht (ORCPT ); Fri, 11 Jun 2021 23:37:49 -0400 Received: by mail-lf1-f49.google.com with SMTP id x24so5903216lfr.10 for ; Fri, 11 Jun 2021 20:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EyMkdbxlrBJgSTEhaFI7ifZ2pbagknX2xIpwB86SUL8=; b=Yv6m+d2dPr33vZ0NRF8Jq1HD0yS0eAc74kpDDDJfnRiPL9jRvDe8i6INFQdyFCYjCa G+Tlg5qw08/vhlmgBmJUhBjBbL8nI+DGGoqbFqQRwebkWP8ryD+tdPnZQENQhnq54/Rm tGY/P7GcNFXbe6jSC1lHRkFTaD2qFWVhzXcpxSvx9MhJYcJy2tTGSBYzYSbIVx8H6YA+ 6AfbjbYL9ZwuPbYfUZ94sk3c5bX3ElibYe89PE5XJY2tk9tYkWBI8DUZwKS4cCh0Tq1d aZASAsvdUQCPXiCex6zameO+Gu/V60McwKZuGh29mLVbmTy2UEvVV+2lhAdpWWDCG+0b ZuHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EyMkdbxlrBJgSTEhaFI7ifZ2pbagknX2xIpwB86SUL8=; b=E6mb39FV3d+9j0ICJQ/VHvVdCEnvf+Vvb+CRsymAyOM9ZT+9uLOEm9GjROyusbwPQz hKp96l7wLSkgupd/c2ScJcpss/gnNLkvLxsqcGcGt4KEm02JjWOwHyZc9I7twa7X4TJN u6eS1yLOiDyyJcUjiyJOpne/OjfjbHLCVmoWeCmr+fVbFckGcNp1T+rkyzG4S7+ASRAz xZXeLULHHWfHamBeZ7o+g5S+2qmpaBWsDF0oO+HLFGLEzIds+QgzhSrlssJS5sxDljCp fBpv4uGznqBAI++oKzXljLyR02auk9C03EBom5xDBsNBQUqEvH3qkmtyN85s0RfKK7br eoag== X-Gm-Message-State: AOAM532XzfsoC4O9i6mkBR91aj2OscutqnHndcY6EA1SgbTN+AqTHb2C PDKa14x+CYlsVJSJmUTdt4Q= X-Google-Smtp-Source: ABdhPJzWjMcmYeGkrOnl34M7y0TCBZAThkZpfxOrCFc3EBKyWzSDG/thfxagTBaQbYG1zPS9O3qsWQ== X-Received: by 2002:a05:6512:3050:: with SMTP id b16mr4490672lfb.33.1623468879682; Fri, 11 Jun 2021 20:34:39 -0700 (PDT) Received: from HyperiorArchMachine.bb.dnainternet.fi (dcx7x4ydkw9h---3prwmt-3.rev.dnainternet.fi. [2001:14ba:14f7:3c00:6897:4dff:feec:7495]) by smtp.gmail.com with ESMTPSA id f19sm943250ljn.88.2021.06.11.20.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 20:34:39 -0700 (PDT) From: Jarmo Tiitto To: Nathan Chancellor , Nick Desaulniers , clang-built-linux@googlegroups.com Cc: Jarmo Tiitto , samitolvanen@google.com, morbo@google.com, wcw@google.com, keescook@chromium.org, jeyu@kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/5] pgo: Add PGO support for module profile data Date: Sat, 12 Jun 2021 06:24:21 +0300 Message-Id: <20210612032425.11425-1-jarmo.tiitto@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series intends to extend the current Clang PGO code to support profile data from modules. Note that current PGO can and *does* instrument all kernel code, including modules, but this profile data is inaccessible. This patch series adds pgo/.profraw files from what per loaded module profile data can be read. The final profile can be generated by merging all these profile files: llvm-profdata merge --output=vmlinux.profdata vmlinux.profraw ... and then building the optimized kernel. This v2 patch series is still an bit of RFC so I'd like feedback how to do things better still. The patches itself are based on Kees/for-next/clang/features tree where I have two of my bug fix patches already in. :-) I have done some initial testing: * Booted the instrumented kernel on qemu *and* bare hardware. * Module un/loading via test_module in QEMU. * Built optimized kernel using the new profile data. Jarmo Tiitto (5): pgo: Expose module sections for clang PGO instumentation. pgo: Make serializing functions to take prf_object pgo: Wire up the new more generic code for modules pgo: Add module notifier machinery pgo: Cleanup code in pgo/fs.c include/linux/module.h | 15 +++ kernel/Makefile | 6 + kernel/module.c | 7 ++ kernel/pgo/fs.c | 241 ++++++++++++++++++++++++++++++++++------ kernel/pgo/instrument.c | 57 +++++++--- kernel/pgo/pgo.h | 85 ++++++++++---- 6 files changed, 342 insertions(+), 69 deletions(-) base-commit: 0039303120c0065f3952698597e0c9916b76ebd5 -- 2.32.0