[meta-oe] perfetto: initial add commit

Message ID 20220317145937.217432-1-f_l_k@t-online.de
State Superseded
Headers show
Series [meta-oe] perfetto: initial add commit | expand

Commit Message

Markus Volk March 17, 2022, 2:59 p.m. UTC
mesa 22.0.0 supports profiling GPU acceleration using google perfetto

This adds a recipe for it

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 ...meson.build-add-pc-file-build-shared.patch | 45 +++++++++++++++++++
 .../recipes-devtools/perfetto/perfetto_git.bb | 28 ++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/perfetto/perfetto/0001-meson.build-add-pc-file-build-shared.patch
 create mode 100644 meta-oe/recipes-devtools/perfetto/perfetto_git.bb

Patch

diff --git a/meta-oe/recipes-devtools/perfetto/perfetto/0001-meson.build-add-pc-file-build-shared.patch b/meta-oe/recipes-devtools/perfetto/perfetto/0001-meson.build-add-pc-file-build-shared.patch
new file mode 100644
index 000000000..46e3ec9ec
--- /dev/null
+++ b/meta-oe/recipes-devtools/perfetto/perfetto/0001-meson.build-add-pc-file-build-shared.patch
@@ -0,0 +1,45 @@ 
+From f70ed62ce4a42525c9738455966bec2ed9647568 Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Thu, 17 Mar 2022 15:44:23 +0100
+Subject: [PATCH] meson.build: add pc file; build shared
+
+---
+ meson.build | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 06015141c..74fe2348f 100644
+--- a/meson.build
++++ b/meson.build
+@@ -19,6 +19,7 @@
+ project(
+     'perfetto',
+     ['c','cpp'],
++    version : '24.2',
+     default_options: ['c_std=c99', 'cpp_std=c++11']
+ )
+ 
+@@ -30,7 +31,7 @@ endif
+ 
+ dep_threads = dependency('threads')
+ 
+-lib_perfetto = static_library(
++lib_perfetto = shared_library(
+     'perfetto',
+     sources: 'sdk/perfetto.cc',
+     dependencies: dep_threads,
+@@ -43,3 +44,11 @@ dep_perfetto = declare_dependency(
+     link_with: lib_perfetto,
+     include_directories: inc_perfetto,
+ )
++
++pkgconfig = import('pkgconfig')
++pkgconfig.generate(
++    libraries:    lib_perfetto,
++    version:      meson.project_version(),
++    filebase:     meson.project_name(),
++    name:         meson.project_name(),
++    description: 'Perfetto Tracing Tool')
+-- 
+2.25.1
+
diff --git a/meta-oe/recipes-devtools/perfetto/perfetto_git.bb b/meta-oe/recipes-devtools/perfetto/perfetto_git.bb
new file mode 100644
index 000000000..07b1a0b4b
--- /dev/null
+++ b/meta-oe/recipes-devtools/perfetto/perfetto_git.bb
@@ -0,0 +1,28 @@ 
+SUMMARY = "Perfetto - System profiling, app tracing and trace analysis"
+HOMEPAGE = "https://github.com/google/perfetto"
+BUGTRACKER = "https://github.com/google/perfetto/issues"
+LICENSE = "Apache-2.0"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f87516e0b698007e9e75a1fe1012b390"
+
+SRC_URI = " \
+	git://github.com/google/perfetto.git;protocol=https;branch=releases/v24.x \
+	file://0001-meson.build-add-pc-file-build-shared.patch \
+"
+
+S = "${WORKDIR}/git"
+PV = "24.2"
+SRCREV = "7cb228c16d69aee297a106ad3ccc7461fa0b8045"
+
+inherit meson
+
+do_install:append() {
+	install -d ${D}${includedir}
+	install -m 0664 ${S}/sdk/perfetto.h ${D}${includedir}
+}
+
+FILES:${PN} = "${includedir} ${libdir}"
+FILES:${PN}-dev = ""
+
+BBCLASSEXTEND = "native nativesdk"
+