Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp647905lqp; Wed, 12 Jun 2024 11:49:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjSi1EYwlnRzNfUqu8+RZ5DSh+YnFY1ZpNe7gGs/8GMbcYcbNAFJ8ojnhjm0XKcKB5hQ5Her1CiHGOgy3sRZNeLjViE6v8WmN1ik93gA== X-Google-Smtp-Source: AGHT+IEhIwtYobpOa9wXdEr0p778UxftbXTSHoikTsoeHs44qdH2RmTdsuAMV/f2jahWWZIw0wp4 X-Received: by 2002:a05:6a20:a10c:b0:1b7:82b4:a386 with SMTP id adf61e73a8af0-1b8a9bcfe8emr3286866637.26.1718218197671; Wed, 12 Jun 2024 11:49:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718218197; cv=pass; d=google.com; s=arc-20160816; b=KPcg3DqwfR9saMRVJQvrgIee5CHiY5rv7zYkRnSPP67a0OZ9kfql4FqJYTyemY6ydp FMleWVoIJOjPvE5NeJH5gUvt5L3kY+RIBzVj0RM3vh7gRnQCVke7286ySPdkune/IjdU OX/wimgJVIa71iMvOC4wAT9CqRwsIHwhsbSap5erzSZdfgHOpCA+fq5gCU8I287bFEC0 L5o2QGhouccFt3W8zexrcm2rzNWiPOsKH9Vsc+cA1h5ebikzEqIQVkKyY3v/mvaIN5KR c2E/ClscH+1ctgYQqccXw0zv0FCRQGigeeY4FtPmJVR05jpFGpD5vVBy4dhvn9Yf7FwJ tDlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:in-reply-to:date :dkim-signature; bh=VGJvGIe1CwvnPYERWz1EPbS43EUUz4nerE4PJ3wm8uk=; fh=KyNYLQb8Q9o6E3skt/gqmi0EoiOVpKumneQMyQikeNM=; b=PO5iM4dOaY4mUrgn9gKwTNn3X/DV9sP61WKwPGHAsSvjl6i1wjUWgBrJ7x8t2EWASs Y+0pq9VgdzqmOkwq+RL6PBmQzg02mOjXqIUvetm/HgEbnnEUjBgIEHxY9KnVwJ/ewybU H2hkIGqYdSAzFTmACViab0p9fzF7kUxNUgub7imzGb3DE6/+jyhFvWs9DP3x3aQw542/ 6bmyCu23qsDlq+iVFuEODYNO9M685d1y4/riC/fGWWPTNujwa3FuP7Yge2d+xOwyR+Mq as+4gSiTnc4VV5NGA4tTx7kOECxO/JNDlu7P48rZUIxg3k7Uz7FsQcXJFmKpgxKwQLe3 KWjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xl43Op6X; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-212085-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212085-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e5f498268csi9030837a12.599.2024.06.12.11.49.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 11:49:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212085-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xl43Op6X; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-212085-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212085-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 115B9B271BF for ; Wed, 12 Jun 2024 18:34:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EB61762E8; Wed, 12 Jun 2024 18:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xl43Op6X" 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 851C35A7A0 for ; Wed, 12 Jun 2024 18:33:30 +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=1718217212; cv=none; b=VsaDqtwQ6w7GGI8G0eDLBb3iwwPnxyt2bvy/T571m7fZmFVyYiRv5VWVv14ei/ruX366TVbb5MvHaprzM2IDH4ONMnwsKt3eqDloeI9J+rYxhcfOBf+T7JtYa9CQjNJwpWDnA5O84Mm0973STg4PNsfLrlCMUpFJOzPO5ThhPwQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718217212; c=relaxed/simple; bh=xM2OraEzCHPYA1XYxDOu/vQ1lb7fq6Wfuu93T3xy8mk=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=e4VUaTAQ4xk9cdMa62QndSjbTVt0jSiasKuw+h5jTbEO3MH5WlBXiSh0CdySaHYGmQhyZUx6k0H44ERbw/CrEri0Bs4MrWp3hw8WbY9Ksv4UssSud+sh6rWbt3AQOUieVQPLz/Ye+tHoOOSXp30cIs8jhNoe3JhULKtPDkfSIYs= 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=xl43Op6X; 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 Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6302067d548so3314467b3.0 for ; Wed, 12 Jun 2024 11:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718217209; x=1718822009; 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=VGJvGIe1CwvnPYERWz1EPbS43EUUz4nerE4PJ3wm8uk=; b=xl43Op6XK7zi980STBylFDTWGj0pMAX95odZBVnQI/iaf8cWbuaZHXRg/jAJMLv+hs UFariMYZ/EMdrxRXTtc1Kgrmlj0kJnSgkMGix72plsRAj9et8187Jva3ZnCuIXMKFkcA /biBSI6T06Ht6ImUr7O3yhHBf4ij1yQuOP9FELPJJ+ltCmUBRYS0A/To5fZlRvhkRnu9 wdJG7YB7iIx9FAzfmi2oH0glHP/VPE6XTB0aM8tkrCXpQe0t+Ve3/SzcDLG/EVIFzokC Yq+hTUM+zn/YLc9zt9zpwuNXulBdWIF++zhR2pgrcMz3i+LnWGVBVVp1H51YFT8zjXlk B96g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718217209; x=1718822009; 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=VGJvGIe1CwvnPYERWz1EPbS43EUUz4nerE4PJ3wm8uk=; b=Wz0+OMVdS6XeblMXc1xKLRVUfJcxCkeYa49dPLBW7wP0O8YJ//QFyVC0R099XItDqM iqDKgHHs7OgdeT79ekjKurKTV3a9LL/j+KqP0tcA8Nni/hCEYtsonHXHVyxOsBkFG/Oe zN43vehMtZy97aHyVhP4f51YYFkVmzJjUEG5cI/RvD9qSWI4Qnj6nUb+9HdS7K+g3vGb faJjbvzhAjKBXg7RXmZIEhC4xrvigxqnRFxtqCtnjF16jYhb8NrT5diyZghbiMPrywof 0suZXdsSTgNgZyUtygyoyen6HIc7s1PBcrRN1b4WxtUdU8bp/g3mUVUWIF4vVx3TdBcx Y4KQ== X-Forwarded-Encrypted: i=1; AJvYcCWNTOcUjiVyv6uxW2LHR5V1m7rVb50iZX9LUQVhqoeHX+Hh+Njd3FqUB1J6NuNNVeyLD7uy3qeJ30mtN8o1O9I+2A2RnTFG/mHsWUXG X-Gm-Message-State: AOJu0Ywf31zM7hZKFW8HEmlW3JSdH7iunesMtA5WrvF5AfEaYfnD8PDp 0vJiG2L3/HWap+SxbnrvZwWnlQfVy2zoA1CbAEsiV6T6kWtNd7IQnIBmjM0lrgiDEOgvY/2zVQB UGd+m6g== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:959d:4302:db0e:d12a]) (user=irogers job=sendgmr) by 2002:a05:690c:6605:b0:62c:ea0b:a44e with SMTP id 00721157ae682-62fb97e690dmr7848007b3.2.1718217209459; Wed, 12 Jun 2024 11:33:29 -0700 (PDT) Date: Wed, 12 Jun 2024 11:31:59 -0700 In-Reply-To: <20240612183205.3120248-1-irogers@google.com> Message-Id: <20240612183205.3120248-2-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240612183205.3120248-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog Subject: [PATCH v1 1/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 , Ravi Bangoria , Kees Cook , Andrei Vagin , Athira Jajeev , Oliver Upton , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, coresight@lists.linaro.org, rust-for-linux@vger.kernel.org, bpf@vger.kernel.org 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 --- 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 += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)" perf-y += util/ perf-y += arch/ -perf-y += ui/ +perf-ui-y += ui/ perf-y += scripts/ gtk-y += ui/gtk/ diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5c35c0d89306..350b65088fc1 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -425,10 +425,14 @@ endif export PERL_PATH +LIBPERF_UI_IN := $(OUTPUT)perf-ui-in.o +LIBPERF_UI := $(OUTPUT)libperf-ui.a + PERFLIBS = $(LIBAPI) $(LIBPERF) $(LIBSUBCMD) $(LIBSYMBOL) ifdef LIBBPF_STATIC PERFLIBS += $(LIBBPF) endif +PERFLIBS += $(LIBPERF_UI) # 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=pmu-events obj=pmu-events +$(LIBPERF_UI_IN): FORCE prepare + $(Q)$(MAKE) $(build)=perf-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 += setup.o -perf-y += helpline.o -perf-y += progress.o -perf-y += util.o -perf-y += hist.o -perf-y += stdio/hist.o +perf-ui-y += setup.o +perf-ui-y += helpline.o +perf-ui-y += progress.o +perf-ui-y += util.o +perf-ui-y += hist.o +perf-ui-y += stdio/hist.o CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))" -perf-$(CONFIG_SLANG) += browser.o -perf-$(CONFIG_SLANG) += browsers/ -perf-$(CONFIG_SLANG) += tui/ +perf-ui-$(CONFIG_SLANG) += browser.o +perf-ui-$(CONFIG_SLANG) += browsers/ +perf-ui-$(CONFIG_SLANG) += 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 += annotate.o -perf-y += annotate-data.o -perf-y += hists.o -perf-y += map.o -perf-y += scripts.o -perf-y += header.o -perf-y += res_sample.o +perf-ui-y += annotate.o +perf-ui-y += annotate-data.o +perf-ui-y += hists.o +perf-ui-y += map.o +perf-ui-y += scripts.o +perf-ui-y += header.o +perf-ui-y += 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 += setup.o -perf-y += util.o -perf-y += helpline.o -perf-y += progress.o +perf-ui-y += setup.o +perf-ui-y += util.o +perf-ui-y += helpline.o +perf-ui-y += progress.o -- 2.45.2.505.gda0bf45e8d-goog