mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 00:11:56 +09:00
[Docs] (docs/Performance): add a skill for reading Mali GPU counters
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user