summaryrefslogtreecommitdiff
path: root/meta-unit-profiling
diff options
context:
space:
mode:
authorunitexe <unitexe70@gmail.com>2026-01-17 00:53:15 -0600
committerunitexe <unitexe70@gmail.com>2026-01-17 15:07:54 -0600
commit4982353c696256dfa130f5d009b4271fe34112ac (patch)
tree91a4751ff286c9a59728289cea2512f64388c64c /meta-unit-profiling
parentdfb3c4808b38f7c5f79957f0b75bc497362c2cc6 (diff)
Introduce meta-unit-profiling
- Additional profiling commands for busybox - Support systemd-bootchart - Enable kernel stats (needed for systemd-bootchart)
Diffstat (limited to 'meta-unit-profiling')
-rw-r--r--meta-unit-profiling/LICENSE21
-rw-r--r--meta-unit-profiling/conf/layer.conf18
-rw-r--r--meta-unit-profiling/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend3
-rw-r--r--meta-unit-profiling/recipes-core/busybox/busybox/iostat.cfg1
-rw-r--r--meta-unit-profiling/recipes-core/busybox/busybox/mpstat.cfg1
-rw-r--r--meta-unit-profiling/recipes-core/busybox/busybox_%.bbappend4
-rw-r--r--meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-profiling.bb11
-rw-r--r--meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-systemd-profiling.bb8
-rw-r--r--meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/files/unit.conf4
-rw-r--r--meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/systemd-bootchart-conf.bb13
-rw-r--r--meta-unit-profiling/recipes-kernel/linux/files/stats.cfg1
-rw-r--r--meta-unit-profiling/recipes-kernel/linux/linux-yocto_%.bbappend3
-rw-r--r--meta-unit-profiling/recipes-kernel/linux/unit-profiling.inc2
13 files changed, 90 insertions, 0 deletions
diff --git a/meta-unit-profiling/LICENSE b/meta-unit-profiling/LICENSE
new file mode 100644
index 0000000..52686ad
--- /dev/null
+++ b/meta-unit-profiling/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 Closed Circuit Consulting
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/meta-unit-profiling/conf/layer.conf b/meta-unit-profiling/conf/layer.conf
new file mode 100644
index 0000000..1b980ef
--- /dev/null
+++ b/meta-unit-profiling/conf/layer.conf
@@ -0,0 +1,18 @@
+BBPATH .= ":${LAYERDIR}"
+
+BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "unit-profiling-layer"
+BBFILE_PATTERN_unit-profiling-layer := "^${LAYERDIR}/"
+BBFILE_PRIORITY_unit-profiling-layer = "10"
+
+LAYERDEPENDS_unit-profiling-layer = "core openembedded-layer"
+
+LAYERSERIES_COMPAT_unit-profiling-layer = "whinlatter"
+
+UNIT_PROFILING_LAYERDIR = "${LAYERDIR}"
+
+BBFILES_DYNAMIC += " \
+ raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bb \
+ raspberrypi:${LAYERDIR}/dynamic-layers/raspberrypi/*/*/*.bbappend \
+"
diff --git a/meta-unit-profiling/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-unit-profiling/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
new file mode 100644
index 0000000..20056f9
--- /dev/null
+++ b/meta-unit-profiling/dynamic-layers/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${UNIT_PROFILING_LAYERDIR}/recipes-kernel/linux/files:"
+
+require recipes-kernel/linux/unit-profiling.inc
diff --git a/meta-unit-profiling/recipes-core/busybox/busybox/iostat.cfg b/meta-unit-profiling/recipes-core/busybox/busybox/iostat.cfg
new file mode 100644
index 0000000..3300ba8
--- /dev/null
+++ b/meta-unit-profiling/recipes-core/busybox/busybox/iostat.cfg
@@ -0,0 +1 @@
+CONFIG_IOSTAT=y
diff --git a/meta-unit-profiling/recipes-core/busybox/busybox/mpstat.cfg b/meta-unit-profiling/recipes-core/busybox/busybox/mpstat.cfg
new file mode 100644
index 0000000..9328d61
--- /dev/null
+++ b/meta-unit-profiling/recipes-core/busybox/busybox/mpstat.cfg
@@ -0,0 +1 @@
+CONFIG_MPSTAT=y
diff --git a/meta-unit-profiling/recipes-core/busybox/busybox_%.bbappend b/meta-unit-profiling/recipes-core/busybox/busybox_%.bbappend
new file mode 100644
index 0000000..fac7c9a
--- /dev/null
+++ b/meta-unit-profiling/recipes-core/busybox/busybox_%.bbappend
@@ -0,0 +1,4 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI:append = " file://mpstat.cfg"
+SRC_URI:append = " file://iostat.cfg"
diff --git a/meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-profiling.bb b/meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-profiling.bb
new file mode 100644
index 0000000..6682424
--- /dev/null
+++ b/meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-profiling.bb
@@ -0,0 +1,11 @@
+SUMMARY = "Profiling packages"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+# Performance analysis
+RDEPENDS:${PN}:append = " procps"
+RDEPENDS:${PN}:append = " sysstat"
+
+# Performance testing
+RDEPENDS:${PN}:append = " stress-ng"
diff --git a/meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-systemd-profiling.bb b/meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-systemd-profiling.bb
new file mode 100644
index 0000000..6726266
--- /dev/null
+++ b/meta-unit-profiling/recipes-core/packagegroups/packagegroup-unit-systemd-profiling.bb
@@ -0,0 +1,8 @@
+SUMMARY = "Systemd profiling packages"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS:${PN}:append = " systemd-bootchart"
+RDEPENDS:${PN}:append = " systemd-bootchart-conf"
+RDEPENDS:${PN}:append = " systemd-analyze"
diff --git a/meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/files/unit.conf b/meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/files/unit.conf
new file mode 100644
index 0000000..62fb8c1
--- /dev/null
+++ b/meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/files/unit.conf
@@ -0,0 +1,4 @@
+[Bootchart]
+PlotMemoryUsage=yes
+PlotEntropyGraph=yes
+Cmdline=yes
diff --git a/meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/systemd-bootchart-conf.bb b/meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/systemd-bootchart-conf.bb
new file mode 100644
index 0000000..31a1f5d
--- /dev/null
+++ b/meta-unit-profiling/recipes-devtools/systemd-bootchart-conf/systemd-bootchart-conf.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Systemd bootchart config drop-in"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${UNIT_PROFILING_LAYERDIR}/LICENSE;md5=a77c12e0c0e8a14cebb1494195720ccc"
+
+SRC_URI = "file://unit.conf"
+
+S = "${UNPACKDIR}"
+
+do_install() {
+ install -D -p -m0644 ${UNPACKDIR}/unit.conf ${D}${sysconfdir}/systemd/bootchart.conf.d/unit.conf
+}
+
+FILES:${PN} = "${sysconfdir}/systemd/bootchart.conf.d/unit.conf"
diff --git a/meta-unit-profiling/recipes-kernel/linux/files/stats.cfg b/meta-unit-profiling/recipes-kernel/linux/files/stats.cfg
new file mode 100644
index 0000000..a9ef3bd
--- /dev/null
+++ b/meta-unit-profiling/recipes-kernel/linux/files/stats.cfg
@@ -0,0 +1 @@
+CONFIG_SCHEDSTATS=y
diff --git a/meta-unit-profiling/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-unit-profiling/recipes-kernel/linux/linux-yocto_%.bbappend
new file mode 100644
index 0000000..ddd34ab
--- /dev/null
+++ b/meta-unit-profiling/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+require unit-profiling.inc
diff --git a/meta-unit-profiling/recipes-kernel/linux/unit-profiling.inc b/meta-unit-profiling/recipes-kernel/linux/unit-profiling.inc
new file mode 100644
index 0000000..113ab23
--- /dev/null
+++ b/meta-unit-profiling/recipes-kernel/linux/unit-profiling.inc
@@ -0,0 +1,2 @@
+# Needed for systemd-bootchart. Ideally only included in development images.
+SRC_URI:append = " file://stats.cfg"