From patchwork Mon Apr 10 16:25:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13206509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15784C77B61 for ; Mon, 10 Apr 2023 16:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sX6xUmCxwSINa9IRKnMDYlcJEUQ74kob3o61tnpxnpk=; b=fUEYH+R/K+Qd0z 5COX8U5ytwZ7U+1cJmecuPYavzTKOZ5NacBF+3p1cpqefO8HoZTNxALYHQ9rcYRW3Sjzi+jPVLGeB c16yfGeW9zI3zqD+YlOFQa+OFzixbjv+8+sAoK7kwRkg/CN34QCVkcS9NlGdC8YxwPd5ghyTl65BS jB5HX+J87BYbkAfWQ+SQNtUyV6DIiSU/HJpn09gLPnCy3JdV5TAYOM023rhS+kGyvfn/ZCcErHWrg XjRjDdMxgQW5BTtZnfuRXIdSjD9AVX+MNB9fSWIvR16f/YgaLQLvriGTXicrjye8ECR0V70DbNYy4 x7TiG+HBxyBlE3FXIjWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pluKi-00FXL8-2x; Mon, 10 Apr 2023 16:25:32 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pluKf-00FXKO-1g for linux-arm-kernel@lists.infradead.org; Mon, 10 Apr 2023 16:25:30 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54ee1fd7876so59681077b3.23 for ; Mon, 10 Apr 2023 09:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1681143928; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=RcVP8+wNKMP0CI3wP35gWRmxMX+BaZG32dn9a3gYrZQ=; b=Zvv8HjASFhPiBTye49dPmiMVH9Hvm0QhNMMQeabfTq+HE9ide4xtEfCXnRphOqS/rY FKid5gir6jJMpaJh2LTaIPZoY9buf8vUako7KpKqH8cVXQC1f+qFakA5r6UCnJZvPOQP NU/MjKkiLGxuGgM7pCe0c87Zo74/v0OFIFiBvlAFpu5GFsGd6hieEOnEVjmv+kPiim7U w1D9RoShQYxHQWxWpgD3HEN67JLaiSOKkMmYWE/ZiGj2gjm6DO7GOjdoSywkI+yQ80xO 81rPJOGfcmcwcojWDNBieoGQJzSR3MbWDt46rQ7BCk/HrJN/Ehy4AfhPBmWaDzcJxaSi YF8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681143928; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RcVP8+wNKMP0CI3wP35gWRmxMX+BaZG32dn9a3gYrZQ=; b=4a1ynEXv9772g9Pf/dw0k3QH0B66b8CPDkdqkPn8aSaj/Mh1OUCG+2a5UaXHD9U1Eq BNLKz0jcOsqW2IHRR0oPWAUsVbd9+2KpdGfmKuOs0xZH1/hwdJMzMZHhOXx7yaOkKZEt +CMInBmVQ4lVTUsN3mWyVKw26VNzS/g+/CjsbXatYpaj3GkbjOTn4ZSuSTrpVgz985nZ xVT95HNc9eZAdVyywzXyEQ6qLu+FXDS4yWQRhPNweV/5Cz5Y4TD3e0loML6a8lq9TNdV a2yVx0M5oSO0dGeJHYEQtD9GglalcDA+jD6ElhpdKfGx0tv7om3x8Vb6y6qagKqicuVZ AU/g== X-Gm-Message-State: AAQBX9e/jpn7V+Utt53XTcUK0zMm0L5Bk/mYvtE97ZPyFdH5UwuZFCoH OF5bJqAsDf4WbMbNLiM1PaBJLhjthTe0 X-Google-Smtp-Source: AKy350YrUffc5HNnBrjR/AifueLJVxPtOYiAldS44HM/yoFhiQXR9vaiO5q0DqFU+ja4kUqZ+Ew19sEYD6rJ X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:fc51:6a03:541d:a18d]) (user=irogers job=sendgmr) by 2002:a25:cfcf:0:b0:b2f:bdc9:2cdc with SMTP id f198-20020a25cfcf000000b00b2fbdc92cdcmr7286529ybg.7.1681143928302; Mon, 10 Apr 2023 09:25:28 -0700 (PDT) Date: Mon, 10 Apr 2023 09:25:05 -0700 Message-Id: <20230410162511.3055900-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Subject: [PATCH v2 0/6] Refactor definitions out of perf.h From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Mathieu Poirier , Suzuki K Poulose , Kan Liang , Raul Silvera , Athira Rajeev , Ravi Bangoria , Florian Fischer , Rob Herring , Xing Zhengjun , Sean Christopherson , Chengdong Li , Denis Nikitin , " =?utf-8?q?Martin_Li=C5=A1ka?= " , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230410_092529_584162_6731D2FF X-CRM114-Status: GOOD ( 13.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move definitions and declarations for greater consistency. The original motivation was, when fuzzing something like parse-events, having the main function in perf.c alongside global variables like input_name means that input_name must be redeclared with the fuzzer function's main. However, as the fuzzer is using the tools/perf code as a library this causes backward linking reference that the linker may warn about. v2. Remove references from commit messages about linking, as Adrian points out we could solve that problem with #ifdefs. Ian Rogers (6): perf ui: Move window resize signal functions perf usage: Move usage strings perf header: Move perf_version_string declaration perf version: Use regular verbose flag perf util: Move input_name to util perf util: Move perf_guest/host declarations tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-buildid-list.c | 2 +- tools/perf/builtin-c2c.c | 2 +- tools/perf/builtin-data.c | 2 +- tools/perf/builtin-diff.c | 2 +- tools/perf/builtin-evlist.c | 2 +- tools/perf/builtin-help.c | 1 + tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-kvm.c | 1 + tools/perf/builtin-kwork.c | 2 +- tools/perf/builtin-mem.c | 2 +- tools/perf/builtin-sched.c | 2 +- tools/perf/builtin-stat.c | 2 +- tools/perf/builtin-timechart.c | 2 +- tools/perf/builtin-version.c | 7 +++---- tools/perf/builtin.h | 3 --- tools/perf/perf.c | 27 +-------------------------- tools/perf/perf.h | 9 --------- tools/perf/ui/browsers/hists.c | 2 +- tools/perf/ui/hist.c | 2 +- tools/perf/ui/setup.c | 19 +++++++++++++++++++ tools/perf/ui/tui/setup.c | 1 - tools/perf/ui/ui.h | 3 +++ tools/perf/util/cs-etm.c | 1 + tools/perf/util/event.c | 2 +- tools/perf/util/evlist.c | 1 + tools/perf/util/header.h | 2 ++ tools/perf/util/parse-events.c | 2 +- tools/perf/util/session.c | 2 +- tools/perf/util/top.c | 2 +- tools/perf/util/usage.c | 6 ++++++ tools/perf/util/util.c | 2 ++ tools/perf/util/util.h | 8 ++++++++ 33 files changed, 66 insertions(+), 61 deletions(-)