Skip to content

Commit 0542e00

Browse files
authored
Revert "Support statistics dump summary only mode (#80745)"
This reverts commit 2217837.
1 parent 4476727 commit 0542e00

File tree

19 files changed

+87
-297
lines changed

19 files changed

+87
-297
lines changed

lldb/bindings/headers.swig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
#include "lldb/API/SBScriptObject.h"
5555
#include "lldb/API/SBSection.h"
5656
#include "lldb/API/SBSourceManager.h"
57-
#include "lldb/API/SBStatisticsOptions.h"
5857
#include "lldb/API/SBStream.h"
5958
#include "lldb/API/SBStringList.h"
6059
#include "lldb/API/SBStructuredData.h"

lldb/bindings/interface/SBStatisticsOptionsDocStrings.i

Lines changed: 0 additions & 8 deletions
This file was deleted.

lldb/bindings/interfaces.swig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
%include "./interface/SBReproducerDocstrings.i"
5757
%include "./interface/SBSectionDocstrings.i"
5858
%include "./interface/SBSourceManagerDocstrings.i"
59-
%include "./interface/SBStatisticsOptionsDocstrings.i"
6059
%include "./interface/SBStreamDocstrings.i"
6160
%include "./interface/SBStringListDocstrings.i"
6261
%include "./interface/SBStructuredDataDocstrings.i"
@@ -132,7 +131,6 @@
132131
%include "lldb/API/SBScriptObject.h"
133132
%include "lldb/API/SBSection.h"
134133
%include "lldb/API/SBSourceManager.h"
135-
%include "lldb/API/SBStatisticsOptions.h"
136134
%include "lldb/API/SBStream.h"
137135
%include "lldb/API/SBStringList.h"
138136
%include "lldb/API/SBStructuredData.h"

lldb/include/lldb/API/LLDB.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
#include "lldb/API/SBReproducer.h"
5757
#include "lldb/API/SBSection.h"
5858
#include "lldb/API/SBSourceManager.h"
59-
#include "lldb/API/SBStatisticsOptions.h"
6059
#include "lldb/API/SBStream.h"
6160
#include "lldb/API/SBStringList.h"
6261
#include "lldb/API/SBStructuredData.h"

lldb/include/lldb/API/SBDefines.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class LLDB_API SBReproducer;
9999
class LLDB_API SBScriptObject;
100100
class LLDB_API SBSection;
101101
class LLDB_API SBSourceManager;
102-
class LLDB_API SBStatisticsOptions;
103102
class LLDB_API SBStream;
104103
class LLDB_API SBStringList;
105104
class LLDB_API SBStructuredData;

lldb/include/lldb/API/SBStatisticsOptions.h

Lines changed: 0 additions & 36 deletions
This file was deleted.

