Is it possible to open a local trace file non interactively?

677 views
Skip to first unread message

Mark Kharitonov

unread,
Dec 30, 2021, 5:48:00 PM12/30/21
to Perfetto Development - www.perfetto.dev
I am using the perfetto UI to represent msbuild project build events as traces. This is a very convenient way to visualize the build and identify bottleneck projects.

I would like to have a single script that given an msbuild binary log would generate the trace file (not a problem) and open the perfetto UI with the generated trace event file.

However, I am unable to figure out how to open the trace file non interactively. Is it possible at all? And if not, could it be implemented in the future?

I have created 3 SO questions on the subject just in case before joining this group:

Lalit Maganti

unread,
Jan 4, 2022, 8:39:19 AM1/4/22
to Mark Kharitonov, Perfetto Development - www.perfetto.dev
There's a Python script available in the Perfetto repo which allows you to open a trace from the command line: here

Is this along the lines of what you're looking for?

Thanks,
Lalit

--
You received this message because you are subscribed to the Google Groups "Perfetto Development - www.perfetto.dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to perfetto-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/perfetto-dev/e5984050-ce90-4f49-b5c0-32c04075f233n%40googlegroups.com.

Mark Kharitonov

unread,
Jan 4, 2022, 10:27:30 AM1/4/22
to Perfetto Development - www.perfetto.dev
So I think my Powershell code does exactly that - start a very rudimentary http server and navigate in the browser. But the document's Content Security Policy blocked it every time.
But I will test the python example and report back.
Thank you for pointing it out.

Lalit Maganti

unread,
Jan 4, 2022, 10:34:22 AM1/4/22
to Mark Kharitonov, Perfetto Development - www.perfetto.dev
Ah in that case, I think the problem might be that you're not using 9001 as the port number of the webserver - this is the only localhost address allowed by the UI CSP.

Mark Kharitonov

unread,
Jan 7, 2022, 5:02:25 PM1/7/22
to Perfetto Development - www.perfetto.dev
Thank you very much.
I had to listen on 127.0.0.1:9001 and it is very important to return 404 for any other resources, otherwise Perfetto expects to download trace processor from my dummy server, if it does not receives an error on POST /status
Reply all
Reply to author
Forward
0 new messages