From patchwork Wed Jun 25 20:54:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alexis_Lothor=C3=A9?= X-Patchwork-Id: 2102793 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4bSF9j5Rydz1ymW for ; Thu, 26 Jun 2025 07:21:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1C4E56165F; Wed, 25 Jun 2025 21:21:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OiDbkQuGhxLT; Wed, 25 Jun 2025 21:21:22 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8BF4361657 Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 8BF4361657; Wed, 25 Jun 2025 21:21:22 +0000 (UTC) X-Original-To: buildroot@buildroot.org Delivered-To: buildroot@buildroot.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 7FE8043F for ; Wed, 25 Jun 2025 21:21:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 718CD84EF0 for ; Wed, 25 Jun 2025 21:21:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id RtBvA6hRAGFU for ; Wed, 25 Jun 2025 21:21:19 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=217.70.178.249; helo=mslow3.mail.gandi.net; envelope-from=alexis.lothore@bootlin.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 0829384EEB DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0829384EEB Received: from mslow3.mail.gandi.net (mslow3.mail.gandi.net [217.70.178.249]) by smtp1.osuosl.org (Postfix) with ESMTPS id 0829384EEB for ; Wed, 25 Jun 2025 21:21:18 +0000 (UTC) Received: from relay16.mail.gandi.net (relay16.mail.gandi.net [217.70.178.236]) by mslow3.mail.gandi.net (Postfix) with ESMTP id B4E20583736 for ; Wed, 25 Jun 2025 20:54:20 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 17B2444A51; Wed, 25 Jun 2025 20:54:13 +0000 (UTC) Date: Wed, 25 Jun 2025 22:54:01 +0200 MIME-Version: 1.0 Message-Id: <20250625-perf_libtraceevent-v1-1-0bf7620bc6c9@bootlin.com> X-B4-Tracking: v=1; b=H4sIAOhhXGgC/x3MSQqAMBAF0atIrw3E4HwVEXH40QaJ0gkiiHc3u HyLqoc8hOGpTR4SXOz5cBFZmtC8jW6F4iWajDaFLk2hTogddp6CjDNwwQWVVchLwNS20RTDU2D 5/qdd/74f04T7XWQAAAA= X-Change-ID: 20250625-perf_libtraceevent-17e46ee28f90 To: buildroot@buildroot.org Cc: Thomas Petazzoni , =?utf-8?q?Alexis_Lothor?= =?utf-8?q?=C3=A9?= , Luca Ceresoli , Olivier Benjamin X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvfeejkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkffvvefosehtkeertdertdejnecuhfhrohhmpeetlhgvgihishcunfhothhhohhrrocuoegrlhgvgihishdrlhhothhhohhrvgessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnheptedukedvffeiheeuuefgudejgfdtvdegkedvtdeiffffleevtdegffejkeejlefgnecuffhomhgrihhnpegsohhothhlihhnrdgtohhmnecukfhppedvrgdtvdemkeegvdekmehfleegtgemvgdttdemmehfkeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddvmeekgedvkeemfhelgegtmegvtddtmeemfhekhedphhgvlhhopegludelvddrudeikedruddrudeljegnpdhmrghilhhfrhhomheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeehpdhrtghpthhtohepohhlihhvihgvrhdrsggvnhhjrghmihhnsegsohhothhlihhnrdgtohhmpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepsghuihhlughrohhothessghuihhlughrohhothdrohhrghdpr hgtphhtthhopehluhgtrgdrtggvrhgvshholhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtoheprghlvgigihhsrdhlohhthhhorhgvsegsohhothhlihhnrdgtohhm X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1750884854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Yj8xLv0qy6B9wUJVcNFPVL2T8hEPpJOWakj55gs3gc=; b=FjOnhGi6MSTb0tD9ePIL6PSPi5Z73gJozAJUQXVV35kPS9L/zxDxs70rbpNqaFGtErRGKh koyIdUynE3bIMVkfLY9lFVNYhNudwsskBtO1sV/hY2dKrdDNb2ui3trWdvVns0ct3giWSH al/iNz0uYaSzTEhrF6vc1uMykhpuk++O6UBA90D5aJ/7dRLHQ39rqyCIK/2bC9fRbS2pVH NglEZPov4Wnv1PxtcgQ6ZkgqLBXGgynb9GZxdKcGYILzEsbSCXSZo9p5Xdm+2JqjKYGLSB 2V8ys/oRUNS+j4GpRqeBmxVyU4lSgxP0XKwS/8vHxQiBsh5cdGR9oQKsV2zDtw== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=FjOnhGi6 Subject: [Buildroot] [PATCH] package/linux-tools: perf: build with libtraceevent support when it is selected X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Alexis_Lothor=C3=A9_via_buildroot?= From: =?utf-8?q?Alexis_Lothor=C3=A9?= Reply-To: =?utf-8?q?Alexis_Lothor=C3=A9?= Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" When trying to perform a custom uprobe recording on a target with perf built by buildroot, the recording step fails as perf can not record uprobes without libtraceevent support: $ perf probe -x linked_list insert_name index Target program is compiled without optimization. Skipping prologue. Probe on address 0x808 to force probing at the function entry. Added new event: probe_linked_list:insert_name (on insert_name in /root/gdb/linked_list with index) perf is not linked with libtraceevent, to use the new probe you can use tracefs: cd /sys/kernel/tracing/ echo 1 > events/probe_linked_list/insert_name/enable echo 1 > tracing_on cat trace_pipe Before removing the probe, echo 0 > events/probe_linked_list/insert_name/enable $ perf record -e probe_linked_list:insert_name ./linked_list event syntax error: 'probe_linked_list:insert_name' \___ unsupported tracepoint libtraceevent is necessary for tracepoint support Run 'perf list' for a list of valid events Usage: perf record [] [] or: perf record [] -- [] -e, --event event selector. use 'perf list' to list available events libtraceevent support for perf has been disabled with commit b4ab45a5c1db ("package/linux-tools: disable libtracevent detection") because there was no libtraceevent package in buildroot to replace the former libtraceevent removed from the kernel sources. Since then, commit 1474f1b34b17 ("package/libtraceevent: new package") has introduced a libtraceevent package. We can then expose again the possibility to build perf with libtraceevent support. Make buildroot perf makefile detect if libtraceevent package has been enabled, and if so, allow to build perf with libtraceevent support. Signed-off-by: Alexis Lothoré --- To: buildroot@buildroot.org Cc: Thomas Petazzoni Cc: Luca Ceresoli Cc: Olivier Benjamin --- It is worth noting that there is a bug in perf makefile kernel that affects many kernel versions (up to 6.10) and that prevents perf from building correctly when enabling libtraceevent support (see 440cf77625e3 ("perf: build: Setup PKG_CONFIG_LIBDIR for cross compilation") in linux). Should the libtraceevent then be explicitely enabled by the user, rather than automatically enabling it when libtraceevent package is selected ? --- package/linux-tools/linux-tool-perf.mk.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- base-commit: f28f34e200bbadf0aea32110c72f7199e65fb0b9 change-id: 20250625-perf_libtraceevent-17e46ee28f90 Best regards, diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in index d67318571aa4deefde5b38effe1ade0b87f4627b..1e19ee7f1c4e46d210c079d796f9461f2bfaae08 100644 --- a/package/linux-tools/linux-tool-perf.mk.in +++ b/package/linux-tools/linux-tool-perf.mk.in @@ -28,7 +28,6 @@ PERF_MAKE_FLAGS = \ NO_LIBPERL=1 \ NO_LIBPYTHON=1 \ NO_LIBBIONIC=1 \ - NO_LIBTRACEEVENT=1 \ NO_SHELLCHECK=1 # We need to pass an argument to ld for setting the emulation when @@ -128,6 +127,12 @@ PERF_MAKE_FLAGS += CORESIGHT=1 # bare "ifdef CORESIGHT" constructs. endif +ifeq ($(BR2_PACKAGE_LIBTRACEEVENT),y) +PERF_DEPENDENCIES += libtraceevent +else +PERF_MAKE_FLAGS += NO_LIBTRACEEVENT=1 +endif + # We really do not want to build the perf documentation, because it # has stringent requirement on the documentation generation tools, # like xmlto and asciidoc), which may be lagging behind on some