lldb/include/lldb/API/SBTarget.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "lldb/API/SBFileSpec.h"
1818
#include "lldb/API/SBFileSpecList.h"
1919
#include "lldb/API/SBLaunchInfo.h"
20-
#include "lldb/API/SBStatisticsOptions.h"
2120
#include "lldb/API/SBSymbolContextList.h"
2221
#include "lldb/API/SBType.h"
2322
#include "lldb/API/SBValue.h"
@@ -91,15 +90,6 @@ class LLDB_API SBTarget {
9190
/// A SBStructuredData with the statistics collected.
9291
lldb::SBStructuredData GetStatistics();
9392

94-
/// Returns a dump of the collected statistics.
95-
///
96-
/// \param[in] options
97-
/// An objects object that contains all options for the statistics dumping.
98-
///
99-
/// \return
100-
/// A SBStructuredData with the statistics collected.
101-
lldb::SBStructuredData GetStatistics(SBStatisticsOptions options);
102-
10393
/// Return the platform object associated with the target.
10494
///
10595
/// After return, the platform object should be checked for

lldb/include/lldb/Target/Statistics.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,10 @@ struct ConstStringStats {
130130
ConstString::MemoryStats stats = ConstString::GetMemoryStats();
131131
};
132132

133-
struct StatisticsOptions {
134-
bool summary_only = false;
135-
};
136-
137133
/// A class that represents statistics for a since lldb_private::Target.
138134
class TargetStats {
139135
public:
140-
llvm::json::Value ToJSON(Target &target,
141-
const lldb_private::StatisticsOptions &options);
136+
llvm::json::Value ToJSON(Target &target);
142137

143138
void SetLaunchOrAttachTime();
144139
void SetFirstPrivateStopTime();
@@ -176,15 +171,9 @@ class DebuggerStats {
176171
/// The single target to emit statistics for if non NULL, otherwise dump
177172
/// statistics only for the specified target.
178173
///
179-
/// \param summary_only
180-
/// If true, only report high level summary statistics without
181-
/// targets/modules/breakpoints etc.. details.
182-
///
183174
/// \return
184175
/// Returns a JSON value that contains all target metrics.
185-
static llvm::json::Value
186-
ReportStatistics(Debugger &debugger, Target *target,
187-
const lldb_private::StatisticsOptions &options);
176+
static llvm::json::Value ReportStatistics(Debugger &debugger, Target *target);
188177

189178
protected:
190179
// Collecting stats can be set to true to collect stats that are expensive

lldb/include/lldb/Target/Target.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,7 @@ class Target : public std::enable_shared_from_this<Target>,
15991599
///
16001600
/// \return
16011601
/// Returns a JSON value that contains all target metrics.
1602-
llvm::json::Value
1603-
ReportStatistics(const lldb_private::StatisticsOptions &options);
1602+
llvm::json::Value ReportStatistics();
16041603

16051604
TargetStats &GetStatistics() { return m_stats; }
16061605

lldb/include/lldb/lldb-forward.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ struct CompilerContext;
298298
struct LineEntry;
299299
struct PropertyDefinition;
300300
struct ScriptSummaryFormat;
301-
struct StatisticsOptions;
302301
struct StringSummaryFormat;
303302
template <unsigned N> class StreamBuffer;
304303

lldb/source/API/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ add_lldb_library(liblldb SHARED ${option_framework}
6969
SBScriptObject.cpp
7070
SBSection.cpp
7171
SBSourceManager.cpp
72-
SBStatisticsOptions.cpp
7372
SBStream.cpp
7473
SBStringList.cpp
7574
SBStructuredData.cpp

lldb/source/API/SBStatisticsOptions.cpp

Lines changed: 0 additions & 49 deletions
This file was deleted.

lldb/source/API/SBTarget.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,22 +199,15 @@ SBDebugger SBTarget::GetDebugger() const {
199199

200200
SBStructuredData SBTarget::GetStatistics() {
201201
LLDB_INSTRUMENT_VA(this);
202-
SBStatisticsOptions options;
203-
return GetStatistics(options);
204-
}
205-
206-
SBStructuredData SBTarget::GetStatistics(SBStatisticsOptions options) {
207-
LLDB_INSTRUMENT_VA(this);
208202

209203
SBStructuredData data;
210204
TargetSP target_sp(GetSP());
211205
if (!target_sp)
212206
return data;
213207
std::string json_str =
214-
llvm::formatv("{0:2}", DebuggerStats::ReportStatistics(
215-
target_sp->GetDebugger(), target_sp.get(),
216-
options.ref()))
217-
.str();
208+
llvm::formatv("{0:2}",
209+
DebuggerStats::ReportStatistics(target_sp->GetDebugger(),
210+
target_sp.get())).str();
218211
data.m_impl_up->SetObjectSP(StructuredData::ParseJSON(json_str));
219212
return data;
220213
}

lldb/source/Commands/CommandObjectStats.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ class CommandObjectStatsDump : public CommandObjectParsed {
7575
case 'a':
7676
m_all_targets = true;
7777
break;
78-
case 's':
79-
m_stats_options.summary_only = true;
80-
break;
8178
default:
8279
llvm_unreachable("Unimplemented option");
8380
}
@@ -86,17 +83,13 @@ class CommandObjectStatsDump : public CommandObjectParsed {
8683

8784
void OptionParsingStarting(ExecutionContext *execution_context) override {
8885
m_all_targets = false;
89-
m_stats_options = StatisticsOptions();
9086
}
9187

9288
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
9389
return llvm::ArrayRef(g_statistics_dump_options);
9490
}
9591

96-
const StatisticsOptions &GetStatisticsOptions() { return m_stats_options; }
97-
9892
bool m_all_targets = false;
99-
StatisticsOptions m_stats_options = StatisticsOptions();
10093
};
10194

10295
public:
@@ -116,8 +109,7 @@ class CommandObjectStatsDump : public CommandObjectParsed {
116109
target = m_exe_ctx.GetTargetPtr();
117110

118111
result.AppendMessageWithFormatv(
119-
"{0:2}", DebuggerStats::ReportStatistics(
120-
GetDebugger(), target, m_options.GetStatisticsOptions()));
112+
"{0:2}", DebuggerStats::ReportStatistics(GetDebugger(), target));
121113
result.SetStatus(eReturnStatusSuccessFinishResult);
122114
}
123115

lldb/source/Commands/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,4 @@ let Command = "trace schema" in {
14121412
let Command = "statistics dump" in {
14131413
def statistics_dump_all: Option<"all-targets", "a">, Group<1>,
14141414
Desc<"Include statistics for all targets.">;
1415-
def statistics_dump_summary: Option<"summary", "s">, Group<1>,
1416-
Desc<"Dump only high-level summary statistics."
1417-
"Exclude targets, modules, breakpoints etc... details.">;
14181415
}

0 commit comments

Comments
 (0)