perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

Failed to support floating point timestamp?

Open gaogaotiantian opened this issue 5 years ago • 10 comments

Not sure if perfetto just dropped supporting floating point timestamp, but the following json will generate error in perfetto, but works well in chrome trace viewer. Changing ts to 3 will satisfy perfetto. Will this be the design decision that perfetto does not support floating point ts or something else is going wrong?

{
	"traceEvents": [{
		"pid": 3346,
		"tid": 3346,
		"ts": 3.1,
		"dur": 290.1,
		"name": "builtins.exec",
		"ph": "X",
		"cat": "FEE"
	}]
}

gaogaotiantian avatar Apr 04 '21 19:04 gaogaotiantian

Good question. I think chrome never emitted sub-us (hence floating point) timestamps and that's why we ended up assuming that. The format doc doesn't say anything in this regard, so this is the usual limbo of unspecified behavior somebody else ended up relying on.

At the same time, I think this is easy to fix. Actually a good starter bug for @octaviantu, WDYT @chromy ?

primiano avatar Apr 06 '21 09:04 primiano

For tracking purposes, filed a matchin internal bug in b/184613564

primiano avatar Apr 06 '21 09:04 primiano

Sounds good to me! 👍🏻

chromy avatar Apr 06 '21 11:04 chromy

Did you already make some progress on this one?

ghost avatar Apr 16 '21 09:04 ghost

@octaviantu has a patch about to land at: https://android-review.googlesource.com/c/platform/external/perfetto/+/1671637

chromy avatar Apr 16 '21 14:04 chromy

Hi. The fix is in so the issue should not arise anymore.

octaviantu avatar Apr 19 '21 08:04 octaviantu

This fix is only for mainline version(Canary) and is not merged back to stable?

gaogaotiantian avatar Apr 19 '21 16:04 gaogaotiantian

I don't know if it made it to Canary in ui.perfetto.dev yet. It will take time to stable. This doesn't seem a critical bug to warrant a merge into stable (unless it's blocking something major I am not thinking about)

primiano avatar Apr 19 '21 16:04 primiano

Okay got it. VizTracer won't work without this fix so that's why I'm asking. Perfetto is currently the alternative UI so I guess it's okay.

gaogaotiantian avatar Apr 19 '21 16:04 gaogaotiantian

Just monitor https://cs.android.com/android/platform/superproject/+/master:external/perfetto/ui/release/channels.json;l=1?q=f:ui%2F.*channels&sq= and you'll know when it rolls ;)

primiano avatar Apr 19 '21 23:04 primiano