Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e3a50455 authored by Daniele Di Proietto's avatar Daniele Di Proietto
Browse files

tracing_perfetto: Use 1Mb shared memory buffer

The default shared memory buffer with perfetto is 256 Kb. With the
current chunking configuration this allows no more than 64 threads
tracing at the same time.

Using a 1Mb buffer allows 256 threads.

Tested by recording a trace with:

```
buffers {
  size_kb: 100024
  fill_policy: RING_BUFFER
}

data_sources {
  config {
    name: "linux.ftrace"
    ftrace_config {
      atrace_categories: "gfx"
      atrace_categories: "input"
      atrace_categories: "view"
      atrace_categories: "webview"
      atrace_categories: "wm"
      atrace_categories: "am"
      atrace_categories: "sm"
      atrace_categories: "ss"

      atrace_categories_prefer_sdk: "gfx"
      atrace_categories_prefer_sdk: "input"
      atrace_categories_prefer_sdk: "view"
      atrace_categories_prefer_sdk: "webview"
      atrace_categories_prefer_sdk: "wm"
      atrace_categories_prefer_sdk: "am"
      atrace_categories_prefer_sdk: "sm"
      atrace_categories_prefer_sdk: "ss"
      atrace_categories_prefer_sdk: "pdx"
    }
  }
}

data_sources {
  config {
    name: "track_event"
    track_event_config {
        enabled_categories: "gfx"
        enabled_categories: "input"
        enabled_categories: "view"
        enabled_categories: "webview"
        enabled_categories: "wm"
        enabled_categories: "am"
        enabled_categories: "sm"
        enabled_categories: "ss"
        disabled_categories: "*"
    }
  }
}

```

and checking that the shared memory buffer used with system_server,
systemui and surfaceflinger is 1Mb:

```
vsoc_x86_64:/ # pidof system_server
801
vsoc_x86_64:/ # pidof com.android.systemui
4355
vsoc_x86_64:/ # pidof /system/bin/surfaceflinger
629
vsoc_x86_64:/ # cat /proc/801/maps | grep perfetto_shmem
7e95d774a000-7e95d784a000 rw-s 00000000 00:01 5899                       /memfd:perfetto_shmem (deleted)
vsoc_x86_64:/ # cat /proc/4355/maps | grep perfetto_shmem
7e9708a54000-7e9708b54000 rw-s 00000000 00:01 5900                       /memfd:perfetto_shmem (deleted)
vsoc_x86_64:/ # cat /proc/629/maps | grep perfetto_shmem
7379e57e5000-7379e58e5000 rw-s 00000000 00:01 5901                       /memfd:perfetto_shmem (deleted)
```

Flag: android.os.perfetto_sdk_tracing
Bug: 303199244
Change-Id: Ia3ecf93f3387f0d6c0fe988142f7dd66c9d4a993
parent 76b68a48
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment