[Chore] (MG_Backend/DirectGLES, MG_Backend/DirectVulkan, MG_Impl/EGLImpl, MG_Impl/Pipe, MG_IntegrationTest/Harness, MG_IntegrationTest/Scenarios, MG_Pipe, MG_Remote, MG_Remote/Client, MG_Remote/Server, MG_Remote/Transport, MG_Test/Backend, MG_Test/EGLState, MG_Test/Wire, scripts, scripts/ci, tools/cts, tools/device_bench, tools/spikes, tools/trace_replay, tools/wgl-smoke): add the license header where it is missing

This commit is contained in:
2026-10-15 10:15:34 -04:00
parent 35c7b589f4
commit c4fb9397cb
159 changed files with 1239 additions and 3 deletions
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/callers.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
import sys, re, subprocess, collections, os
f, tid, so, base, sub, target = sys.argv[1], sys.argv[2], sys.argv[3], int(sys.argv[4],16), sys.argv[5], sys.argv[6]
SYM = os.path.expandvars(r'$LOCALAPPDATA/Android/Sdk/ndk/27.2.12479018/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-symbolizer.exe')
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/incl.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# incl.py <samples> <tid> <so> <base> <dsosub> [top] - inclusive on-CPU %, and leaf-dso -> first own frame
import sys, re, subprocess, collections, os
f, tid, so, base, sub = sys.argv[1], sys.argv[2], sys.argv[3], int(sys.argv[4], 16), sys.argv[5]
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/mktables.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
import json, sys, statistics as st
d = json.load(open(sys.argv[1]))
stacks = ['stock', 'espryt', 'magma']
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/offcpu.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# offcpu.py <samples.txt> <tid> <so> <base-hex> <dso-substr> [depth]
# Aggregates report-sample output (trace-offcpu) for one thread: on/off CPU split, and the
# off-CPU (leaf __schedule) time by kernel wait path + first N libMobileGL frames.
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/pbparse.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
import re, sys, glob, os, statistics as st
# usage: pbparse.py <dir> ; files <round>-<stack>-<cfg>.out
d = sys.argv[1]
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/symagg.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# symagg.py <report.txt> <libname-substring> <so-path> <base-hex> [top]
# report.txt = simpleperf report --sort dso,vaddr_in_file output; aggregates samples per function.
import sys, re, subprocess, collections, os
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/anland_glmark2/timeline.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
import sys, collections
f = sys.argv[1]; tids = sys.argv[2].split(','); t0off = float(sys.argv[3]); span = float(sys.argv[4])
samples = []; cur = None
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/callee_split.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Split one function's inclusive samples by its direct callees (and by malloc/atomic leaves).
python callee_split.py <perf.data> <binary_cache> <function substring> [--depth 1] [--thread NAME]
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/components.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Inclusive share of fixed components on one thread of a simpleperf profile, converted to
milliseconds per frame with the thread's measured CPU ms/frame.
+8
View File
@@ -1,3 +1,11 @@
// MobileGL - tools/device_bench/disagg/cpusampler.c
// Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt
// https://www.gnu.org/licenses/lgpl-3.0.txt
// SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header
// Device-side per-thread CPU sampler for the perf matrix (P14).
//
// Usage (as root, pinned to a little core):
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/crosshost_report.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Reduce crosshost_accept.sh output (.trace-work/perf-compare/crosshost/<run>/) to a table."""
import json, os, re, statistics, sys
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/fcl_drvcaller.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# fcl_drvcaller.py <rundir> <tid> <frames>: driver-layer on-CPU time keyed by (driver entry, MobileGL caller)
import os, sys
from collections import Counter
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/fcl_incl.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# fcl_incl.py <rundir> <tid|thread comm> <frames> [N]: inclusive on-CPU ms/frame of libMobileGL functions
import os, sys
from collections import Counter
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/fcl_split.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# fcl_split.py <rundir> <tid> <ms_per_frame> [depth] [--detail=layer]
# Period-weighted on/off-CPU split of one thread of an FCL simpleperf --trace-offcpu profile.
# On-CPU goes to a layer (driver / backend / applier / client half / jvm+game / other), off-CPU is
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/fcl_stacks.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# fcl_stacks.py <rundir> <tid> <frames> [depth] [filter-substring]: on-CPU inclusive function time (ms/frame) and top stacks
import os, sys
from collections import Counter
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/freqcheck.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""freqcheck.py <freq.txt> [pin.txt] - P15 measurement-validity verdict for one run.
freq.txt is freq_sampler.sh output; pin.txt is the `pin_clocks.sh show` output taken when the
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/layers.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Split one thread of a simpleperf profile by LAYER, in ms per frame.
python layers.py <perf.data> <binary_cache> <thread comm> <cpu_ms_per_frame> [--tail-ms=N]
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/make_report.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Render the perf-compare report tables from summary.json + per-run artefacts.
Usage: make_report.py [results_dir]
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/offwait.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# offwait.py <trace.txt> <tid> [present_marker]
# Off-CPU accounting for one thread from an atrace/ftrace text dump:
# - sleep (S/D) and runnable (preempted) time per frame
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/disagg/p14_report.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Reduce matrix_p14.sh results: steady-state fps, per-thread CPU ms/frame, GPU busy share.
python p14_report.py <results_dir> [--md out.md] [--json out.json]
+8
View File
@@ -1,3 +1,11 @@
// MobileGL - tools/device_bench/disagg/sampler.c
// Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt
// https://www.gnu.org/licenses/lgpl-3.0.txt
// SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header
// Device-side /proc sampler: per-tid syscall occupancy + CPU + switch counters.
// strace attach is SELinux-blocked on this device; /proc/<tid>/syscall is
// readable same-uid via run-as, which gives the blocked-syscall histogram.
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/sfalign.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# sfalign.py <trace>: does SF's setTransactionState return right after SF main-thread flushTransactions?
import re, sys, bisect
from collections import defaultdict
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/slices.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
# slices.py <trace> <comm-regex> : atrace slice wall time per slice name for threads whose comm-pid matches
import re, sys
from collections import Counter, defaultdict
+8
View File
@@ -1,3 +1,11 @@
# MobileGL - tools/device_bench/disagg/snapdiff.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
import sys
def rd(p):
L=open(p).read().split('\n'); up=float(L[0].split()[0]); gpu=sum(int(x) for x in L[1].split())
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/magma_runahead/run_fcl_arm.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""One FCL arm on Redmi 2f7cbe2e; root coordinates backup/reboot beforehand.
No logcat clear, clock pin, APK install, or global-setting change. The app is left
@@ -1,3 +1,11 @@
// MobileGL - tools/device_bench/p5f/P5fPublicMipmapScenario.cpp
// Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt
// https://www.gnu.org/licenses/lgpl-3.0.txt
// SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header
// Device-only P5f preparation. Public GL calls, no MobileGL internal symbols.
#include "Harness/ScenarioFixture.h"
#include <array>
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/p5f/verify_arm.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Read-only verdict for the prepared public-pixel arm; never invokes adb."""
import pathlib
import re
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/p6/ab_session.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Paired A/B on a disaggregated-campaign device: one reboot-clean thermal window, interleaved arms.
Its first use was `CONTRACT-P6.md` section 9 item 7 (the paired device gate) and item 8-1 (the
+8
View File
@@ -1,4 +1,12 @@
#!/usr/bin/env python3
# MobileGL - tools/device_bench/p6/render_ab.py
# Copyright (c) 2025-2026 MobileGL-Dev
# Licensed under the GNU Lesser General Public License v3.0:
# https://www.gnu.org/licenses/gpl-3.0.txt
# https://www.gnu.org/licenses/lgpl-3.0.txt
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""Renders an ab_session.py session into the markdown tables the report needs.
Separate from the runner on purpose: the runner's job is to COLLECT, and a renderer that is reading