perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

[trace_processor] update allowed origins for httpd connections

Open souldjl opened this issue 1 year ago • 2 comments

Hello, I have deployed perfetto ui myself now but my 9001 port is inaccessible to the browser due to cors. What can I do to make it work properly?

souldjl avatar Apr 15 '25 02:04 souldjl

I cannot answer this based on the information provided (9001 is for native acceleration), but suspect that this CSP setup fragment is what you're looking to understand: https://osscs.corp.google.com/chromium/chromium/src/+/main:third_party/perfetto/ui/src/frontend/index.ts;l=82;drc=e821dc20222bc73c5dd82c7abf6c43b624c779aa

rsavitski avatar Apr 16 '25 16:04 rsavitski

I meet the same problem.

the json is too big to load directly.

Image

then i did as the prompt.

curl -LO https://get.perfetto.dev/trace_processor
chmod +x ./trace_processor
trace_processor --httpd result.json
Image

last, I reload https://ui.perfetto.dev

This server can be used by reloading https://ui.perfetto.dev and clicking on YES on the "Trace Processor native acceleration" dialog

but there is no dialog, and I find /status CORS error. Image

use curl to access status api is ok.

Image

I try chrome plugin, and found trace_processor works.

Image

oncealong avatar May 10 '25 14:05 oncealong