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=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 F1C78C43332 for ; Fri, 12 Mar 2021 09:56:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB09D6508C for ; Fri, 12 Mar 2021 09:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233192AbhCLJ4E (ORCPT ); Fri, 12 Mar 2021 04:56:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbhCLJzp (ORCPT ); Fri, 12 Mar 2021 04:55:45 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78003C061574; Fri, 12 Mar 2021 01:55:45 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lKeW0-00F7m8-Gm; Fri, 12 Mar 2021 10:55:28 +0100 From: Johannes Berg To: linux-kernel@vger.kernel.org, linux-um@lists.infradead.org Cc: Jessica Yu , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH 0/6] um: fix up CONFIG_GCOV support Date: Fri, 12 Mar 2021 10:55:20 +0100 Message-Id: <20210312095526.197739-1-johannes@sipsolutions.net> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_GCOV is fairly useful for ARCH=um (e.g. with kunit, though my main use case is a bit different) since it writes coverage data directly out like a normal userspace binary. Theoretically, that is. Unfortunately, it's broken in multiple ways today: 1) it doesn't like, due to 'mangle_path' in seq_file, and the only solution to that seems to be to rename our symbol, but that's not so bad, and "mangle_path" sounds very generic anyway, which it isn't quite 2) gcov requires exit handlers to write out the data, and those are never called for modules, config CONSTRUCTORS exists for init handlers, so add CONFIG_MODULE_DESTRUCTORS here that we can then select in ARCH=um 3) As mentioned above, gcov requires init/exit handlers, but they aren't linked into binary properly, that's easy to fix. 4) gcda files are then written, so .gitignore them 5) it's not always useful to create coverage data for the *entire* kernel, so I've split off CONFIG_GCOV_BASE from CONFIG_GCOV to allow option in only in some places, which of course requires adding the necessary "subdir-cflags" or "CFLAGS_obj" changes in the places where it's desired, as local patches. None of these changes (hopefully) seem too controversional, biggest are the module changes but obviously they compile to nothing if the architecture doesn't WANT_MODULE_DESTRUCTORS. Any thoughts on how to merge this? The seq_file/.gitignore changes are independent at least code-wise, though of course it only works with the seq_file changes (.gitignore doesn't matter, of course), while the module changes are a requirement for the later ARCH=um patches since the Kconfig symbol has to exist. Perhaps I can just get ACKs on all the patches and then they can go through the UML tree? Thanks, johannes