perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

traced is intrusive ?

Open sifangli-labs opened this issue 1 year ago • 4 comments

Hi, I am running perfetto/traced/traced_probe in a Linux system that has a total average CPU load of 30%. I capture CPU scheduling and in code traces mostly via Perfetto stack and compression is turned on (COMPRESSION_TYPE_DEFLATE).

I am surprised to see traced is running as RT scheduling and it obviously could hog CPU for as long as 200ms at a time. This is apparently intrusive for a realtime system. Since some kernel threads are running as lower scheduling policies and have to be running on a specific CPU. Is this behavior of traced configurable? or is it related to that the compression is on? Thanks.

sifangli-labs avatar Sep 03 '25 17:09 sifangli-labs

🤖 Hi @sifangli-labs, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

github-actions[bot] avatar Sep 03 '25 17:09 github-actions[bot]

AFAIK, by default, traced does not attempt to change its scheduling priority or attempt to run as RT. There's an opt-in flag in the config (https://perfetto.dev/docs/reference/trace-config-proto#PriorityBoostConfig) which asks traced to "boost" priority but unless you are setting this flag, it should never happen.

Please give us repro instructions if you're finding that we're boosting even when we shouldn't be (i.e. you're not asking for boosting).

LalitMaganti avatar Sep 03 '25 18:09 LalitMaganti

Thanks for the comments, we found a bug in ur code that explains it - sorry about the false alarm. I am closing it.

sifangli-labs avatar Sep 03 '25 18:09 sifangli-labs

Thanks for the comments, we found a bug in ur code that explains it - sorry about the false alarm. I am closing it.

@sifangli-labs what bug?

rsavitski avatar Sep 04 '25 16:09 rsavitski