I'm using a proprietary app on my Raspberry Pi 4.
The app has a bug where after a certain amount of time it slows to a crawl. It doesn't fully crash, it just starts performing sub-optimally. The fix is to kill the process and reopen it.
There is a flag in the apps console output I could use to determine that the problem has occurred: "Time taken to process image --249" (249 being the maximum it reports).
Is it possible to set up a .sh file to monitor strace for this process and then kill the process and re-open it? I've done plenty of Googling but I am out of my depth.
I would prefer not to write the strace to a text file and then read from that file. The console output from the application updates 60~ times per second and this would quickly ruin the SD card.
My instinct is to loop through the 10 most recent entries in the strace and look for a string match, but I can't figure our the syntax for that nor if it's even possible.
LD_PRELOAD
ed library to hook into a library call made by your proprietary application and monitor what's going on that way)