[llvm] [gsymutil] Add `--statistics` option (PR #186495)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 14:00:41 PDT 2026


================
@@ -435,6 +438,158 @@ void GsymReader::dump(raw_ostream &OS) {
   }
 }
 
+void GsymReader::dumpStatistics(StringRef GSYMPath, raw_ostream &OS,
----------------
clayborg wrote:

I would like a few changes to the JSON format. Here is an example of what I was thinking:

```
{
  // All top level data goes here
  "path": "big.gSYM", // change "file" to "path"
  "uuid": "D4B9C2DB-9998-3233-A2BE-5577126F0C8D", // Add "uuid" key/value pair at top level
  "num_addresses": 2644457,

  // All byte size info goes into "byte-sizes" which makes it clear that each item is a byte size since they are not mixed together with top level key/value pairs
  "byte-sizes": {  <<< Create a "byte-sizes" object that contains all byte sizes as integers
    "header": 48,
    "addr_info_offsets": 10577828,
    "address_table": 10577828,
    "file_size": 3589437020,
    "file_table": 911700,
    "string_table": 2201319180
    "function_info_data": 1016403410, 
    "function_info_type_sizes":  { <<< Change "breakdown" to "function_info_type_sizes"
      "call_site_info": 151675175, <<< These should include the "InfoType" and byte size of data, that should't go into overhead.
      "inline_info": 68802573,
      "line_table_info": 84738944,
      "end_of_list": XXXXXX, <<< Include the number of bytes for EndOfList
      "merged_func_info": 1016403410, <<< Make "merged_func_info" be a byte size
      "merged_func_info_type_sizes": {  <<< "change "breakdown" for to this
          "line_table_info": 590347516,
          "inline_info": 4791905,
          "call_site_info": 24662301,
          "merged_func_info": 0,
          "end_of_list": XXXXXX, <<< Include the number of bytes for EndOfList
        },
      },
    },
  },
}
```

https://github.com/llvm/llvm-project/pull/186495


More information about the llvm-commits mailing list