/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// An array of known field names which may be present in an smaps file, and the // offsets of the corresponding fields in a MemoryMapping class. const MemoryMapping::Field MemoryMapping::sFields[] = { // clang-format off
{"AnonHugePages", offsetof(MemoryMapping, mAnonHugePages)},
{"Anonymous", offsetof(MemoryMapping, mAnonymous)},
{"KernelPageSize", offsetof(MemoryMapping, mKernelPageSize)},
{"LazyFree", offsetof(MemoryMapping, mLazyFree)},
{"Locked", offsetof(MemoryMapping, mLocked)},
{"MMUPageSize", offsetof(MemoryMapping, mMMUPageSize)},
{"Private_Clean", offsetof(MemoryMapping, mPrivate_Clean)},
{"Private_Dirty", offsetof(MemoryMapping, mPrivate_Dirty)},
{"Private_Hugetlb", offsetof(MemoryMapping, mPrivate_Hugetlb)},
{"Pss", offsetof(MemoryMapping, mPss)},
{"Referenced", offsetof(MemoryMapping, mReferenced)},
{"Rss", offsetof(MemoryMapping, mRss)},
{"Shared_Clean", offsetof(MemoryMapping, mShared_Clean)},
{"Shared_Dirty", offsetof(MemoryMapping, mShared_Dirty)},
{"Shared_Hugetlb", offsetof(MemoryMapping, mShared_Hugetlb)},
{"ShmemPmdMapped", offsetof(MemoryMapping, mShmemPmdMapped)},
{"Size", offsetof(MemoryMapping, mSize)},
{"Swap", offsetof(MemoryMapping, mSwap)},
{"SwapPss", offsetof(MemoryMapping, mSwapPss)}, // VmFlags is a special case. It contains an array of flag strings, which // describe attributes of the mapping, rather than a mapping size. We include // it in this array to aid in parsing, but give it a separate sentinel value, // and treat it specially.
{"VmFlags", kVMFlags}, // clang-format on
};
template <typename T, int n> const T* FindEntry(constchar* aName, const T (&aEntries)[n]) {
size_t index; if (BinarySearchIf(
aEntries, 0, n,
[&](const T& aEntry) { return strcmp(aName, aEntry.mName); },
&index)) { return &aEntries[index];
} return nullptr;
}
using Perm = MemoryMapping::Perm; using PermSet = MemoryMapping::PermSet;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.