Slice colors

312 views
Skip to first unread message

Timothy Heil

unread,
Mar 24, 2023, 5:17:27 PM3/24/23
to Perfetto Development - www.perfetto.dev
Hi,

We're producing our own Chrome Trace JSON event files, and would like to better understand and control colors for things like synchronous and asynchronous events.

I see the cname field documented in the Trace Event Format document.

However, it's not easy to figure out what names are valid, and we're concerned they may change across versions/installations. 

  1. The link to the  base color scheme's reserved color names list is 404.
  2. With some searching, I gather we are looking for the color_scheme.html file.  Is that correct?  Where is it on any given installation?
  3. Is there some way to get a list of valid color names and RGB values?
  4. Can we create a custom color scheme and load into the viewer?

Regards,

Timothy

Lalit Maganti

unread,
Mar 24, 2023, 5:20:37 PM3/24/23
to Timothy Heil, Perfetto Development - www.perfetto.dev
Chrome's "Catapult" trace viewer is considered deprecated and there is no active development on it. The JSON trace format is parsed by Perfetto but in a best effort manner. Specifically, Perfetto UI does not support parsing the cname field or anything similar: we simply ignore all coloring requests.

For context, this was an intentional decision: when we designed Perfetto we wanted separation between the data in the trace and the manner in which it is displayed.

In the Perfetto UI, we do not currently expose a mechanism to control how colors are shown but this is something we might look to change in the future.

--
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/528bab00-f64d-408c-bba8-b3eb66e17f1fn%40googlegroups.com.

Lalit Maganti

unread,
Mar 28, 2023, 5:54:00 AM3/28/23
to Kai Ting, Timothy Heil, Perfetto Development - www.perfetto.dev
That repository contains non viewer related code. The specific place to look is https://chromium.googlesource.com/catapult/+log/refs/heads/main/tracing. While there are commits there every now and then, they are extremely sparse and there is no central team which owns the viewer anymore

The native protobuf format for Perfetto can be emitted without using the C++ SDK. See https://perfetto.dev/docs/reference/synthetic-track-event

On Tue, 28 Mar 2023, 03:39 Kai Ting, <kkt...@gmail.com> wrote:
Hi Lalit,

I still see recent commits here on catapult: https://chromium.googlesource.com/catapult/+log
Are these not related to tracing?

If JSON trace format is only parsed in a best effort manner, is there any recommended trace format that users should use other than instrumenting with the C++ SDK? 

Thanks,

Kai

Lalit Maganti

unread,
Mar 30, 2023, 6:51:31 AM3/30/23
to Kai Ting, Timothy Heil, Perfetto Development - www.perfetto.dev
There's no guide available sorry on our side sorry. OTOH you probably should be looking at the protobuf docs not our docs for this. They should be able to explain how to invoke protoc to generate protobuf python files. In the Perfetto codebase we don't really do that: we either generate descriptors or cc files as you found. 

For convenience, we amalgamate all our protos into a single file (perfetto_trace.proto) so should just be a matter of generating Python bindings from that. 

On Thu, 30 Mar 2023, 06:29 Kai Ting, <kkt...@gmail.com> wrote:
Sorry another question - any instructions on generating python protobuf output from the perfetto/protos files? I'm looking for a way to generate TrackEvents using python. When I build perfetto from source I can see the cpp files are generated for track_packet etc.  I guess I can modify the build system to make protoc output python but want to check if there's a documented way for this already.

Thanks,

Kai


On Tue, Mar 28, 2023 at 10:00 AM Kai Ting <kkt...@gmail.com> wrote:
Thanks Lalit. The synthetic track event link is exactly what I was looking for.

-Kai

Lalit Maganti

unread,
Apr 4, 2023, 12:11:33 PM4/4/23
to Kai Ting, Timothy Heil, Perfetto Development - www.perfetto.dev
> Just a minor suggestion (mentioned on Discord as well), can we mention that Trace is the top container of all TracePackets in the guide for synthetic generation? I don't think it's mentioned anywhere.

Sent https://r.android.com/2519483 to add this documentation

> Until the official color control UI happens, I might explore forking the UI part and see if I can enable the cname support in some fashion.

Sounds great! Feel free to send feedback if you find an approach you find works well for you :)

On Fri, 31 Mar 2023 at 17:31, Kai Ting <kkt...@gmail.com> wrote:
Back to the coloring request - I agree that the separation between data and display rendering is a good design for what I see as major use cases of perfetto. For my organization though, a big part of using the tracing is for generating synthetic track events and coloring them according to some predetermined rules. This is important for users as part of their visual analysis. Until the official color control UI happens, I might explore forking the UI part and see if I can enable the cname support in some fashion.

-Kai


On Fri, Mar 24, 2023 at 2:21 PM 'Lalit Maganti' via Perfetto Development - www.perfetto.dev <perfet...@googlegroups.com> wrote:
Reply all
Reply to author
Forward
0 new messages