[Docs] (docs/Performance): add a skill for reading Mali GPU counters

This commit is contained in:
BZLZHH
2026-11-01 19:51:20 +08:00
parent 05dfff9100
commit d3ec9b8179
4 changed files with 268 additions and 0 deletions
@@ -0,0 +1,26 @@
/*
* Starts the vendor Mali counter producer so perfetto can record the
* "gpu.counters" data source. Run as root, with SELinux permissive.
*
* Build: aarch64-linux-android30-clang -O2 -o gpuprod gpuprod.c
*/
#include <dlfcn.h>
#include <stdio.h>
#include <unistd.h>
int main(void) {
void* lib = dlopen("/vendor/lib64/libgpudataproducer.so", RTLD_NOW);
if (!lib) {
fprintf(stderr, "dlopen: %s\n", dlerror());
return 1;
}
void (*start)(void) = (void (*)(void))dlsym(lib, "start");
if (!start) {
fprintf(stderr, "libgpudataproducer.so exports no start()\n");
return 1;
}
fprintf(stderr, "starting producer\n");
start();
for (;;)
pause();
}