Skip to content

Add symbol locator time for each module in statistics #134563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

GeorgeHuyubo
Copy link
Contributor

@GeorgeHuyubo GeorgeHuyubo commented Apr 6, 2025

This PR try to store the download time statistic with a FileSpec, which can be later used when we report statistic to report the time we used to download the file. For now, only debuginfod symbol locator is using it, can be easily extend to other plugins to track download time for each downloaded file.
New key being added:
Module level: "symbolDownloadTime"
Summary level: "totalSymbolDownloadTime"

Update V2:
This PR contains two commit:
In statistics, add locate time for each module in statistics, we time the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration in the ObjectFile. And later on we report this in the statistics.
In statistics, replace symbolFilePath with symbolFilePaths which will be an array of path to object file and nested object files of the symbol file(In SymbolFileDWARF case, it will potentially include path to dwp file and debugmap file)

Update V3
This PR is trying to store the download time targeting the SymbolLocatorDebuginfod performance. Since it's the only SymbolLocator now is downloading symbols from network. Download time is added in statistic for each module level, and also a total symbol download time is present too.
New key being added:
Module level: "symbolDownloadTime"
Summary level: "totalSymbolDownloadTime"

Update V4
In statistics, add locate time for each module in statistics, we time the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration for the succeeded symbol locator plugin in the Module class as a map.
New key being added:
Module level: "symbolLocatorTime"
Summary level: "totalSymbolLocatorTime"
which would be a map of symbol_locator_plugin_name to time.

Sample statistic dump output after this change:

Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 2801664,
      "bytesUnused": 1704256,
      "bytesUsed": 1097408
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244927,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.61934599999999995,
      "debugInfoParseTime": 0.00033100000000000002,
      "identifier": 94868115726768,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-720c9a0f5ba8b460a1524a25597226f0fa551f71-c4crasher",
      "symbolLocatorTime": {
        "debuginfod": 1.4547020000000002
      },
      "symbolTableIndexTime": 0.0035370000000000002,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055040000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "720C9A0F-5BA8-B460-A152-4A25597226F0-FA551F71"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111142256,
      "path": "[vdso](0x00007ffd41c59000)",
      "symbolLocatorTime": {
        "debuginfod": 0.80597700000000005
      },
      "symbolTableIndexTime": 2.8e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00037300000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116162096,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.286356
      },
      "symbolTableIndexTime": 0.0091780000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081841999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111990032,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.63356699999999999
      },
      "symbolTableIndexTime": 0.0023960000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.021706,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116399488,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.66705099999999995
      },
      "symbolTableIndexTime": 0.00053700000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034429999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111778368,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.83268299999999995
      },
      "symbolTableIndexTime": 0.000243,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0026640000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116403264,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.58871499999999999
      },
      "symbolTableIndexTime": 0.000292,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0033,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113225328,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.76993400000000001
      },
      "symbolTableIndexTime": 0.042455,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081374000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113600960,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolLocatorTime": {
        "debuginfod": 0.48382199999999997
      },
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0057219999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94868115726768,
        94868111142256,
        94868116162096,
        94868111990032,
        94868116399488,
        94868111778368,
        94868116403264,
        94868113225328,
        94868113600960
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.1999999999999998e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 244927,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.61934599999999995,
  "totalDebugInfoParseTime": 0.00033100000000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolLocatorTime": {
    "debuginfod": 6.5228070000000002
  },
  "totalSymbolTableIndexTime": 0.059214000000000003,
  "totalSymbolTableParseTime": 0.205928,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00069099999999999999,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 4.1999999999999998e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.5999999999999999e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandName": "target create",
      "durationInSeconds": 6.7297630000000002,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.1576894' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1744934017
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1744934055
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1744934055
    }
  ]
}

@llvmbot
Copy link
Member

llvmbot commented Apr 6, 2025

@llvm/pr-subscribers-lldb

Author: None (GeorgeHuyubo)

Changes

This PR try to store the download time statistic with a FileSpec, which can be later used when we report statistic to report the time we used to download the file. For now, only debuginfod symbol locator is using it, can be easily extend to other plugins to track download time for each downloaded file.
Sample statistic dump output after this change:

Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 3145728,
      "bytesUnused": 1554746,
      "bytesUsed": 1590982
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244905,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 1.0277849999999999,
      "debugInfoParseTime": 0.00036000000000000002,
      "identifier": 94819923889600,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-e9243b31f158441000d1e6310bd82104bdbe362b-c4crasher",
      "symbolDownloadTime": 2.1573409999999997,
      "symbolTableIndexTime": 0.0034009999999999999,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055459999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "E9243B31-F158-4410-00D1-E6310BD82104-BDBE362B"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94819937577008,
      "path": "[vdso](0x00007ffdca346000)",
      "symbolDownloadTime": 0,
      "symbolTableIndexTime": 2.6999999999999999e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00044299999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94819924328256,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolDownloadTime": 0,
      "symbolTableIndexTime": 0.0091170000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.086711999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94819937844080,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolDownloadTime": 0,
      "symbolTableIndexTime": 0.0026340000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.022778,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94819939787376,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolDownloadTime": 0,
      "symbolTableIndexTime": 0.00055500000000000005,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034259999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 71978,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.320467,
      "debugInfoParseTime": 0.0051050000000000002,
      "identifier": 94819941522944,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolDownloadTime": 0,
      "symbolFilePath": "/usr/local/fbcode/platform010/lib/libatomic.so.1.2.0.debuginfo",
      "symbolTableIndexTime": 0.00030699999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0032499999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 450101,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.33496100000000001,
      "debugInfoParseTime": 0.011282,
      "identifier": 94819938686464,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolDownloadTime": 0,
      "symbolFilePath": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1.debuginfo",
      "symbolTableIndexTime": 0.00039199999999999999,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.003754,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 16485198,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.39336700000000002,
      "debugInfoParseTime": 0.37287100000000001,
      "identifier": 94819924448176,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolDownloadTime": 0,
      "symbolFilePath": "/usr/local/fbcode/platform010/lib/libstdc++.so.6.0.29.debuginfo",
      "symbolTableIndexTime": 0.040395,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.086318000000000006,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94819926907648,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolDownloadTime": 0,
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0058370000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94819923889600,
        94819937577008,
        94819924328256,
        94819937844080,
        94819939787376,
        94819941522944,
        94819938686464,
        94819924448176,
        94819926907648
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.0000000000000003e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 17252182,
  "totalDebugInfoEnabled": 4,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 2.0765799999999999,
  "totalDebugInfoParseTime": 0.38961800000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 4,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolDownloadTime": 2.1573409999999997,
  "totalSymbolTableIndexTime": 0.057376000000000003,
  "totalSymbolTableParseTime": 0.21806400000000001,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00066600000000000003,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1743824829
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 3.8000000000000002e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1743824829
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.0000000000000002e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1743824829
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.3277089\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.3277089\"",
      "commandName": "target create",
      "durationInSeconds": 8.309571,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.3277089' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1743824832
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1743824843
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1743824843
    }
  ]
}

