summaryrefslogtreecommitdiffstats
path: root/tools/memory_inspector/classification_rules/default/nheap-android.py
blob: c8427c2126ed7499f84065c29b7c9dd400a90ff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# This is a generic rule-tree for classifying native heaps on Android. It is a
# simple hierarchical python data structure (list of dictionaries). Some rules:
# - Order matters: what is caught by a node is not caught by its siblings.
# - Hierarchy matters: what is caught by a node is propagated to its children
#   (if any). Only one of its children, though, will get the data.
# - Non leaf nodes have an extra implicit node called {node-name}-other: if
#   something is caught by a non leaf node, but none of its children, it is
#   appended to implicit {node-name}-other catch-all children.
#
# See memory_inspector/classification/native_heap_classifier.py for more docs.

# TODO(primiano): This is just a quick sample. Enrich looking at DMP.
[
{
  'name': 'Blink',
  'stacktrace':  r'WTF::|WebCore::|WebKit::',
  'children': [
    {
      'name': 'SharedBuffer',
      'stacktrace': r'WebCore::SharedBuffer',
    },
    {
      'name': 'XMLHttpRequest',
      'stacktrace': r'WebCore::XMLHttpRequest',
    },
    {
      'name': 'DocumentWriter',
      'stacktrace': r'WebCore::DocumentWriter',
    },
    {
      'name': 'Node_Docs',
      'stacktrace': r'WebCore::\w+::create',
    },
  ],
},

{
  'name': 'Skia',
  'stacktrace':  r'sk\w+::',
},
{
  'name': 'V8',
  'stacktrace':  r'v8::',
  'children': [
    {
      'name': 'heap-newspace',
      'stacktrace': r'v8::internal::NewSpace',
    },
    {
      'name': 'heap-coderange',
      'stacktrace': r'v8::internal::CodeRange',
    },
    {
      'name': 'heap-pagedspace',
      'stacktrace': r'v8::internal::PagedSpace',
    },
  ],
},
]