r/tasker • • 25d ago

Help [HELP]LOGCAT profile query

Tasker Logcat profile for the OnePlus Nord 5 Action Key Up and down is set up and it works - but stops working randomly . Opening and closing the profile in Tasker temporarily fixes it, but the issue always returns. Any clues on this ?

Tasker is battery exempted and locked in memory - Enabled the System buffer size to 16M to ensure logs are not overflowing .(Shizuku enabled and every time ensure that ADB Wifi log cat is enabled on every display on event)

1 Upvotes

6 comments sorted by

2

u/DylanXu054728 25d ago

My guess is the logcat reader behind the event is dying, not your filter. Tasker streams logcat through a long-running process, and that stream ends silently if logd rotates or clears the buffer, or if the process gets reaped when the screen goes off. Re-opening the profile restarts the reader, which matches what you're seeing. Battery exemption and a bigger buffer don't help much if the stream itself gets cut.

Things I'd try:

  1. Check the Tasker Run Log right after it stops working. If the Logcat Entry event shows nothing, the reader is dead rather than the profile mis-matching.
  2. Automate your manual fix: add a Display On event profile that runs Profile Status (Set Off) on the logcat profile, Wait 1 second, then Profile Status (Set On). That restarts the reader every time you wake the phone.
  3. Narrow the filter. Use a specific component/tag and the lowest log level that works, so the profile isn't wading through a flood of system logs.

I'm not sure whether OxygenOS clears logs on its own on the Nord 5, so treat that part as a guess. Also check that the READ_LOGS permission is still granted after a Tasker update or reinstall.

1

u/binomat 25d ago

THANK you for the detailed reply!! - as of now I introduced a logcat clearing command first thing on DisplayOn Event- So far ,the Logcat event is working !! if buffer clearing is making it working ,that implies either buffer offer flow or Tasker was hard time to fish the required strings from 16M buffer?- 2nd step you mentioned(Toggling the profile) also seems to be promising

2

u/DylanXu054728 25d ago

I wouldn't blame the 16M size itself. Tasker reads logcat as a live stream, so it isn't searching the whole buffer. My guess is that clearing it makes logd reset or restart the stream, and that's what revives the reader. A big buffer mostly just means more stale data and more rotation when the screen is off. I haven't verified this on a Nord 5, so it's a guess.

If the clear command keeps working, I'd keep it and drop the buffer back to 4M or so to see if it still holds. Keep the profile toggle as a fallback, and if it dies again, check the Run Log to see whether the reader or the filter failed.

1

u/DutchOfBurdock 25d ago

You need to Disable child process restrictions (Developer Menu on your device). Tasker spawns the logcat binary in Android, which would be a native child process and Android will kill it after a short time. This is the same setting that breaks Termux with Exit 9.

1

u/binomat 25d ago

Thank you for pitching in !!Please pardon my limited knowledge which may be reflecting on next statements.

For me logcat -c works the logcat profile and as per gemini -"If the OS (or Phantom Process Killer) has already killed Tasker's background logcat child process, running logcat -c will not wake Tasker up or force it to spawn a new reader."

So this makes me to believe that Tasker child was still active and only clearing the buffer helped to grab the required pattern quiclky ...

Anycase it is always to good to have an extra layer of protection with disabling the restriction

2

u/DutchOfBurdock 24d ago

Just an FYI, Tasker won't dump the logcat when reading (logcat -d), it'll start feeding logs the moment it spawns, so your 16M buffer wouldn't make any difference to a 64k one for Tasker. Just, your 16M one is going to use that much RAM.

Interesting how clearing the buffer seems to work triggering it back, as clearing the ring buffers doesn't cause anything else to happen.