summaryrefslogtreecommitdiffstats
path: root/tools/memory_inspector/classification_rules/default/mmap-android.py
blob: 1a8d0d0f7507c3396b35c6237981465af02e1a98 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 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 memory maps 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/mmap_classifier.py for more docs.

[
{
  'name': 'Anon',
  'mmap_file': r'(^$)|(^\[)',
  'children': [
    {
      'name': 'stack',
      'mmap_file': r'\[stack',
    },
    {
      'name': 'libc malloc',
      'mmap_file': 'libc_malloc',
    },
    {
      'name': 'JIT',
      'mmap_prot': 'r.x',
    },
  ],
},
{
  'name': 'Ashmem',
  'mmap_file': r'^/dev/ashmem',
  'children': [
    {
      'name': 'Dalvik',
      'mmap_file': r'^/dev/ashmem/dalvik',
      'children': [
        {
          'name': 'Java Heap',
          'mmap_file': r'dalvik-heap',
        },
        {
          'name': 'JIT',
          'mmap_prot': 'r.x',
        },
      ],
    },
  ],
},
{
  'name': 'Libs',
  'mmap_file': r'(\.so)|(\.apk)|(\.jar)',
  'children': [
    {
      'name': 'Native',
      'mmap_file': r'\.so',
    },
    {
      'name': 'APKs',
      'mmap_file': r'\.apk',
    },
    {
      'name': 'JARs',
      'mmap_file': r'\.jar',
    },
  ],
},
{
  'name': 'Devices',
  'mmap_file': r'^/dev/',
  'children': [
    {
      'name': 'GPU',
      'mmap_file': r'(nv)|(mali)',
    },
  ],
},
]