From nobody Wed Dec 17 23:26:20 2025 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E991517CA0C for ; Tue, 25 Jun 2024 18:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719340958; cv=none; b=sVUgt90u8kkbhG3O8HRlCw/9zxfekEoMFF2EoyUSQnmxd6YD1H2f+VBt6jflZkLmBxThSbpRaeXLgfZniUQDYn2wXfutJVbzHubII919Cs2nAKQYVkKdDdC9pzebms2tnZJdrPSNE405xDbE5PIzLtKbtefp8pPDcWXCMyu9ta0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719340958; c=relaxed/simple; bh=XCcoFDUSO68+IaAjxY0zcTXTu1PIqW7TvqckZysWY14=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=QvMZ2Ld2wS5Ie52YprGQ27HMYgJjnMxLennfiW2g3yaiOhUSL3AOuYa5zNSaG54TECKKQCFET81Np4QLwBUG4Xejqm9FObuz+0ta+41jrqGfiOYRZObMiH+ncrtcv6Wn2YqnaQgKGTnMhR+B5p0Osj9Z8T/i9UhZBRc0KzdJSKc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=S+OSqN1j; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="S+OSqN1j" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-64501d163b4so58368337b3.1 for ; Tue, 25 Jun 2024 11:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719340956; x=1719945756; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=nNKhk3i6ZR127Ku5IVQOBYSjQPa/zZMsU20LfXii9LU=; b=S+OSqN1j/qvLashEyPjdZQmX6vF2cMZQLGy60cP6tIa/Dh/F9fzmujZAiAi2XlFatY gRoV0AGob/tLQXN9ZHSFfsCtpPejfiNqWlFa+PYLVB7WsW9qktApwN2+JncHgfPlZULV RPW92UXJk6TqagseLh5qW3cwTmN8PpwWrrkJjiG+habfNLmLzVlM8WpzXA8/uBO5ffI/ +3P8knhTcPryVAYvAVVatDBz+5EGinLM9egAoFW04XZQC4k9pb7U0i+wwHXXa3CP2cw5 5OuCfF6vtzEiCSEUlPoMA6c9ckEPGsHaDwmWXzyHWd/fXiE+4l80LtKf6oXDXRoIZQwj r38w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719340956; x=1719945756; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nNKhk3i6ZR127Ku5IVQOBYSjQPa/zZMsU20LfXii9LU=; b=vV185WuAJNiGi33kFA9JcZXr7E96RnYNBT1Azc5/9CPEEwIKBJEWuY/h2C9jsRmVJJ /S3XhHkJPQg8Preo+VcaHHwYf3WiR3FJmKiwrgbJxJpaNLVHB7EsmIAhfwis1GoF2nVD 16rZ53UNNmcBr9gI8Nufb1v1Jla7IAmxGL4skwXVycYdnrS52uL8u69W1+3RUl4dSuSU 1Vtp3gVg/ks3NQJ6vL0r7e8U3kIUYBUPBtHCkTmEIKEe6CN4T85/KzbYdkX5URgbjWPw z2ev+T6HNMjAq6FKCTIbwi5a3+evGDl7jLz7giDu5MBNBKsdqjBVkQgki2zBQWAtNo// f6PA== X-Forwarded-Encrypted: i=1; AJvYcCVIIbRqRUjqySKLzNofwffkx20Rb3e8Y1IN6i6mbLmROnQNroT8Z75x5ggQ4Wq6yrWc5EQObS3bAqVPm8nCx7+YDrH9EPzbZgbKhp57 X-Gm-Message-State: AOJu0Yy2wM+Vryu7Fvfsw3glxykauyMi8XhSi2nmTsXYeysVyIXrYS6B AJjkLl4FCYVfkLqi4M2Jbc6TwDTptx7O96jbrmz7enWfWOCikTcc4XYwigQk0zvGuwesvucP950 jzTMVEQ== X-Google-Smtp-Source: AGHT+IE2knK+SqiP/3MRcV2ZoKoDhmC7Z51zU81w59tOSVa7+OtakO9/inMolJXvN6wS2iet4Qv6IJqkT1eX X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:b4cb:a52b:f9ea:8678]) (user=irogers job=sendgmr) by 2002:a05:690c:6f08:b0:62a:2a39:ccd9 with SMTP id 00721157ae682-643ad9aa0bfmr5402067b3.6.1719340955895; Tue, 25 Jun 2024 11:42:35 -0700 (PDT) Date: Tue, 25 Jun 2024 11:42:19 -0700 In-Reply-To: <20240625184224.929018-1-irogers@google.com> Message-Id: <20240625184224.929018-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240625184224.929018-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.741.gdbec12cfda-goog Subject: [PATCH v4 2/7] perf ui: Make ui its own library From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nick Terrell , Andrei Vagin , Kees Cook , Oliver Upton , Ze Gao , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Make the ui code its own library. This is done to avoid compiling code twice, once for the perf tool and once for the perf python module. Signed-off-by: Ian Rogers Reviewed-by: James Clark --- tools/perf/Build | 2 +- tools/perf/Makefile.perf | 10 ++++++++++ tools/perf/ui/Build | 18 +++++++++--------- tools/perf/ui/browsers/Build | 14 +++++++------- tools/perf/ui/tui/Build | 8 ++++---- 5 files changed, 31 insertions(+), 21 deletions(-) diff --git a/tools/perf/Build b/tools/perf/Build index b0cb7ad8e6ac..16ed1357202b 100644 --- a/tools/perf/Build +++ b/tools/perf/Build @@ -55,7 +55,7 @@ CFLAGS_builtin-report.o +=3D -DDOCDIR=3D"BUILD_STR($(s= rcdir_SQ)/Documentation)" =20 perf-y +=3D util/ perf-y +=3D arch/ -perf-y +=3D ui/ +perf-ui-y +=3D ui/ perf-y +=3D scripts/ =20 gtk-y +=3D ui/gtk/ diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index acc41a6717db..c5a027381c55 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -425,10 +425,14 @@ endif =20 export PERL_PATH =20 +LIBPERF_UI_IN :=3D $(OUTPUT)perf-ui-in.o +LIBPERF_UI :=3D $(OUTPUT)libperf-ui.a + PERFLIBS =3D $(LIBAPI) $(LIBPERF) $(LIBSUBCMD) $(LIBSYMBOL) ifdef LIBBPF_STATIC PERFLIBS +=3D $(LIBBPF) endif +PERFLIBS +=3D $(LIBPERF_UI) =20 # We choose to avoid "if .. else if .. else .. endif endif" # because maintaining the nesting to match is a pain. If @@ -729,6 +733,12 @@ $(PERF_IN): prepare FORCE $(PMU_EVENTS_IN): FORCE prepare $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=3Dpmu-events obj= =3Dpmu-events =20 +$(LIBPERF_UI_IN): FORCE prepare + $(Q)$(MAKE) $(build)=3Dperf-ui + +$(LIBPERF_UI): $(LIBPERF_UI_IN) + $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $< + $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) \ $(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@ diff --git a/tools/perf/ui/Build b/tools/perf/ui/Build index 6b6d7143a37b..d2ecd9290600 100644 --- a/tools/perf/ui/Build +++ b/tools/perf/ui/Build @@ -1,12 +1,12 @@ -perf-y +=3D setup.o -perf-y +=3D helpline.o -perf-y +=3D progress.o -perf-y +=3D util.o -perf-y +=3D hist.o -perf-y +=3D stdio/hist.o +perf-ui-y +=3D setup.o +perf-ui-y +=3D helpline.o +perf-ui-y +=3D progress.o +perf-ui-y +=3D util.o +perf-ui-y +=3D hist.o +perf-ui-y +=3D stdio/hist.o =20 CFLAGS_setup.o +=3D -DLIBDIR=3D"BUILD_STR($(LIBDIR))" =20 -perf-$(CONFIG_SLANG) +=3D browser.o -perf-$(CONFIG_SLANG) +=3D browsers/ -perf-$(CONFIG_SLANG) +=3D tui/ +perf-ui-$(CONFIG_SLANG) +=3D browser.o +perf-ui-$(CONFIG_SLANG) +=3D browsers/ +perf-ui-$(CONFIG_SLANG) +=3D tui/ diff --git a/tools/perf/ui/browsers/Build b/tools/perf/ui/browsers/Build index 2608b5da3167..a07489e44765 100644 --- a/tools/perf/ui/browsers/Build +++ b/tools/perf/ui/browsers/Build @@ -1,7 +1,7 @@ -perf-y +=3D annotate.o -perf-y +=3D annotate-data.o -perf-y +=3D hists.o -perf-y +=3D map.o -perf-y +=3D scripts.o -perf-y +=3D header.o -perf-y +=3D res_sample.o +perf-ui-y +=3D annotate.o +perf-ui-y +=3D annotate-data.o +perf-ui-y +=3D hists.o +perf-ui-y +=3D map.o +perf-ui-y +=3D scripts.o +perf-ui-y +=3D header.o +perf-ui-y +=3D res_sample.o diff --git a/tools/perf/ui/tui/Build b/tools/perf/ui/tui/Build index f916df33a1a7..2ac058ad1a61 100644 --- a/tools/perf/ui/tui/Build +++ b/tools/perf/ui/tui/Build @@ -1,4 +1,4 @@ -perf-y +=3D setup.o -perf-y +=3D util.o -perf-y +=3D helpline.o -perf-y +=3D progress.o +perf-ui-y +=3D setup.o +perf-ui-y +=3D util.o +perf-ui-y +=3D helpline.o +perf-ui-y +=3D progress.o --=20 2.45.2.741.gdbec12cfda-goog