[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -133,7 +133,7 @@ struct ConstStringStats { /// A class that represents statistics for a since lldb_private::Target. class TargetStats { public: - llvm::json::Value ToJSON(Target &target); + llvm::json::Value ToJSON(Target &target, bool summary_only = false); --

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -171,9 +171,14 @@ class DebuggerStats { /// The single target to emit statistics for if non NULL, otherwise dump /// statistics only for the specified target. /// + /// \param summary_only + /// If true, only report high level summary statistics without + ///

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -83,13 +86,15 @@ class CommandObjectStatsDump : public CommandObjectParsed { void OptionParsingStarting(ExecutionContext *execution_context) override { m_all_targets = false; + m_summary_only = false; } llvm::ArrayRef GetDefinitions() override {

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -86,9 +86,13 @@ class LLDB_API SBTarget { /// Returns a dump of the collected statistics. /// + /// \param[in] summary_only + /// If true, only report high level summary statistics without + /// targets/modules/breakpoints etc.. details. + /// /// \return

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -1599,7 +1599,7 @@ class Target : public std::enable_shared_from_this, /// /// \return /// Returns a JSON value that contains all target metrics. - llvm::json::Value ReportStatistics(); + llvm::json::Value ReportStatistics(bool summary_only = false); ---

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -197,17 +197,18 @@ SBDebugger SBTarget::GetDebugger() const { return debugger; } -SBStructuredData SBTarget::GetStatistics() { +SBStructuredData SBTarget::GetStatistics(bool summary_only) { clayborg wrote: pass in const `SBStatisticsOptions options` inst

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -4962,4 +4962,6 @@ std::recursive_mutex &Target::GetAPIMutex() { } /// Get metrics associated with this target in JSON format. -llvm::json::Value Target::ReportStatistics() { return m_stats.ToJSON(*this); } +llvm::json::Value Target::ReportStatistics(bool summary_only) { --

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -326,7 +330,7 @@ class LLDB_API SBTarget { uint32_t GetAddressByteSize(); const char *GetTriple(); - + clayborg wrote: revert whitespace only changes https://github.com/llvm/llvm-project/pull/80745 ___ lld

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -100,60 +101,91 @@ llvm::json::Value ConstStringStats::ToJSON() const { return obj; } -json::Value TargetStats::ToJSON(Target &target) { - CollectStats(target); +json::Value TargetStats::ToJSON(Target &target, bool summary_only) { clayborg wrote: Pass i

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -2687,7 +2687,7 @@ uint64_t SymbolFileDWARF::GetDebugInfoSize() { if (cu == nullptr) continue; -SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile(); +SymbolFileDWARFDwo *dwo = cu->GetDwoSymbolFile(false); clayborg wrote: This bool might need

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -83,13 +86,15 @@ class CommandObjectStatsDump : public CommandObjectParsed { void OptionParsingStarting(ExecutionContext *execution_context) override { m_all_targets = false; + m_summary_only = false; } llvm::ArrayRef GetDefinitions() override {

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Alex Langford via lldb-commits
https://github.com/bulbazord edited https://github.com/llvm/llvm-project/pull/80745 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Alex Langford via lldb-commits
https://github.com/bulbazord requested changes to this pull request. Haven't looked over everything yet but this has an ABI-breaking change. Please revert the existing changes to SBTarget. https://github.com/llvm/llvm-project/pull/80745 ___ lldb-commi

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Alex Langford via lldb-commits
@@ -86,9 +86,13 @@ class LLDB_API SBTarget { /// Returns a dump of the collected statistics. /// + /// \param[in] summary_only + /// If true, only report high level summary statistics without + /// targets/modules/breakpoints etc.. details. + /// /// \return

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Alex Langford via lldb-commits
@@ -186,6 +186,10 @@ class SymbolFileDWARF : public SymbolFileCommon { GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector &mangled_names) override; + // Return total currently loaded debug info. + // For cases like

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Alex Langford via lldb-commits
@@ -241,7 +241,7 @@ class DWARFUnit : public UserID { FileSpec GetFile(size_t file_idx); FileSpec::Style GetPathStyle(); - SymbolFileDWARFDwo *GetDwoSymbolFile(); + SymbolFileDWARFDwo *GetDwoSymbolFile(bool load_if_needed = true); bulbazord wrote: Inste

[Lldb-commits] [libc] [clang-tools-extra] [openmp] [libcxx] [compiler-rt] [lldb] [mlir] [llvm] [lld] [flang] [clang] [Driver] Report invalid target triple versions for all environment types. (PR #7865

2024-02-05 Thread Fangrui Song via lldb-commits
MaskRay wrote: > > There's apparently also wasm32-wasi-preview2 and wasm32-wasi-pthread, which > > I suppose are equally broken by this change. > > Yes, I think so. I think adding these environment types in wasi-libc repo > could help fix those errors. If wasm can arbitrary environment types,

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
https://github.com/jeffreytan81 created https://github.com/llvm/llvm-project/pull/80767 We have a Python script that needs to locate coredump path during debugging so that we can retrieve certain metadata files associated with it. Currently, there is no API for this. This patch adds a new `SB

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
https://github.com/jeffreytan81 ready_for_review https://github.com/llvm/llvm-project/pull/80767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: None (jeffreytan81) Changes We have a Python script that needs to locate coredump path during debugging so that we can retrieve certain metadata files associated with it. Currently, there is no API for this. This patch adds a new `SBProce

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff a7bc9cb6ffa91ff0ebabc45c0c7263c7c2c3a4de e7af15ff3c1bdd42799b25f76145b8a19739eea5 --

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Alex Langford via lldb-commits
bulbazord wrote: I'm not sure I understand. Why do you need to get the path to the core file through the SBAPI? Didn't you also load it through the SBAPI too? https://github.com/llvm/llvm-project/pull/80767 ___ lldb-commits mailing list lldb-commits@l

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -398,6 +398,13 @@ class LLDB_API SBProcess { /// valid. lldb::SBProcessInfo GetProcessInfo(); + /// Return target dump file during postmortem debugging. + /// An empty file will be returned for live debugging. + /// + /// \return + /// The target dump file spec

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/80767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to this pull request. https://github.com/llvm/llvm-project/pull/80767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -224,7 +224,7 @@ Status ProcessElfCore::DoLoadCore() { ArchSpec core_arch(m_core_module_sp->GetArchitecture()); target_arch.MergeFrom(core_arch); GetTarget().SetArchitecture(target_arch); - + clayborg wrote: revert whitespace only change https://git

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -865,7 +865,7 @@ llvm::Error ProcessElfCore::parseOpenBSDNotes(llvm::ArrayRef notes) { /// - NT_SIGINFO - Information about the signal that terminated the process /// - NT_AUXV - Process auxiliary vector /// - NT_FILE - Files mapped into memory -/// +/// c

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -398,6 +398,13 @@ class LLDB_API SBProcess { /// valid. lldb::SBProcessInfo GetProcessInfo(); + /// Return target dump file during postmortem debugging. + /// An empty file will be returned for live debugging. clayborg wrote: ``` /// Get the file spe

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -398,6 +398,13 @@ class LLDB_API SBProcess { /// valid. lldb::SBProcessInfo GetProcessInfo(); + /// Return target dump file during postmortem debugging. + /// An empty file will be returned for live debugging. + /// + /// \return + /// The target dump file spec

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -261,7 +261,7 @@ Status ProcessElfCore::DoLoadCore() { exe_module_spec.GetFileSpec().SetFile(m_nt_file_entries[0].path, FileSpec::Style::native); if (exe_module_spec.GetFileSpec()) { -exe_module_sp = GetTarget()

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -1244,6 +1244,17 @@ lldb::SBProcessInfo SBProcess::GetProcessInfo() { return sb_proc_info; } +lldb::SBFileSpec SBProcess::GetCoreFile() { + LLDB_INSTRUMENT_VA(this); + + ProcessSP process_sp(GetSP()); + FileSpec core_file; + if (process_sp) { +core_file = process_

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -404,7 +404,7 @@ bool ProcessMachCore::LoadBinariesViaMetadata() { // LoadCoreFileImges may have set the dynamic loader, e.g. in // PlatformDarwinKernel::LoadPlatformBinaryAndSetup(). - // If we now have a dynamic loader, save its name so we don't + // If we now have

[Lldb-commits] [lldb] [lldb][libc++] Adds system_clock data formatters. (PR #78609)

2024-02-05 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: Agreed, if I change this to ``` diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp index d0bdbe1fd4d..b37544f6dd3 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp +++ b/lldb/source/Plugins/Languag

[Lldb-commits] [lld] [clang] [compiler-rt] [libcxx] [clang-tools-extra] [mlir] [llvm] [openmp] [libc] [flang] [lldb] [Driver] Report invalid target triple versions for all environment types. (PR #7865

2024-02-05 Thread via lldb-commits
ZijunZhaoCCK wrote: > > > There's apparently also wasm32-wasi-preview2 and wasm32-wasi-pthread, > > > which I suppose are equally broken by this change. > > > > > > Yes, I think so. I think adding these environment types in wasi-libc repo > > could help fix those errors. > > If wasm can arbi

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Jason Molenda via lldb-commits
@@ -398,6 +398,13 @@ class LLDB_API SBProcess { /// valid. lldb::SBProcessInfo GetProcessInfo(); + /// Return target dump file during postmortem debugging. + /// An empty file will be returned for live debugging. + /// + /// \return + /// The target dump file spec

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Jason Molenda via lldb-commits
@@ -1244,6 +1244,17 @@ lldb::SBProcessInfo SBProcess::GetProcessInfo() { return sb_proc_info; } +lldb::SBFileSpec SBProcess::GetCoreFile() { + LLDB_INSTRUMENT_VA(this); + + ProcessSP process_sp(GetSP()); + FileSpec core_file; + if (process_sp) { +core_file = process_

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: This seems like a useful addition to me, I've had some users of corefiles who have asked for an SBProcess::IsCore() type of method. (and others asking for ways to access metadata from the corefile itself via the Process, although I've never thought about how to do that, ma

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Jason Molenda via lldb-commits
@@ -1244,6 +1244,17 @@ lldb::SBProcessInfo SBProcess::GetProcessInfo() { return sb_proc_info; } +lldb::SBFileSpec SBProcess::GetCoreFile() { + LLDB_INSTRUMENT_VA(this); + + ProcessSP process_sp(GetSP()); + FileSpec core_file; + if (process_sp) { +core_file = process_

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda edited https://github.com/llvm/llvm-project/pull/80767 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
@@ -398,6 +398,13 @@ class LLDB_API SBProcess { /// valid. lldb::SBProcessInfo GetProcessInfo(); + /// Return target dump file during postmortem debugging. + /// An empty file will be returned for live debugging. + /// + /// \return + /// The target dump file spec

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
jeffreytan81 wrote: @bulbazord, the scenario is that user directly uses "lldb -c " to load core file, then the python script is invoked later to fetch metadata, resolve binaries/symbols etc... https://github.com/llvm/llvm-project/pull/80767 ___ lldb-

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
https://github.com/jeffreytan81 updated https://github.com/llvm/llvm-project/pull/80767 >From e7af15ff3c1bdd42799b25f76145b8a19739eea5 Mon Sep 17 00:00:00 2001 From: jeffreytan81 Date: Mon, 5 Feb 2024 15:58:23 -0800 Subject: [PATCH 1/2] Add a new SBProcess:: GetCoreFile() API --- lldb/include

[Lldb-commits] [lldb] Add a new SBProcess:: GetCoreFile() API (PR #80767)

2024-02-05 Thread via lldb-commits
https://github.com/jeffreytan81 updated https://github.com/llvm/llvm-project/pull/80767 >From e7af15ff3c1bdd42799b25f76145b8a19739eea5 Mon Sep 17 00:00:00 2001 From: jeffreytan81 Date: Mon, 5 Feb 2024 15:58:23 -0800 Subject: [PATCH 1/3] Add a new SBProcess:: GetCoreFile() API --- lldb/include

[Lldb-commits] [lldb] [LLDB] Add FreeBSD kernel coredump matching check. (PR #80785)

2024-02-05 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 78b4e7c5e349d8c101b50affbd260eb109748f8f e506f292dd07bcdd26a668d9fcf87a258864db95 --

[Lldb-commits] [lldb] [lldb][unittest] Add call_once flag to initialize debugger (PR #80786)

2024-02-05 Thread Chelsea Cassanova via lldb-commits
https://github.com/chelcassanova created https://github.com/llvm/llvm-project/pull/80786 I tried adding a new unit test to the core test suite (https://github.com/llvm/llvm-project/pull/79533) but it broke the test suite on AArch64 Linux due to hitting an assertion for calling `Debugger::Initi

[Lldb-commits] [lldb] [lldb][unittest] Add call_once flag to initialize debugger (PR #80786)

2024-02-05 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Chelsea Cassanova (chelcassanova) Changes I tried adding a new unit test to the core test suite (https://github.com/llvm/llvm-project/pull/79533) but it broke the test suite on AArch64 Linux due to hitting an assertion for calling `Debugge

[Lldb-commits] [lldb] [LLDB] Add FreeBSD kernel coredump matching check. (PR #80785)

2024-02-05 Thread via lldb-commits
https://github.com/aokblast updated https://github.com/llvm/llvm-project/pull/80785 >From 5f9eac19a45cd4b71afe48643fc0cf8b4b4ab6be Mon Sep 17 00:00:00 2001 From: aokblast Date: Tue, 6 Feb 2024 10:18:34 +0800 Subject: [PATCH 1/2] [LLDB] Fetch UUID from note section in coredump --- .../Plugins/

[Lldb-commits] [lldb] [lldb][unittest] Add call_once flag to initialize debugger (PR #80786)

2024-02-05 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 0d091206dd656c2a9d31d6088a4aa6f9c2cc7156 2fa99391c097def91369c164195ad2a4a1cd98ed --

[Lldb-commits] [lldb] [lldb][unittest] Add call_once flag to initialize debugger (PR #80786)

2024-02-05 Thread Jason Molenda via lldb-commits
jasonmolenda wrote: Did you mean to include changes to DiagnosticEventTest.cpp and ProgressReportTest.cpp to use this new global? https://github.com/llvm/llvm-project/pull/80786 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.l

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread via lldb-commits
@@ -83,13 +86,15 @@ class CommandObjectStatsDump : public CommandObjectParsed { void OptionParsingStarting(ExecutionContext *execution_context) override { m_all_targets = false; + m_summary_only = false; } llvm::ArrayRef GetDefinitions() override {

[Lldb-commits] [lldb] [lldb][unittest] Use shared once_flag in DiagnosticEventTest (PR #80788)

2024-02-05 Thread Chelsea Cassanova via lldb-commits
https://github.com/chelcassanova created https://github.com/llvm/llvm-project/pull/80788 Incorporates the changes from https://github.com/llvm/llvm-project/pull/80786 to use a once_flag from `TestUtilities` instead of a local flag in order to prevent hitting an assertion that the debugger was

[Lldb-commits] [lldb] [lldb][unittest] Use shared once_flag in DiagnosticEventTest (PR #80788)

2024-02-05 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Chelsea Cassanova (chelcassanova) Changes Incorporates the changes from https://github.com/llvm/llvm-project/pull/80786 to use a once_flag from `TestUtilities` instead of a local flag in order to prevent hitting an assertion that the debug

[Lldb-commits] [lldb] [lldb][unittest] Add call_once flag to initialize debugger (PR #80786)

2024-02-05 Thread Chelsea Cassanova via lldb-commits
chelcassanova wrote: I did, I'm adding them as separate patches. DiagnosticEventTest.cpp could probably go here since it's a simple change but ProgressEventTest doesn't exist upstream yet since I had to revert so I think that at least should be it's own PR> https://github.com/llvm/llvm-projec

[Lldb-commits] [lldb] [lldb][unittest] Add call_once flag to initialize debugger (PR #80786)

2024-02-05 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/80786 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/80745 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -130,10 +130,14 @@ struct ConstStringStats { ConstString::MemoryStats stats = ConstString::GetMemoryStats(); }; +struct StatisticsOptions { + bool summary_only = false; +}; + /// A class that represents statistics for a since lldb_private::Target. class TargetStats {

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
https://github.com/clayborg requested changes to this pull request. https://github.com/llvm/llvm-project/pull/80745 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -198,16 +198,24 @@ SBDebugger SBTarget::GetDebugger() const { } SBStructuredData SBTarget::GetStatistics() { + LLDB_INSTRUMENT_VA(this); + SBStatisticsOptions options; + options.SetSummaryOnly(false); clayborg wrote: This defaults to false right? I wou

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -100,60 +101,91 @@ llvm::json::Value ConstStringStats::ToJSON() const { return obj; } -json::Value TargetStats::ToJSON(Target &target) { - CollectStats(target); +json::Value TargetStats::ToJSON(Target &target, bool summary_only) { clayborg wrote: This f

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,46 @@ +//===-- SBStatisticsOptions.cpp ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -83,13 +86,21 @@ class CommandObjectStatsDump : public CommandObjectParsed { void OptionParsingStarting(ExecutionContext *execution_context) override { m_all_targets = false; + m_summary_only = false; } llvm::ArrayRef GetDefinitions() override {

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -83,13 +86,21 @@ class CommandObjectStatsDump : public CommandObjectParsed { void OptionParsingStarting(ExecutionContext *execution_context) override { m_all_targets = false; + m_summary_only = false; } llvm::ArrayRef GetDefinitions() override {

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,31 @@ +//===-- SBStatisticsOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -75,6 +75,9 @@ class CommandObjectStatsDump : public CommandObjectParsed { case 'a': m_all_targets = true; break; + case 's': +m_summary_only = true; clayborg wrote: See comment about storing a different ivar below, then t

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -198,16 +198,24 @@ SBDebugger SBTarget::GetDebugger() const { } SBStructuredData SBTarget::GetStatistics() { + LLDB_INSTRUMENT_VA(this); + SBStatisticsOptions options; + options.SetSummaryOnly(false); + return GetStatistics(options); +} + +SBStructuredData SBTarget::Ge

[Lldb-commits] [lldb] Support statistics dump summary only mode (PR #80745)

2024-02-05 Thread Greg Clayton via lldb-commits
@@ -0,0 +1,31 @@ +//===-- SBStatisticsOptions.h ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

<    1   2