Full diff: https://github.com/llvm/llvm-project/pull/134563.diff

8 Files Affected:

  • (modified) lldb/include/lldb/Symbol/SymbolFile.h (+5)
  • (modified) lldb/include/lldb/Target/Statistics.h (+1)
  • (modified) lldb/include/lldb/Utility/FileSpec.h (+8)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (+7)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (+3)
  • (modified) lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp (+21-11)
  • (modified) lldb/source/Target/Statistics.cpp (+8)
  • (modified) lldb/source/Utility/FileSpec.cpp (+6)
diff --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h
index f35d3ee9f22ae..29fa99ba18323 100644
--- a/lldb/include/lldb/Symbol/SymbolFile.h
+++ b/lldb/include/lldb/Symbol/SymbolFile.h
@@ -422,6 +422,11 @@ class SymbolFile : public PluginInterface {
   /// hasn't been indexed yet, or a valid duration if it has.
   virtual StatsDuration::Duration GetDebugInfoIndexTime() { return {}; }
 
+  /// Return the time it took to download any extra symbol files.
+  ///
+  /// \returns 0.0 if no extra symbol files need to be downloaded
+  virtual double GetSymbolDownloadTime() { return 0.0; }
+
   /// Reset the statistics for the symbol file.
   virtual void ResetStatistics() {}
 
diff --git a/lldb/include/lldb/Target/Statistics.h b/lldb/include/lldb/Target/Statistics.h
index ee365357fcf31..2d3a7fcceec53 100644
--- a/lldb/include/lldb/Target/Statistics.h
+++ b/lldb/include/lldb/Target/Statistics.h
@@ -122,6 +122,7 @@ struct ModuleStats {
   double symtab_index_time = 0.0;
   double debug_parse_time = 0.0;
   double debug_index_time = 0.0;
+  double symbol_download_time = 0.0;
   uint64_t debug_info_size = 0;
   bool symtab_loaded_from_cache = false;
   bool symtab_saved_to_cache = false;
diff --git a/lldb/include/lldb/Utility/FileSpec.h b/lldb/include/lldb/Utility/FileSpec.h
index 3fa89b1dcff28..b59fa299c7f9b 100644
--- a/lldb/include/lldb/Utility/FileSpec.h
+++ b/lldb/include/lldb/Utility/FileSpec.h
@@ -75,6 +75,9 @@ class FileSpec {
   /// \see FileSpec::SetFile (const char *path)
   explicit FileSpec(llvm::StringRef path, Style style = Style::native);
 
+  explicit FileSpec(llvm::StringRef path, const double download_time,
+                    Style style = Style::native);
+
   explicit FileSpec(llvm::StringRef path, const llvm::Triple &triple);
 
   bool DirectoryEquals(const FileSpec &other) const;
@@ -416,6 +419,9 @@ class FileSpec {
   ///   The lifetime of the StringRefs is tied to the lifetime of the FileSpec.
   std::vector<llvm::StringRef> GetComponents() const;
 
+  /// Get the download time of the file.
+  double GetDownloadTime() { return m_download_time; }
+
 protected:
   // Convenience method for setting the file without changing the style.
   void SetFile(llvm::StringRef path);
@@ -430,6 +436,8 @@ class FileSpec {
     No
   };
 
+  /// The download time of the file.
+  double m_download_time = 0.0;
   /// The unique'd directory path.
   ConstString m_directory;
 
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index b95159d882bc7..8afb7b9dfb01c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -4349,6 +4349,13 @@ LanguageType SymbolFileDWARF::GetLanguageFamily(DWARFUnit &unit) {
   return LanguageTypeFromDWARF(lang);
 }
 
+double SymbolFileDWARF::GetSymbolDownloadTime() {
+  double time = GetObjectFile()->GetFileSpec().GetDownloadTime();
+  if (m_dwp_symfile)
+    time += m_dwp_symfile->GetObjectFile()->GetFileSpec().GetDownloadTime();
+  return time;
+}
+
 StatsDuration::Duration SymbolFileDWARF::GetDebugInfoIndexTime() {
   if (m_index)
     return m_index->GetIndexTime();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 7309f7a86b659..16f609ee10807 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -309,6 +309,9 @@ class SymbolFileDWARF : public SymbolFileCommon {
   StatsDuration::Duration GetDebugInfoParseTime() override {
     return m_parse_time;
   }
+
+  double GetSymbolDownloadTime() override;
+
   StatsDuration::Duration GetDebugInfoIndexTime() override;
 
   StatsDuration &GetDebugInfoParseTimeRef() { return m_parse_time; }
diff --git a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp
index f9aa6b1a98765..9b6b72ef20816 100644
--- a/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp
+++ b/lldb/source/Plugins/SymbolLocator/Debuginfod/SymbolLocatorDebuginfod.cpp
@@ -188,17 +188,27 @@ GetFileForModule(const ModuleSpec &module_spec,
   std::string cache_file_name = llvm::toHex(build_id, true);
   if (!file_name.empty())
     cache_file_name += "-" + file_name.str();
-  llvm::Expected<std::string> result = llvm::getCachedOrDownloadArtifact(
-      cache_file_name, url_path, cache_path, debuginfod_urls, timeout);
-  if (result)
-    return FileSpec(*result);
-
-  Log *log = GetLog(LLDBLog::Symbols);
-  auto err_message = llvm::toString(result.takeError());
-  LLDB_LOGV(log,
-            "Debuginfod failed to download symbol artifact {0} with error {1}",
-            url_path, err_message);
-  return {};
+  StatsDuration duration;
+  ElapsedTime elapased(duration);
+  std::string local_path;
+  {
+    ElapsedTime elapsed(duration);
+    llvm::Expected<std::string> result = llvm::getCachedOrDownloadArtifact(
+        cache_file_name, url_path, cache_path, debuginfod_urls, timeout);
+
+    if (!result) {
+      Log *log = GetLog(LLDBLog::Symbols);
+      auto err_message = llvm::toString(result.takeError());
+      LLDB_LOGV(
+          log,
+          "Debuginfod failed to download symbol artifact {0} with error {1}",
+          url_path, err_message);
+      return {};
+    }
+    local_path = *result;
+  }
+
+  return FileSpec(local_path, duration.get().count());
 }
 
 std::optional<ModuleSpec> SymbolLocatorDebuginfod::LocateExecutableObjectFile(
diff --git a/lldb/source/Target/Statistics.cpp b/lldb/source/Target/Statistics.cpp
index b5d2e7bda1edf..73e96b6df36ec 100644
--- a/lldb/source/Target/Statistics.cpp
+++ b/lldb/source/Target/Statistics.cpp
@@ -71,6 +71,7 @@ json::Value ModuleStats::ToJSON() const {
   module.try_emplace("debugInfoHadIncompleteTypes",
                      debug_info_had_incomplete_types);
   module.try_emplace("symbolTableStripped", symtab_stripped);
+  module.try_emplace("symbolDownloadTime", symbol_download_time);
   if (!symfile_path.empty())
     module.try_emplace("symbolFilePath", symfile_path);
 
@@ -288,6 +289,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
 
   json::Array json_targets;
   json::Array json_modules;
+  double symbol_download_time = 0.0;
   double symtab_parse_time = 0.0;
   double symtab_index_time = 0.0;
   double debug_parse_time = 0.0;
@@ -345,6 +347,10 @@ llvm::json::Value DebuggerStats::ReportStatistics(
         ++debug_index_saved;
       module_stat.debug_index_time = sym_file->GetDebugInfoIndexTime().count();
       module_stat.debug_parse_time = sym_file->GetDebugInfoParseTime().count();
+      module_stat.symbol_download_time += sym_file->GetSymbolDownloadTime();
+      if (sym_file->GetObjectFile() != module->GetObjectFile())
+        module_stat.symbol_download_time +=
+            module->GetObjectFile()->GetFileSpec().GetDownloadTime();
       module_stat.debug_info_size =
           sym_file->GetDebugInfoSize(load_all_debug_info);
       module_stat.symtab_stripped = module->GetObjectFile()->IsStripped();
@@ -361,6 +367,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
       if (module_stat.debug_info_had_variable_errors)
         ++num_modules_with_variable_errors;
     }
+    symbol_download_time += module_stat.symbol_download_time;
     symtab_parse_time += module_stat.symtab_parse_time;
     symtab_index_time += module_stat.symtab_index_time;
     debug_parse_time += module_stat.debug_parse_time;
@@ -391,6 +398,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
   }
 
   json::Object global_stats{
+      {"totalSymbolDownloadTime", symbol_download_time},
       {"totalSymbolTableParseTime", symtab_parse_time},
       {"totalSymbolTableIndexTime", symtab_index_time},
       {"totalSymbolTablesLoadedFromCache", symtabs_loaded},
diff --git a/lldb/source/Utility/FileSpec.cpp b/lldb/source/Utility/FileSpec.cpp
index bb2b8647342b8..89c3eba44c306 100644
--- a/lldb/source/Utility/FileSpec.cpp
+++ b/lldb/source/Utility/FileSpec.cpp
@@ -72,6 +72,12 @@ FileSpec::FileSpec(llvm::StringRef path, Style style) : m_style(style) {
   SetFile(path, style);
 }
 
+FileSpec::FileSpec(llvm::StringRef path, const double download_time,
+                   Style style)
+    : m_download_time(download_time) {
+  SetFile(path, style);
+}
+
 FileSpec::FileSpec(llvm::StringRef path, const llvm::Triple &triple)
     : FileSpec{path, triple.isOSWindows() ? Style::windows : Style::posix} {}
 

Copy link
Contributor

@youngd007 youngd007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems fine to me. Will let the others take a crack. Please confirm the duration is accurately getting calculated.

Copy link
Collaborator

@clayborg clayborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a "StatsDuration m_download_duration;" instance variable to ObjectFile.h and store it there permanently. We can't increase the size of the FileSpec objects as we create many of these in the debugger and that will make us take a lot more memory.

@GeorgeHuyubo GeorgeHuyubo reopened this Apr 9, 2025
@GeorgeHuyubo GeorgeHuyubo changed the title Add download time for each module in statistics Add locate time and all symbol file path for each module in statistics Apr 9, 2025
Copy link
Collaborator

@clayborg clayborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should talk about the new API you want to add:

virtual std::vector<ObjectFile *> SymbolFile::GetAllObjectFiles();

@GeorgeHuyubo GeorgeHuyubo reopened this Apr 9, 2025
@GeorgeHuyubo GeorgeHuyubo reopened this Apr 10, 2025
@GeorgeHuyubo GeorgeHuyubo changed the title Add locate time and all symbol file path for each module in statistics Add download time for each module in statistics Apr 10, 2025
@GeorgeHuyubo GeorgeHuyubo requested a review from clayborg April 10, 2025 20:08
Copy link
Contributor

@Jlalond Jlalond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit or to. LGTM, but I'll defer to Greg.

@GeorgeHuyubo GeorgeHuyubo reopened this Apr 18, 2025
@GeorgeHuyubo GeorgeHuyubo changed the title Add download time for each module in statistics Add symbol locator time for each module in statistics Apr 18, 2025
@GeorgeHuyubo GeorgeHuyubo merged commit 070a4ae into llvm:main Apr 25, 2025
7 of 9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 25, 2025

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu running on doug-worker-1a while building lldb at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/181/builds/18362

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
505.401 [323/8/440] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/RemoteAwarePlatform.cpp.o
505.448 [322/8/441] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/RegisterContextUnwind.cpp.o
506.782 [321/8/442] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/SectionLoadList.cpp.o
508.897 [320/8/443] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ScriptedThreadPlan.cpp.o
510.383 [319/8/444] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrameList.cpp.o
511.067 [318/8/445] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrameRecognizer.cpp.o
511.532 [317/8/446] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Process.cpp.o
511.839 [316/8/447] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrame.cpp.o
512.581 [315/8/448] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StructuredDataPlugin.cpp.o
513.218 [314/8/449] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o
FAILED: tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o 
/opt/ccache/bin/g++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/source/Target -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Target -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/include -I/usr/include/python3.8 -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/llvm/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-stringop-truncation -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -MF tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o.d -o tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -c /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Target/Statistics.cpp
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Target/Statistics.cpp: In member function ‘llvm::json::Value lldb_private::ModuleStats::ToJSON() const’:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/source/Target/Statistics.cpp:75:39: error: ‘num_symbols_loaded’ was not declared in this scope
   75 |   module.try_emplace("symbolsLoaded", num_symbols_loaded);
      |                                       ^~~~~~~~~~~~~~~~~~
514.428 [314/7/450] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StopInfo.cpp.o
515.376 [314/6/451] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/SystemRuntime.cpp.o
517.998 [314/5/452] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlan.cpp.o
518.223 [314/4/453] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/TargetList.cpp.o
518.917 [314/3/454] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadList.cpp.o
519.768 [314/2/455] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Thread.cpp.o
526.373 [314/1/456] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Target.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 25, 2025

LLVM Buildbot has detected a new failure on builder cross-project-tests-sie-ubuntu-dwarf5 running on doug-worker-1b while building lldb at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/163/builds/17867

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
768.338 [323/8/440] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/RemoteAwarePlatform.cpp.o
769.490 [322/8/441] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/RegisterContextUnwind.cpp.o
770.441 [321/8/442] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/SectionLoadList.cpp.o
773.439 [320/8/443] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ScriptedThreadPlan.cpp.o
776.683 [319/8/444] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrameList.cpp.o
776.756 [318/8/445] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrameRecognizer.cpp.o
777.299 [317/8/446] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Process.cpp.o
779.170 [316/8/447] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StructuredDataPlugin.cpp.o
779.436 [315/8/448] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrame.cpp.o
779.856 [314/8/449] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o
FAILED: tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o 
/opt/ccache/bin/g++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/source/Target -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Target -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/include -I/usr/include/python3.10 -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/llvm/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/../clang/include -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source -I/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/build/tools/lldb/source -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-stringop-truncation -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -MF tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o.d -o tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -c /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Target/Statistics.cpp
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Target/Statistics.cpp: In member function ‘llvm::json::Value lldb_private::ModuleStats::ToJSON() const’:
/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu-dwarf5/llvm-project/lldb/source/Target/Statistics.cpp:75:39: error: ‘num_symbols_loaded’ was not declared in this scope
   75 |   module.try_emplace("symbolsLoaded", num_symbols_loaded);
      |                                       ^~~~~~~~~~~~~~~~~~
781.986 [314/7/450] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/SystemRuntime.cpp.o
783.021 [314/6/451] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StopInfo.cpp.o
786.738 [314/5/452] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/TargetList.cpp.o
787.023 [314/4/453] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlan.cpp.o
789.015 [314/3/454] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadList.cpp.o
791.505 [314/2/455] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Thread.cpp.o
797.861 [314/1/456] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Target.cpp.o
ninja: build stopped: subcommand failed.

kazutakahirata added a commit that referenced this pull request Apr 25, 2025
This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
@kazutakahirata
Copy link
Contributor

@GeorgeHuyubo I've reverted this PR. I'm happy to try your revised patch. Thanks!

@slydiman
Copy link
Contributor

The buildbot lldb-remote-linux-ubuntu is broken too

FAILED: tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/source/Target -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/source/Target -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/include -I/usr/include/python3.12 -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/llvm/../clang/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/../clang/include -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/source -I/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb/source -D__OPTIMIZE__ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-stringop-truncation -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -MF tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o.d -o tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -c /home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/source/Target/Statistics.cpp
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/source/Target/Statistics.cpp: In member function ‘llvm::json::Value lldb_private::ModuleStats::ToJSON() const’:
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/source/Target/Statistics.cpp:75:39: error: ‘num_symbols_loaded’ was not declared in this scope
   75 |   module.try_emplace("symbolsLoaded", num_symbols_loaded);
      |                                       ^~~~~~~~~~~~~~~~~~

GeorgeHuyubo added a commit that referenced this pull request Apr 25, 2025
Identical PR to: #134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 25, 2025

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building lldb at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/25713

Here is the relevant piece of the build log for the reference
Step 5 (build-unified-tree) failure: build (failure)
...
136.867 [212/96/6986] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanCallFunctionUsingABI.cpp.o
137.041 [211/96/6987] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Language.cpp.o
137.056 [210/96/6988] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanCallUserExpression.cpp.o
137.078 [209/96/6989] Building CXX object tools/lldb/source/API/CMakeFiles/liblldb.dir/SBSymbolContextList.cpp.o
137.204 [208/96/6990] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanCallOnFunctionExit.cpp.o
137.241 [207/96/6991] Building CXX object tools/lldb/source/API/CMakeFiles/liblldb.dir/SBThreadCollection.cpp.o
137.691 [206/96/6992] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ScriptedThreadPlan.cpp.o
137.897 [205/96/6993] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/DynamicRegisterInfo.cpp.o
137.929 [204/96/6994] Building CXX object tools/lldb/source/API/CMakeFiles/liblldb.dir/SBTraceCursor.cpp.o
138.183 [203/96/6995] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o
FAILED: tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source/Target -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Target -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/include -I/b/1/llvm-x86_64-debian-dylib/build/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/../clang/include -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/../clang/include -I/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source -I/b/1/llvm-x86_64-debian-dylib/build/tools/lldb/source -isystem /usr/include/libxml2 -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -MF tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o.d -o tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Statistics.cpp.o -c /b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Target/Statistics.cpp
/b/1/llvm-x86_64-debian-dylib/llvm-project/lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared identifier 'num_symbols_loaded'
  module.try_emplace("symbolsLoaded", num_symbols_loaded);
                                      ^
1 error generated.
138.481 [203/95/6996] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanBase.cpp.o
138.578 [203/94/6997] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanRunToAddress.cpp.o
138.962 [203/93/6998] Building CXX object tools/lldb/source/Plugins/SymbolFile/CTF/CMakeFiles/lldbPluginSymbolFileCTF.dir/SymbolFileCTF.cpp.o
139.072 [203/92/6999] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlan.cpp.o
139.708 [203/91/7000] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadList.cpp.o
139.948 [203/90/7001] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepOverBreakpoint.cpp.o
140.182 [203/89/7002] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepInstruction.cpp.o
140.718 [203/88/7003] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrameRecognizer.cpp.o
140.908 [203/87/7004] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanShouldStopHere.cpp.o
141.180 [203/86/7005] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StackFrameList.cpp.o
141.298 [203/85/7006] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/StopInfo.cpp.o
141.428 [203/84/7007] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanSingleThreadTimeout.cpp.o
141.497 [203/83/7008] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanCallFunction.cpp.o
141.503 [203/82/7009] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepThrough.cpp.o
141.861 [203/81/7010] Building CXX object tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/ProcessGDBRemote.cpp.o
141.984 [203/80/7011] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepInRange.cpp.o
142.595 [203/79/7012] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepUntil.cpp.o
142.861 [203/78/7013] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Platform.cpp.o
142.977 [203/77/7014] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/RegisterContextUnwind.cpp.o
143.069 [203/76/7015] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/TargetList.cpp.o
143.070 [203/75/7016] Building CXX object tools/lldb/source/ValueObject/CMakeFiles/lldbValueObject.dir/DILAST.cpp.o
143.371 [203/74/7017] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepOut.cpp.o
143.810 [203/73/7018] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanTracer.cpp.o
143.832 [203/72/7019] Building CXX object tools/lldb/source/API/CMakeFiles/liblldb.dir/SBStatisticsOptions.cpp.o
144.007 [203/71/7020] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepOverRange.cpp.o
144.209 [203/70/7021] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStepRange.cpp.o
144.779 [203/69/7022] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/ThreadPlanStack.cpp.o
144.779 [203/68/7023] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/VerboseTrapFrameRecognizer.cpp.o
144.838 [203/67/7024] Building CXX object tools/lldb/source/ValueObject/CMakeFiles/lldbValueObject.dir/ValueObjectCast.cpp.o
145.043 [203/66/7025] Building CXX object tools/lldb/source/ValueObject/CMakeFiles/lldbValueObject.dir/ValueObjectConstResultCast.cpp.o
145.314 [203/65/7026] Building CXX object tools/lldb/source/ValueObject/CMakeFiles/lldbValueObject.dir/ValueObjectConstResultChild.cpp.o
145.489 [203/64/7027] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/UnwindLLDB.cpp.o
145.655 [203/63/7028] Building CXX object tools/lldb/source/ValueObject/CMakeFiles/lldbValueObject.dir/ValueObjectConstResult.cpp.o

jyli0116 pushed a commit to jyli0116/llvm-project that referenced this pull request Apr 28, 2025
In statistics, add locate time for each module in statistics, we time
the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration for
the succeeded symbol locator plugin in the Module class as a map.
New key being added:
Module level: "_symbolLocatorTime_"
Summary level: "_totalSymbolLocatorTime_"
which would be a map of symbol_locator_plugin_name to time.

Sample statistic dump output after this change:

```
Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 2801664,
      "bytesUnused": 1704256,
      "bytesUsed": 1097408
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244927,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.61934599999999995,
      "debugInfoParseTime": 0.00033100000000000002,
      "identifier": 94868115726768,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-720c9a0f5ba8b460a1524a25597226f0fa551f71-c4crasher",
      "symbolLocatorTime": {
        "debuginfod": 1.4547020000000002
      },
      "symbolTableIndexTime": 0.0035370000000000002,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055040000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "720C9A0F-5BA8-B460-A152-4A25597226F0-FA551F71"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111142256,
      "path": "[vdso](0x00007ffd41c59000)",
      "symbolLocatorTime": {
        "debuginfod": 0.80597700000000005
      },
      "symbolTableIndexTime": 2.8e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00037300000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116162096,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.286356
      },
      "symbolTableIndexTime": 0.0091780000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081841999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111990032,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.63356699999999999
      },
      "symbolTableIndexTime": 0.0023960000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.021706,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116399488,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.66705099999999995
      },
      "symbolTableIndexTime": 0.00053700000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034429999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111778368,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.83268299999999995
      },
      "symbolTableIndexTime": 0.000243,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0026640000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116403264,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.58871499999999999
      },
      "symbolTableIndexTime": 0.000292,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0033,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113225328,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.76993400000000001
      },
      "symbolTableIndexTime": 0.042455,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081374000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113600960,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolLocatorTime": {
        "debuginfod": 0.48382199999999997
      },
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0057219999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94868115726768,
        94868111142256,
        94868116162096,
        94868111990032,
        94868116399488,
        94868111778368,
        94868116403264,
        94868113225328,
        94868113600960
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.1999999999999998e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 244927,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.61934599999999995,
  "totalDebugInfoParseTime": 0.00033100000000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolLocatorTime": {
    "debuginfod": 6.5228070000000002
  },
  "totalSymbolTableIndexTime": 0.059214000000000003,
  "totalSymbolTableParseTime": 0.205928,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00069099999999999999,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 4.1999999999999998e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.5999999999999999e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandName": "target create",
      "durationInSeconds": 6.7297630000000002,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.1576894' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1744934017
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1744934055
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1744934055
    }
  ]
}

```

Co-authored-by: George Hu <[email protected]>
jyli0116 pushed a commit to jyli0116/llvm-project that referenced this pull request Apr 28, 2025
…34563)"

This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
llvm#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
jyli0116 pushed a commit to jyli0116/llvm-project that referenced this pull request Apr 28, 2025
Identical PR to: llvm#134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request May 6, 2025
…ics (#134563)"

This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
llvm/llvm-project#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request May 6, 2025
…7379)

Identical PR to: llvm/llvm-project#134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
In statistics, add locate time for each module in statistics, we time
the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration for
the succeeded symbol locator plugin in the Module class as a map.
New key being added:
Module level: "_symbolLocatorTime_"
Summary level: "_totalSymbolLocatorTime_"
which would be a map of symbol_locator_plugin_name to time.

Sample statistic dump output after this change:

```
Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 2801664,
      "bytesUnused": 1704256,
      "bytesUsed": 1097408
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244927,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.61934599999999995,
      "debugInfoParseTime": 0.00033100000000000002,
      "identifier": 94868115726768,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-720c9a0f5ba8b460a1524a25597226f0fa551f71-c4crasher",
      "symbolLocatorTime": {
        "debuginfod": 1.4547020000000002
      },
      "symbolTableIndexTime": 0.0035370000000000002,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055040000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "720C9A0F-5BA8-B460-A152-4A25597226F0-FA551F71"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111142256,
      "path": "[vdso](0x00007ffd41c59000)",
      "symbolLocatorTime": {
        "debuginfod": 0.80597700000000005
      },
      "symbolTableIndexTime": 2.8e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00037300000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116162096,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.286356
      },
      "symbolTableIndexTime": 0.0091780000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081841999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111990032,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.63356699999999999
      },
      "symbolTableIndexTime": 0.0023960000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.021706,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116399488,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.66705099999999995
      },
      "symbolTableIndexTime": 0.00053700000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034429999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111778368,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.83268299999999995
      },
      "symbolTableIndexTime": 0.000243,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0026640000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116403264,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.58871499999999999
      },
      "symbolTableIndexTime": 0.000292,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0033,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113225328,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.76993400000000001
      },
      "symbolTableIndexTime": 0.042455,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081374000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113600960,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolLocatorTime": {
        "debuginfod": 0.48382199999999997
      },
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0057219999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94868115726768,
        94868111142256,
        94868116162096,
        94868111990032,
        94868116399488,
        94868111778368,
        94868116403264,
        94868113225328,
        94868113600960
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.1999999999999998e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 244927,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.61934599999999995,
  "totalDebugInfoParseTime": 0.00033100000000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolLocatorTime": {
    "debuginfod": 6.5228070000000002
  },
  "totalSymbolTableIndexTime": 0.059214000000000003,
  "totalSymbolTableParseTime": 0.205928,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00069099999999999999,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 4.1999999999999998e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.5999999999999999e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandName": "target create",
      "durationInSeconds": 6.7297630000000002,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.1576894' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1744934017
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1744934055
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1744934055
    }
  ]
}

```

Co-authored-by: George Hu <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…34563)"

This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
llvm#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Identical PR to: llvm#134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
In statistics, add locate time for each module in statistics, we time
the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration for
the succeeded symbol locator plugin in the Module class as a map.
New key being added:
Module level: "_symbolLocatorTime_"
Summary level: "_totalSymbolLocatorTime_"
which would be a map of symbol_locator_plugin_name to time.

Sample statistic dump output after this change:

```
Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 2801664,
      "bytesUnused": 1704256,
      "bytesUsed": 1097408
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244927,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.61934599999999995,
      "debugInfoParseTime": 0.00033100000000000002,
      "identifier": 94868115726768,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-720c9a0f5ba8b460a1524a25597226f0fa551f71-c4crasher",
      "symbolLocatorTime": {
        "debuginfod": 1.4547020000000002
      },
      "symbolTableIndexTime": 0.0035370000000000002,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055040000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "720C9A0F-5BA8-B460-A152-4A25597226F0-FA551F71"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111142256,
      "path": "[vdso](0x00007ffd41c59000)",
      "symbolLocatorTime": {
        "debuginfod": 0.80597700000000005
      },
      "symbolTableIndexTime": 2.8e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00037300000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116162096,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.286356
      },
      "symbolTableIndexTime": 0.0091780000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081841999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111990032,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.63356699999999999
      },
      "symbolTableIndexTime": 0.0023960000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.021706,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116399488,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.66705099999999995
      },
      "symbolTableIndexTime": 0.00053700000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034429999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111778368,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.83268299999999995
      },
      "symbolTableIndexTime": 0.000243,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0026640000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116403264,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.58871499999999999
      },
      "symbolTableIndexTime": 0.000292,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0033,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113225328,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.76993400000000001
      },
      "symbolTableIndexTime": 0.042455,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081374000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113600960,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolLocatorTime": {
        "debuginfod": 0.48382199999999997
      },
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0057219999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94868115726768,
        94868111142256,
        94868116162096,
        94868111990032,
        94868116399488,
        94868111778368,
        94868116403264,
        94868113225328,
        94868113600960
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.1999999999999998e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 244927,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.61934599999999995,
  "totalDebugInfoParseTime": 0.00033100000000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolLocatorTime": {
    "debuginfod": 6.5228070000000002
  },
  "totalSymbolTableIndexTime": 0.059214000000000003,
  "totalSymbolTableParseTime": 0.205928,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00069099999999999999,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 4.1999999999999998e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.5999999999999999e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandName": "target create",
      "durationInSeconds": 6.7297630000000002,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.1576894' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1744934017
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1744934055
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1744934055
    }
  ]
}

```

Co-authored-by: George Hu <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…34563)"

This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
llvm#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Identical PR to: llvm#134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
In statistics, add locate time for each module in statistics, we time
the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration for
the succeeded symbol locator plugin in the Module class as a map.
New key being added:
Module level: "_symbolLocatorTime_"
Summary level: "_totalSymbolLocatorTime_"
which would be a map of symbol_locator_plugin_name to time.

Sample statistic dump output after this change:

```
Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 2801664,
      "bytesUnused": 1704256,
      "bytesUsed": 1097408
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244927,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.61934599999999995,
      "debugInfoParseTime": 0.00033100000000000002,
      "identifier": 94868115726768,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-720c9a0f5ba8b460a1524a25597226f0fa551f71-c4crasher",
      "symbolLocatorTime": {
        "debuginfod": 1.4547020000000002
      },
      "symbolTableIndexTime": 0.0035370000000000002,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055040000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "720C9A0F-5BA8-B460-A152-4A25597226F0-FA551F71"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111142256,
      "path": "[vdso](0x00007ffd41c59000)",
      "symbolLocatorTime": {
        "debuginfod": 0.80597700000000005
      },
      "symbolTableIndexTime": 2.8e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00037300000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116162096,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.286356
      },
      "symbolTableIndexTime": 0.0091780000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081841999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111990032,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.63356699999999999
      },
      "symbolTableIndexTime": 0.0023960000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.021706,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116399488,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.66705099999999995
      },
      "symbolTableIndexTime": 0.00053700000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034429999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111778368,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.83268299999999995
      },
      "symbolTableIndexTime": 0.000243,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0026640000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116403264,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.58871499999999999
      },
      "symbolTableIndexTime": 0.000292,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0033,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113225328,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.76993400000000001
      },
      "symbolTableIndexTime": 0.042455,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081374000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113600960,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolLocatorTime": {
        "debuginfod": 0.48382199999999997
      },
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0057219999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94868115726768,
        94868111142256,
        94868116162096,
        94868111990032,
        94868116399488,
        94868111778368,
        94868116403264,
        94868113225328,
        94868113600960
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.1999999999999998e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 244927,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.61934599999999995,
  "totalDebugInfoParseTime": 0.00033100000000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolLocatorTime": {
    "debuginfod": 6.5228070000000002
  },
  "totalSymbolTableIndexTime": 0.059214000000000003,
  "totalSymbolTableParseTime": 0.205928,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00069099999999999999,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 4.1999999999999998e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.5999999999999999e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandName": "target create",
      "durationInSeconds": 6.7297630000000002,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.1576894' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1744934017
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1744934055
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1744934055
    }
  ]
}

```

Co-authored-by: George Hu <[email protected]>
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…34563)"

This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
llvm#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Identical PR to: llvm#134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
In statistics, add locate time for each module in statistics, we time
the PluginManager::LocateExecutableSymbolFile and
PluginManager::LocateExecutableObjectFile call, save the duration for
the succeeded symbol locator plugin in the Module class as a map.
New key being added:
Module level: "_symbolLocatorTime_"
Summary level: "_totalSymbolLocatorTime_"
which would be a map of symbol_locator_plugin_name to time.

Sample statistic dump output after this change:

```
Command: statistics dump
===============Output===============
{
  "commands": {
    "command container add": 1,
    "command script add": 51,
    "command script import": 59,
    "statistics dump": 1,
    "target create": 1,
    "type summary add": 36,
    "type synthetic add": 21
  },
  "memory": {
    "strings": {
      "bytesTotal": 2801664,
      "bytesUnused": 1704256,
      "bytesUsed": 1097408
    }
  },
  "modules": [
    {
      "debugInfoByteSize": 244927,
      "debugInfoEnabled": true,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0.61934599999999995,
      "debugInfoParseTime": 0.00033100000000000002,
      "identifier": 94868115726768,
      "path": "/home/hyubo/.cache/llvm-debuginfod/client/llvmcache-720c9a0f5ba8b460a1524a25597226f0fa551f71-c4crasher",
      "symbolLocatorTime": {
        "debuginfod": 1.4547020000000002
      },
      "symbolTableIndexTime": 0.0035370000000000002,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0055040000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "720C9A0F-5BA8-B460-A152-4A25597226F0-FA551F71"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111142256,
      "path": "[vdso](0x00007ffd41c59000)",
      "symbolLocatorTime": {
        "debuginfod": 0.80597700000000005
      },
      "symbolTableIndexTime": 2.8e-05,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.00037300000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4D1F38BD-BD34-DFB3-C9A5-B49A2A912219-AC713763"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116162096,
      "path": "/usr/local/fbcode/platform010/lib/libc.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.286356
      },
      "symbolTableIndexTime": 0.0091780000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081841999999999998,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "ACE9DF01-8872-3A35-6D14-3C92527EF739-4BE32C75"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111990032,
      "path": "/usr/local/fbcode/platform010/lib/libm.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.63356699999999999
      },
      "symbolTableIndexTime": 0.0023960000000000001,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.021706,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "85932B54-0DE7-4FC1-23B0-FB09AD1A5A61-8E1098B7"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116399488,
      "path": "/usr/local/fbcode/platform010/lib/libmvec.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.66705099999999995
      },
      "symbolTableIndexTime": 0.00053700000000000004,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0034429999999999999,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "4537CA22-8E6E-495B-7A03-FC2CEDCAD71C-8A7B2067"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868111778368,
      "path": "/usr/local/fbcode/platform010/lib/libatomic.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.83268299999999995
      },
      "symbolTableIndexTime": 0.000243,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0026640000000000001,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "F90F9111-BBD1-C2A9-972A-34EB75ABE62E-3BDED9CF"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868116403264,
      "path": "/usr/local/fbcode/platform010/lib/libgcc_s.so.1",
      "symbolLocatorTime": {
        "debuginfod": 0.58871499999999999
      },
      "symbolTableIndexTime": 0.000292,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0033,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "1C715A92-40BE-BE95-E148-1B401749BAB8-15D09F9D"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113225328,
      "path": "/usr/local/fbcode/platform010/lib/libstdc++.so.6",
      "symbolLocatorTime": {
        "debuginfod": 0.76993400000000001
      },
      "symbolTableIndexTime": 0.042455,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.081374000000000002,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--",
      "uuid": "C9DAEE53-F607-981B-6BED-F2042833BFC7-71A1E66C"
    },
    {
      "debugInfoByteSize": 0,
      "debugInfoEnabled": false,
      "debugInfoHadIncompleteTypes": false,
      "debugInfoHadVariableErrors": false,
      "debugInfoIndexLoadedFromCache": false,
      "debugInfoIndexSavedToCache": false,
      "debugInfoIndexTime": 0,
      "debugInfoParseTime": 0,
      "identifier": 94868113600960,
      "path": "/usr/local/fbcode/platform010/lib/ld.so",
      "symbolLocatorTime": {
        "debuginfod": 0.48382199999999997
      },
      "symbolTableIndexTime": 0.00054799999999999998,
      "symbolTableLoadedFromCache": false,
      "symbolTableParseTime": 0.0057219999999999997,
      "symbolTableSavedToCache": false,
      "symbolTableStripped": false,
      "triple": "x86_64--linux",
      "uuid": "CCA86CF4-E4FF-42C8-7056-2F7D8B83AEE0-530B4095"
    }
  ],
  "targets": [
    {
      "breakpoints": [],
      "dyldPluginName": "dump-modulelist-dyld",
      "expressionEvaluation": {
        "failures": 0,
        "successes": 0
      },
      "frameVariable": {
        "failures": 0,
        "successes": 0
      },
      "mismatchCoredumpModuleCount": 0,
      "moduleIdentifiers": [
        94868115726768,
        94868111142256,
        94868116162096,
        94868111990032,
        94868116399488,
        94868111778368,
        94868116403264,
        94868113225328,
        94868113600960
      ],
      "signals": [
        {
          "SIGABRT": 1
        }
      ],
      "sourceMapDeduceCount": 0,
      "sourceRealpathAttemptCount": 0,
      "sourceRealpathCompatibleCount": 0,
      "stopCount": 1,
      "summaryProviderStatistics": [],
      "targetCreateTime": 4.1999999999999998e-05,
      "totalBreakpointResolveTime": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 244927,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.61934599999999995,
  "totalDebugInfoParseTime": 0.00033100000000000002,
  "totalModuleCount": 9,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolLocatorTime": {
    "debuginfod": 6.5228070000000002
  },
  "totalSymbolTableIndexTime": 0.059214000000000003,
  "totalSymbolTableParseTime": 0.205928,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0,
  "transcript": [
    {
      "command": "symsrv",
      "commandArguments": "",
      "commandName": "symsrv",
      "durationInSeconds": 0.00069099999999999999,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings set symbols.enable-external-lookup true",
      "commandArguments": "symbols.enable-external-lookup true",
      "commandName": "settings set",
      "durationInSeconds": 4.1999999999999998e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandArguments": "plugin.symbol-locator.debuginfod.server-urls 0 https://our.intern.facebook.com/intern/debuginfod",
      "commandName": "settings insert-before",
      "durationInSeconds": 5.5999999999999999e-05,
      "error": "",
      "output": "",
      "timestampInEpochSeconds": 1744934015
    },
    {
      "command": "target create --core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandArguments": "--core \"/var/tmp/cores/c4crasher.crasher.1576894\"",
      "commandName": "target create",
      "durationInSeconds": 6.7297630000000002,
      "error": "",
      "output": "Core file '/var/tmp/cores/c4crasher.crasher.1576894' (x86_64) was loaded.\n",
      "timestampInEpochSeconds": 1744934017
    },
    {
      "command": "fbpaste statistics dump",
      "commandArguments": "statistics dump",
      "commandName": "fbpaste",
      "timestampInEpochSeconds": 1744934055
    },
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1744934055
    }
  ]
}

```

Co-authored-by: George Hu <[email protected]>
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
…34563)"

This reverts commit 070a4ae.

Multiple buildbot failures have been reported:
llvm#134563

The build fails with:

  lldb/source/Target/Statistics.cpp:75:39: error: use of undeclared
  identifier 'num_symbols_loaded'
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
Identical PR to: llvm#134563
Previous PR was approved and landed but broke the build due to bad
merge.
Manually resolve the merge conflict and try to land again.

Co-authored-by: George Hu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants