New issue
Advanced search Search tips

Issue 839071 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Perfetto: Tune buffer sizes for good performance/memory balance

Project Member Reported by oysteine@chromium.org, May 2 2018

Issue description

Right now Perfetto is set up with a somewhat arbitrarily chosen 4MB buffer size in producer_host.cc; this is much higher than what we should be using.
 
Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1851c4fc238c0d86250aeb33206348eaa76caf04

commit 1851c4fc238c0d86250aeb33206348eaa76caf04
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Oct 25 12:19:19 2018

perfetto: Change trace buffer size to 32mB

Previously attempted to set it to 4mB in crrev.com/c/1236663, but that
caused some flakiness in benchmarks. So try it again with 32mB.

Note that as of [1], this buffer is committed only as it is accessed
even on Windows, so the memory regressions we were seeing in
crbug.com/886686 should be much more limited now anyway.

[1] https://android-review.googlesource.com/c/platform/external/perfetto/+/799400

Bug: 839071,  888222 
Change-Id: If7108f3bc0b226e132087886aa8cbccbc30e79b6
Reviewed-on: https://chromium-review.googlesource.com/c/1297418
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602675}
[modify] https://crrev.com/1851c4fc238c0d86250aeb33206348eaa76caf04/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/1851c4fc238c0d86250aeb33206348eaa76caf04/services/tracing/perfetto/perfetto_integration_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/faa1cd30772dee754ebda1d8a1841627d64c543b

commit faa1cd30772dee754ebda1d8a1841627d64c543b
Author: Christian Biesinger <cbiesinger@chromium.org>
Date: Sat Oct 27 06:44:31 2018

Revert "perfetto: Change trace buffer size to 32mB"

This reverts commit 1851c4fc238c0d86250aeb33206348eaa76caf04.

Reason for revert: this may have broken the layoutng loading.desktop perf tests: https://ci.chromium.org/p/chrome/builders/luci.chrome.ci/linux-perf-fyi/244

Original change's description:
> perfetto: Change trace buffer size to 32mB
> 
> Previously attempted to set it to 4mB in crrev.com/c/1236663, but that
> caused some flakiness in benchmarks. So try it again with 32mB.
> 
> Note that as of [1], this buffer is committed only as it is accessed
> even on Windows, so the memory regressions we were seeing in
> crbug.com/886686 should be much more limited now anyway.
> 
> [1] https://android-review.googlesource.com/c/platform/external/perfetto/+/799400
> 
> Bug: 839071,  888222 
> Change-Id: If7108f3bc0b226e132087886aa8cbccbc30e79b6
> Reviewed-on: https://chromium-review.googlesource.com/c/1297418
> Commit-Queue: Eric Seckler <eseckler@chromium.org>
> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> Reviewed-by: oysteine <oysteine@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#602675}

TBR=primiano@chromium.org,oysteine@chromium.org,skyostil@chromium.org,eseckler@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 839071,  888222 
Change-Id: Idd0feff4c3164635609e0e0851e8f679889b367c
Reviewed-on: https://chromium-review.googlesource.com/c/1303676
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603316}
[modify] https://crrev.com/faa1cd30772dee754ebda1d8a1841627d64c543b/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/faa1cd30772dee754ebda1d8a1841627d64c543b/services/tracing/perfetto/perfetto_integration_unittest.cc

Not entirely sure why the benchmarks are still failing with 32mB. Maybe it really isn't enough? The json version of the trace comes up to 16mB for one of the failing tests, but I would have expected the proto version to be smaller.

It looks to me like we're only reading the buffer after disabling tracing if we're exporting into json, so it has to fit the entire trace, correct? Maybe a larger buffer is sensible for this either way?
Ahh wait, isn't that because we don't have any trace buffer memory discounting for the new Perfetto backend? Back in the days young-Primiano plumbed some code to discount tracing buffers from memory infra. Can somebody post a link to a regressing graph? 

Sign in to add a comment