[all-commits] [llvm/llvm-project] 5c310d: Default transcript dumping in "statistics dump" to...

qxy11 via All-commits all-commits at lists.llvm.org
Thu Jun 26 10:16:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5c310d1ef0188d609b1d2837d403d2b3f2eeb609
      https://github.com/llvm/llvm-project/commit/5c310d1ef0188d609b1d2837d403d2b3f2eeb609
  Author: qxy11 <qxy11 at meta.com>
  Date:   2025-06-26 (Thu, 26 Jun 2025)

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

  Log Message:
  -----------
  Default transcript dumping in "statistics dump" to false (#145436)

### Summary
Currently, if the setting `interpreter.save-transcript` is enabled,
whenever we call "statistics dump", it'll default to reporting a huge
list of transcripts which can be a bit noisy. This is because the
current check `GetIncludeTranscript` returns `!GetSummaryOnly()` by
default if no specific transcript-setting option is given in the
statistics dump command (ie. `statistics dump --transcripts=false` or
`statistics dump --transcripts=true`). Then when
`interpreter.save-transcript` is enabled, this saves a list of
transcripts, and the transcript list ends up getting logged by default.

These changes default the option to log transcripts in the `statistics
dump` command to "false". This can still be enabled via the
`--transcripts` option if users want to see a transcript. Since
`interpreter.save-transcript` is false by default, the main delta is
that if `interpreter.save-transcript` is true and summary mode is false,
we now disable saving the transcript.

This also adds a warning to 'statistics dump --transcript=true' when
interpreter.save-transcript is disabled, which should help users
understand
why transcript data is empty.

### Testing

#### Manual testing
Tested with `settings set interpreter.save-transcript true` enabled at
startup on a toy hello-world program:
```
(lldb) settings set interpreter.save-transcript true
(lldb) target create "/home/qxy11/hello-world/a.out"
Current executable set to '/home/qxy11/hello-world/a.out' (x86_64).
(lldb) statistics dump
{
  /* no transcript */
}
(lldb) statistics dump --transcript=true
{
"transcript": [
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "durationInSeconds": 0.0019650000000000002,
      "error": "",
      "output": "{...
    },
    {
      "command": "statistics dump --transcript=true",
      "commandArguments": "--transcript=true",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1750720021
    }
  ]
}
```
Without `settings set interpreter.save-transcript true`:
```
(lldb) target create "/home/qxy11/hello-world/a.out"
Current executable set to '/home/qxy11/hello-world/a.out' (x86_64).
(lldb) statistics dump
{
  /* no transcript */
}
(lldb) statistics dump --transcript=true
{
  /* no transcript */
}
warning: transcript requested but none was saved. Enable with 'settings set interpreter.save-transcript true'
```

#### Unit tests
Changed unit tests to account for new expected default behavior to
`false`, and added a couple new tests around expected behavior with
`--transcript=true`.
```
lldb-dotest -p TestStats ~/llvm-sand/external/llvm-project/lldb/test/API/commands/statistics/basic/
```



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