9 Commits

Author SHA1 Message Date
Vy Nguyen
a088b0ec76
[LLDB][Telemetry]Define DebuggerTelemetryInfo and related methods (#127696)
This type of entry is used to collect data about the debugger
startup/exit

Also introduced a helper ScopedDispatcher
---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-03-03 10:07:54 -05:00
Vy Nguyen
159b872b37
[llvm][telemetry]Change Telemetry-disabling mechanism. (#128534)
Details:
- Previously, we used the LLVM_BUILD_TELEMETRY flag to control whether
any Telemetry code will be built. This has proven to cause more nuisance
to both users of the Telemetry and any further extension of it. (Eg., we
needed to put #ifdef around caller/user code)

- So the new approach is to:
+ Remove this flag and introduce LLVM_ENABLE_TELEMETRY which would be
true by default.
+ If LLVM_ENABLE_TELEMETRY is set to FALSE (at buildtime), the library
would still be built BUT Telemetry cannot be enabled. And no data can be
collected.

The benefit of this is that it simplifies user (and extension) code
since we just need to put the check on Config::EnableTelemetry. Besides,
the Telemetry library itself is very small, hence the additional code to
be built would not cause any difference in build performance.

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-02-26 13:01:53 -05:00
Vy Nguyen
62ec7b8de9
[LLDB][NFC]Renaming functions to be consistent with LLDB naming style (#128574) 2025-02-24 20:21:16 -05:00
Vy Nguyen
55dba06540
Addressed additional review comments from PR/119716. (#126757) 2025-02-18 11:13:55 -05:00
Vy Nguyen
e1a393e392
Define Telemetry plugin for LLDB. (#126588)
Details:

Make LLDB's TelemetryManager a "plugin" so that vendor can supply
appropriate implementation.
The rest of LLDB code will simply call `TelemetryManager::getInstance`

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-02-18 10:44:16 -05:00
Vy Nguyen
fc4d87100a
Define -DLLVM_BUILD_TELEMETRY to be used in ifdef (#126746)
Background: 

Telemetry code isn't always built (controlled by this
LLVM_BUILD_TELEMETRY cmake flag)
This means users of the library may not have the library. So we're
definding the `-DLLVM_BUILD_TELEMETRY` to be used in ifdef.
2025-02-12 09:33:52 -05:00
Michał Górny
bf2d4eb703
[lldb] Use preprocessor guard for LLVM_BUILD_TELEMETRY (#126715)
Use a preprocessor `#ifdef LLVM_BUILD_TELEMETRY` guard rather than
`PARTIAL_SOURCES_INTENDED` for the `Telemetry.cpp` file, to fix building
with telemetry disabled. `PARTIAL_SOURCES_INTENDED` does not currently
work in `lldb_add_library()`, and while it could be fixed, it seems to
be used contrary to its purpose — in other parts of LLVM project, the
option is used to indicate that the sources found in the directory are
split between different targets (e.g. a library and a tool), not to
include sources conditionally.
2025-02-11 14:22:44 +00:00
Kazu Hirata
622b8edfc2 [lldb] Fix a warning
This patch fixes:

  lldb/source/Core/Telemetry.cpp:44:20: error: unused function
  'MakeUUID' [-Werror,-Wunused-function]
2025-02-10 15:54:57 -08:00
Vy Nguyen
50317ca13f
[lldb][telemetry] Implement LLDB Telemetry (part 1) (#119716)
Details:
- This is a subset of PR/98528.( Pavel's suggestion was to split up the
patch to make reviewing easier)
- This contains only the concrete implementation of the framework to be
used but no usages yet.
- I plan to send a few follow-up patches:
+ part2 : includes changes in the plugin-manager to set up the plugin
stuff (ie., how to create a default vs vendor impl)
  + part3 (all of the following can be done in parallel):
* part 3_a: define DebuggerTelemetryInfo and related methods to collect
data about debugger startup/exit
* part 3_b: define TargetTelemetryInfo and related methods to collect
data about debug target(s)
* part 3_c: define CommandTelemetryInfo and related methods to collect
data about debug-commands
* part 3_d: define ClientTelemtryInfo and related methods to collect
data about lldb-dap/any other client

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-02-10 13:59:52 -05:00