[all-commits] [llvm/llvm-project] f65a52: In `statistics dump --summary`, add back the `targ...

royitaqi via All-commits all-commits at lists.llvm.org
Fri Jun 28 09:13:35 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f65a52ab0ec22cf5c25ccf3c9d86b7635964b864
      https://github.com/llvm/llvm-project/commit/f65a52ab0ec22cf5c25ccf3c9d86b7635964b864
  Author: royitaqi <royitaqi at users.noreply.github.com>
  Date:   2024-06-28 (Fri, 28 Jun 2024)

  Changed paths:
    M lldb/include/lldb/Target/Statistics.h
    M lldb/source/Commands/Options.td
    M lldb/test/API/commands/statistics/basic/TestStats.py

  Log Message:
  -----------
  In `statistics dump --summary`, add back the `targets` section (#97004)

# Change

https://github.com/llvm/llvm-project/pull/95075 accidentally removed the
`targets` section from `statistics dump --summary`. Adding it back, by
setting the default value to `true` in
`StatisticsOptions::GetIncludeTargets()`.

Updated the description for the options.
Updated tests.


# Verification

Manually verified the fix by running `statist dump --summary` and
comparing three versions of LLDB (in commit order):
1. Before https://github.com/llvm/llvm-project/pull/95075
2. After https://github.com/llvm/llvm-project/pull/95075
3. After this fix

The expected result is that 1 and 3 give the same sections, while 2 is
missing the `targets` section when in summary mode. The output (see
Appendix) matches the expectation.


# Appendix: Manual Test Output

## `statistics dump --summary` of 1

```
(lldb) statistics dump --summary
{
  "memory": {
    "strings": {
      "bytesTotal": 724992,
      "bytesUnused": 714547,
      "bytesUsed": 10445
    }
  },
  "targets": [
    {
      "sourceMapDeduceCount": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 597,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.00070699999999999995,
  "totalDebugInfoParseTime": 2.5999999999999998e-05,
  "totalModuleCount": 1,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolTableIndexTime": 0.000223,
  "totalSymbolTableParseTime": 0.00025799999999999998,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0
}
(lldb)
```

## `statistics dump --summary` of 3

Should be the same as above.

```
(lldb) statistics dump --summary
{
  "memory": {
    "strings": {
      "bytesTotal": 516096,
      "bytesUnused": 510353,
      "bytesUsed": 5743
    }
  },
  "targets": [
    {
      "sourceMapDeduceCount": 0,
      "totalSharedLibraryEventHitCount": 0
    }
  ],
  "totalDebugInfoByteSize": 597,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.0022139999999999998,
  "totalDebugInfoParseTime": 0.00031700000000000001,
  "totalModuleCount": 1,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolTableIndexTime": 0.0014499999999999999,
  "totalSymbolTableParseTime": 0.001848,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0
}
(lldb)
```

## `statistics dump --summary` of 2

Should be missing the `targets` section.

```
(lldb) statistics dump --summary
{
  "memory": {
    "strings": {
      "bytesTotal": 716800,
      "bytesUnused": 705887,
      "bytesUsed": 10913
    }
  },
  "totalDebugInfoByteSize": 597,
  "totalDebugInfoEnabled": 1,
  "totalDebugInfoIndexLoadedFromCache": 0,
  "totalDebugInfoIndexSavedToCache": 0,
  "totalDebugInfoIndexTime": 0.001374,
  "totalDebugInfoParseTime": 0.000174,
  "totalModuleCount": 1,
  "totalModuleCountHasDebugInfo": 1,
  "totalModuleCountWithIncompleteTypes": 0,
  "totalModuleCountWithVariableErrors": 0,
  "totalSymbolTableIndexTime": 0.00068300000000000001,
  "totalSymbolTableParseTime": 0.0010139999999999999,
  "totalSymbolTableStripped": 0,
  "totalSymbolTablesLoadedFromCache": 0,
  "totalSymbolTablesSavedToCache": 0
}
(lldb)
```

Co-authored-by: royshi <royshi at meta.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list