18 Commits

Author SHA1 Message Date
Vy Nguyen
5548f4d5ef
[LLDB][NFC] Refactor code extracting timestamp from StructuredData (#145954)
Co-authored-by: Alex Langford <nirvashtzero@gmail.com>
2025-06-30 14:25:11 -04:00
Akash Agrawal
e4ed71818e
[LLDB] [NFC] - Remove duplicate #include headers from the files of lldb dir & few other files (#141478)
A few files of lldb dir & few other files had duplicate headers
included. This patch removes those redundancies.

---------

Co-authored-by: Akash Agrawal <akashag@qti.qualcomm.com>
2025-05-29 23:13:30 -07:00
Vy Nguyen
a74e4ac9d5
[LLDB][Telemetry] Collect telemetry from client when allowed. (#129728)
This patch is slightly different from other impl in that we dispatch
client-telemetry via a different helper method. This is to make it
easier for vendor to opt-out (simply by overriding the method to do
nothing). There is also a configuration option to disallow collecting
client telemetry.

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-04-26 02:19:29 +02:00
Jonas Devlieghere
ee60f7c7a4
[lldb] Hoist UUID generation into the UUID class (#133662)
Hoist UUID generation into the UUID class and add a trivial unit test.
This also changes the telemetry code to drop the double underscore if we
failed to generate a UUID and subsequently logs to the Host instead of
Object log channel.
2025-04-02 08:50:28 -07:00
Jonas Devlieghere
2796e41ade
[lldb] Remove unused Version.h include in Telemetry.cpp (NFC) 2025-03-30 15:56:14 -07:00
Vy Nguyen
ff21b50509
Reapply LLDB-Telemetry TargetInfo branch (pr/127834) (#132043)
New changes: add check to avoid accessing invalid obj
2025-03-20 18:05:06 -04:00
Pavel Labath
7dbcdd578c Revert "[LLDB][Telemetry]Define TargetInfo for collecting data about a target (#127834)"
This reverts commit 04e39ce3fddaaec41d9c7babcca55133d7e49969 due to test
breakage.
2025-03-19 09:51:10 +01:00
Vy Nguyen
04e39ce3fd
[LLDB][Telemetry]Define TargetInfo for collecting data about a target (#127834)
Co-authored-by: Pavel Labath <pavel@labath.sk>
2025-03-18 22:54:08 -04:00
Vy Nguyen
de9cee1c97
[LLDB][Telemetry]Define telemetry::CommandInfo (#129354)
and collect telemetry about a command's execution.

*NOTE: Please consider this PR a DRAFT ( Waiting on PR/127696 to be
submitted. )

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-03-07 05:59:05 -05:00
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