1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tools/trace-malloc/rules.txt Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,442 @@ 1.4 +# Categorization rules for spacetrace 1.5 +# 1.6 +# This file defines the stack frame rules that will categorize 1.7 +# allocations that spacetrace processes. The format of this file is 1.8 +# 1.9 +# <categoryname> 1.10 +# initial string match for stack frame n 1.11 +# initial string match for stack frame n+1 1.12 +# initial string match for stack frame n+2 1.13 +# 1.14 +# The key in the matching rule is that for every rule, we provide a 1.15 +# snippet of the stack frame - contiguous substring matches. 1.16 +# categorynames and rules substring matches are case sensitive 1.17 +# 1.18 +# Predefined Categories 1.19 +# "All" - All allocations [default] 1.20 +# "uncategorized" - All allocations that don't match any category 1.21 +# 1.22 +# 1.23 +# Suresh Duddi <dp@netscape.com> 1.24 +########################################################################### 1.25 +# NOTE: This is still under definition 1.26 +########################################################################### 1.27 +# General principle of categorization: 1.28 +# 1.29 +# - Each category, in general, denotes a module or feature. 1.30 +# 1.31 +# - We assign each allocation to the module/feature that directly 1.32 +# caused the allocation irrespective of which higher level module 1.33 +# caused the allocation. There are very few exceptions usually when 1.34 +# an allocation belongs both to a feature-category and to a 1.35 +# module-category. 1.36 +# 1.37 +# bookmarks 1.38 +# Bookmarks. Mainly initialization. Does not include menu cost. 1.39 +# css 1.40 +# Cascading style sheets 1.41 +# dom 1.42 +# Memory held by DOM. 1.43 +# font 1.44 +# All font stuff 1.45 +# global-history 1.46 +# html 1.47 +# html parsing and layout 1.48 +# layout 1.49 +# reflow, frames, line, view 1.50 +# images 1.51 +# All images. 1.52 +# jar 1.53 +# jar, zip 1.54 +# js 1.55 +# javascript 1.56 +# necko 1.57 +# All protocol and uri stuff. All urls created accounted here 1.58 +# preferences 1.59 +# Preferences stuff. All js cost for preferences is included here. 1.60 +## rdf 1.61 +# Most of the rdf allocations. rdf cost from xul, chromeregistry, 1.62 +# is assigned to xul. 1.63 +# 1.64 +# wallet 1.65 +# Form cache. 1.66 +# 1.67 +# xbl 1.68 +# xbl stuff. Includes js in xbl. 1.69 +# xpcom 1.70 +# xpcom, xpt. Allocations for creations of objects are assigned 1.71 +# onto the respective modules 1.72 +# xul 1.73 +# XUL parsing and layout. Includes rdf overhead from xul like 1.74 +# nsChromeRegistry 1.75 +# 1.76 + 1.77 + 1.78 +# 1.79 + 1.80 +# =========================================================================== 1.81 +# Leaf rules. We categorize them out first. 1.82 +# All allocations matching these rules DO belong to the category. 1.83 +# =========================================================================== 1.84 + 1.85 +<js> 1.86 +nsXULPrototypeScript::Deserialize 1.87 + 1.88 +<X> 1.89 +XSupportsLocale 1.90 + 1.91 +<X> 1.92 +/usr/X11R6/lib/libX11.so 1.93 + 1.94 +<js> 1.95 +JS_Init 1.96 + 1.97 +<atoms> 1.98 +NS_NewPermanentAtom 1.99 + 1.100 +<images> 1.101 +gif_write 1.102 + 1.103 +<images> 1.104 +imgRequest::OnDataAvailable 1.105 + 1.106 +<images> 1.107 +imgLoader:: 1.108 + 1.109 +<images> 1.110 +jinit_master_decompress 1.111 + 1.112 +<images> 1.113 +jinit_marker_reader 1.114 + 1.115 +<images> 1.116 +jinit_marker_decompress 1.117 + 1.118 +<images> 1.119 +nsJPEGDecoder:: 1.120 + 1.121 +<images> 1.122 +nsGIFDecoder2:: 1.123 + 1.124 +<jar> 1.125 +nsZipArchive::BuildFileList 1.126 + 1.127 +<jar> 1.128 +nsZipArchive::ReadInit 1.129 + 1.130 +<jar> 1.131 +nsJARChannel::Open 1.132 + 1.133 +<xpcom> 1.134 +NS_InitXPCOM2 1.135 + 1.136 +# xpt file loads 1.137 +<xpcom> 1.138 +xptiInterfaceInfoManager::LoadFile 1.139 + 1.140 +<xpcom> 1.141 +nsGenericModule::Initialize 1.142 + 1.143 +<intl> 1.144 +nsStringBundle 1.145 + 1.146 +<intl> 1.147 +nsLocale:: 1.148 + 1.149 +<intl> 1.150 +nsCharsetConverterManager:: 1.151 + 1.152 +<necko> 1.153 +nsDiskCacheDevice::Init 1.154 + 1.155 +<necko> 1.156 +nsCacheEntryDescriptor::nsTransportWrapper::OpenOutputStream 1.157 + 1.158 +<necko> 1.159 +nsSocketTransport:: 1.160 + 1.161 +<necko> 1.162 +nsCacheService:: 1.163 + 1.164 +<necko> 1.165 +nsDiskCacheStreamIO:: 1.166 + 1.167 +<necko> 1.168 +nsHttpResponseHead:: 1.169 + 1.170 +<wallet> 1.171 +WLLT 1.172 + 1.173 +<xul> 1.174 +nsXULElement::Create 1.175 + 1.176 +<xul> 1.177 +nsXULAttribute::Create 1.178 + 1.179 +<xul> 1.180 +nsXULDocument::AddElementToMap 1.181 + 1.182 +<xul> 1.183 +XULContentSinkImpl::AddAttributes 1.184 + 1.185 +<xul> 1.186 +XULContentSinkImpl::CreateElement 1.187 + 1.188 +<xul> 1.189 +nsXULElement::SetAttr 1.190 + 1.191 +<xul> 1.192 +nsXULDocument::InsertElement 1.193 + 1.194 +<xul> 1.195 +NS_NewXULContentBuilder 1.196 + 1.197 +<xul> 1.198 +nsXULElement::AppendChildTo 1.199 + 1.200 +<xbl> 1.201 +nsXBLPrototypeHandler::AppendHandlerText( 1.202 + 1.203 +<html> 1.204 +FrameArena::AllocateFrame 1.205 + 1.206 +<global-history> 1.207 +nsGlobalHistory::OpenDB 1.208 + 1.209 +<font> 1.210 +nsFontCache:: 1.211 + 1.212 +<font> 1.213 +nsFont::nsFont 1.214 + 1.215 +<gtk> 1.216 +gtk_init 1.217 + 1.218 +<rdf> 1.219 +RDFServiceImpl::GetResource 1.220 + 1.221 +<rdf> 1.222 +RDFContentSinkImpl::AddProperties 1.223 + 1.224 +<rdf> 1.225 +RDFContainerImpl::AppendElement 1.226 + 1.227 +<rdf> 1.228 +RDFXMLDataSourceImpl::Assert 1.229 + 1.230 +<rdf> 1.231 +NS_NewRDFInMemoryDataSource 1.232 + 1.233 +<css> 1.234 +CSSLoaderImpl::ParseSheet 1.235 + 1.236 +<css> 1.237 +CSSParserImpl::Parse( 1.238 + 1.239 +<css> 1.240 +NS_NewCSS 1.241 + 1.242 +<css> 1.243 +RuleHash::AppendRule 1.244 + 1.245 +<css> 1.246 +nsRuleNode::GetStyleData 1.247 + 1.248 +<CSS> 1.249 +SelectorList:: 1.250 + 1.251 +<css> 1.252 +CSSRuleProcessor::RulesMatching 1.253 + 1.254 +<css> 1.255 +CSSStyleSheetImpl::Clone 1.256 + 1.257 +<necko> 1.258 +nsHttpHeaderArray:: 1.259 + 1.260 +<html> 1.261 +nsScanner::Append 1.262 + 1.263 +<html> 1.264 +nsHTMLTokenizer:: 1.265 + 1.266 +<html> 1.267 +NS_NewHTMLTokenizer 1.268 + 1.269 +<html> 1.270 +nsSlidingString:: 1.271 + 1.272 +<html> 1.273 +nsParser:: 1.274 + 1.275 +<html> 1.276 +nsIParserService:: 1.277 + 1.278 +<html> 1.279 +nsCParserNode:: 1.280 + 1.281 +<html> 1.282 +CNavDTD::CNavDTD 1.283 + 1.284 +<html> 1.285 +nsHTMLDocument:: 1.286 + 1.287 +<layout> 1.288 +IncrementalReflow::AddCommand 1.289 + 1.290 +<layout> 1.291 +nsBlockFrame:: 1.292 + 1.293 +<layout> 1.294 +nsBoxFrame:: 1.295 + 1.296 +<layout> 1.297 +nsImageFrame:: 1.298 + 1.299 +<layout> 1.300 +nsInlineFrame:: 1.301 + 1.302 +<layout> 1.303 +nsLeafFrame:: 1.304 + 1.305 +<layout> 1.306 +nsLineLayout:: 1.307 + 1.308 +<layout> 1.309 +nsReflowPath::EnsureSubtreeFor 1.310 + 1.311 +<layout> 1.312 +nsSliderFrame:: 1.313 + 1.314 +<layout> 1.315 +nsScrollBoxFrame:: 1.316 + 1.317 +<layout> 1.318 +nsTextFrame:: 1.319 + 1.320 +<layout> 1.321 +nsTableRowFrame:: 1.322 + 1.323 +<layout> 1.324 +nsTableRowGroupFrame:: 1.325 + 1.326 +<layout> 1.327 +nsViewManager:: 1.328 + 1.329 +<layout> 1.330 +PresShell::ProcessReflowCommands 1.331 + 1.332 + 1.333 +# ====================================================================== 1.334 +# Rules that match higher up on the stack 1.335 +# These go later. 1.336 +# ====================================================================== 1.337 + 1.338 +<preferences> 1.339 +PREF_ 1.340 + 1.341 +<bookmarks> 1.342 +nsBookmarksService:: 1.343 + 1.344 +<xbl> 1.345 +nsXBLService::LoadBindings 1.346 + 1.347 +<xbl> 1.348 +nsXBLBinding::ExecuteAttachedHandler 1.349 + 1.350 +<js> 1.351 +nsXULDocument::LoadScript 1.352 + 1.353 +<js> 1.354 +nsXULDocument::ExecuteScript 1.355 + 1.356 +<xul> 1.357 +XULContentSinkImpl::Open 1.358 + 1.359 +<rdf> 1.360 +RDFContentSinkImpl::HandleEndElement 1.361 + 1.362 +<html> 1.363 +HTMLContentSink::AddAttributes 1.364 + 1.365 +<html> 1.366 +HTMLContentSink::OpenContainer 1.367 + 1.368 +<html> 1.369 +HTMLContentSink::CloseContainer 1.370 + 1.371 +# XXX whom to account LoadImage to? I am going with images. 1.372 +<images> 1.373 +imgLoader::LoadImage 1.374 + 1.375 +<html> 1.376 +StackArena:: 1.377 + 1.378 +# ====================================================================== 1.379 +# Even more genralized rules. There could be lots of activity that 1.380 +# happens below them in the stack. But we are sure we have categorized 1.381 +# a lot of them by using the rules above and know the category of the 1.382 +# most of the rest. 1.383 +# ====================================================================== 1.384 + 1.385 +<rdf> 1.386 +RDFContentSinkImpl:: 1.387 + 1.388 +<dom> 1.389 +nsGenericDOMDataNode:: 1.390 + 1.391 +<dom> 1.392 +nsDOMClassInfo:: 1.393 + 1.394 +<dom> 1.395 +nsDOMSOFactory:: 1.396 + 1.397 +<xul> 1.398 +nsXULTemplateBuilder:: 1.399 + 1.400 +<xul> 1.401 +XULContentSinkImpl::HandleEndElement 1.402 + 1.403 +<xul> 1.404 +nsChromeRegistry:: 1.405 + 1.406 +<js> 1.407 +nsJSContext::EvaluateString 1.408 + 1.409 +# Almost all of what is left with XULContentSink belongs to xul 1.410 +# Also, this was roughly 0.3% of startup memory 1.411 +<xul> 1.412 +XULContentSinkImpl:: 1.413 + 1.414 +# XXX this is a wild guess -> html What remains here is about 1.415 +# XXX 1.5% of startup footprint 1.416 +<html> 1.417 +HTMLContentSink:: 1.418 + 1.419 +<xbl> 1.420 +nsXBLContentSink:: 1.421 + 1.422 +<xbl> 1.423 +nsXBLStreamListener::OnDataAvailable 1.424 + 1.425 +<necko> 1.426 +nsIOService::NewURI 1.427 + 1.428 +<necko> 1.429 +nsIOService::NewChannelFromURI 1.430 + 1.431 +<necko> 1.432 +nsSegmentedBuffer::AppendNewSegment 1.433 + 1.434 +<necko> 1.435 +nsHttpChannel:: 1.436 + 1.437 +# Catchalls to help categorize 1.438 +# ---------------------------------------------------------------------- 1.439 +<js-catchall> 1.440 +js_ 1.441 + 1.442 +# Everything else 1.443 +# ---------------------------------------------------------------------- 1.444 +# <uncategorized> 1.445 +# This is a predefined category. Don't create it yourself.