custom_sources.bloaty 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Custom data sources that are generally useful, so we ship them
  2. # with Bloaty.
  3. ##
  4. # class_or_namespace: grabs everything up until the last "::".
  5. #
  6. # This is especially useful when paired with shortsymbols, eg.
  7. #
  8. # VM SIZE FILE SIZE
  9. # -------------- --------------
  10. # 37.6% 4.18Mi [None] 4.17Mi 37.6%
  11. # 30.9% 3.44Mi [Other] 3.44Mi 30.9%
  12. # 5.7% 648Ki insns 648Ki 5.7%
  13. # 2.9% 330Ki printAliasInstr 330Ki 2.9%
  14. # 2.9% 326Ki __cxxabiv1::(anonymous namespace) 326Ki 2.9%
  15. # 23.6% 77.1Ki [Other] 77.1Ki 23.6%
  16. # 12.7% 41.5Ki __cxxabiv1::(anonymous namespace)::parse_type<>() 41.5Ki 12.7%
  17. # 10.1% 32.9Ki __cxxabiv1::(anonymous namespace)::parse_expression<>() 32.9Ki 10.1%
  18. # <...>
  19. # 2.7% 306Ki std::__1::__tree<> 306Ki 2.7%
  20. # 27.2% 83.3Ki std::__1::__tree<>::__find_equal<>() 83.3Ki 27.2%
  21. # 20.9% 64.0Ki std::__1::__tree<>::__construct_node() 64.0Ki 20.9%
  22. # 12.6% 38.8Ki std::__1::__tree<>::find<>() 38.8Ki 12.6%
  23. # <...>
  24. # 2.2% 247Ki std::__1::__hash_table<> 247Ki 2.2%
  25. # 23.6% 58.5Ki std::__1::__hash_table<>::__rehash() 58.5Ki 23.6%
  26. # 20.3% 50.2Ki std::__1::__hash_table<>::__construct_node_hash() 50.2Ki 20.3%
  27. # 15.4% 38.2Ki std::__1::__hash_table<>::find<>() 38.2Ki 15.4%
  28. # <...>
  29. # 1.8% 208Ki google::protobuf 207Ki 1.8%
  30. # 35.2% 73.2Ki google::protobuf::InsertIfNotPresent<>() 73.2Ki 35.2%
  31. # 25.8% 53.7Ki [Other] 53.4Ki 25.7%
  32. # 6.1% 12.7Ki google::protobuf::StrCat() 12.7Ki 6.1%
  33. # <...>
  34. #
  35. # etc.
  36. custom_data_source: {
  37. name: "class_or_namespace"
  38. base_data_source: "shortsymbols"
  39. rewrite: {
  40. pattern: "^(.*)::[^:]+$"
  41. replacement: "\\1"
  42. }
  43. }
  44. ##
  45. # stripped_sections: the base section name
  46. #
  47. # This is useful when you are profiling object files that you have compiled
  48. # with -ffunction-sections/-fdata-sections. Normally this makes "-d sections"
  49. # very noisy, because every function has a distinct section name. This
  50. # removes the noise and gives you a base section name.
  51. custom_data_source: {
  52. name: "stripped_sections"
  53. base_data_source: "sections"
  54. rewrite: {
  55. pattern: "^\\.text"
  56. replacement: ".text"
  57. }
  58. rewrite: {
  59. pattern: "^\\.data.rel.ro"
  60. replacement: ".data.rel.ro"
  61. }
  62. rewrite: {
  63. pattern: "^\\.data"
  64. replacement: ".data"
  65. }
  66. rewrite: {
  67. pattern: "^\\.rela\\.text"
  68. replacement: ".rela.text"
  69. }
  70. rewrite: {
  71. pattern: "^.rela.data.rel.ro"
  72. replacement: ".rela.data.rel.ro"
  73. }
  74. rewrite: {
  75. pattern: "^.rela.rodata"
  76. replacement: ".rela.rodata"
  77. }
  78. rewrite: {
  79. pattern: "^.rela.data"
  80. replacement: ".rela.data"
  81. }
  82. rewrite: {
  83. pattern: "^.tdata"
  84. replacement: ".tdata"
  85. }
  86. rewrite: {
  87. pattern: "^.rodata"
  88. replacement: ".rodata"
  89. }
  90. rewrite: {
  91. pattern: "^.bss"
  92. replacement: ".bss"
  93. }
  94. rewrite: {
  95. pattern: "^.tbss"
  96. replacement: ".tbss"
  97. }
  98. }
  99. custom_data_source: {
  100. name: "section_prefix"
  101. base_data_source: "sections"
  102. rewrite: {
  103. pattern: "^(\\.[^.]+)"
  104. replacement: "\\1"
  105. }
  106. }