7 Commits

Author SHA1 Message Date
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
51c91095ab
Reapply "Make llvm::telemetry::Manager::preDispatch protected. (#127114) (#127431)
This reverts commit 66465c3b0ab1b32403ad5a1c3114174d87830f54.

New change: added missing return statement.
2025-02-17 20:59:12 -05:00
Kazu Hirata
66465c3b0a Revert "Make llvm::telemetry::Manager::preDispatch protected. (#127114)"
This reverts commit f7a2d70bd91094e7a85f7e189602c826a3eeb6cd.

Multiple buildbot failures have been reported.  See:
https://github.com/llvm/llvm-project/pull/127114
2025-02-14 21:23:33 -08:00
Vy Nguyen
f7a2d70bd9
Make llvm::telemetry::Manager::preDispatch protected. (#127114)
The method was meant to be overriden by subclasses only.
It should not be called directly by users
2025-02-14 22:12:04 -05:00
Vy Nguyen
dbae7176a6
Reapply "[llvm]Add a simple Telemetry framework" (#120769) (#121003)
This reverts commit 2ec6174bef4bc9ef3d5cedbffd7169017c9669c3.

New changes:
 - Use explicit overloads of write(<int types>)
 - Fix link error due to missing dependency (lib/Support)
 - Updated tests and docs
2024-12-23 17:23:43 -05:00
Vy Nguyen
2ec6174bef
Revert "[llvm]Add a simple Telemetry framework" (#120769)
Reverts llvm/llvm-project#102323
Reason: broke CI
2024-12-20 11:27:04 -05:00
Vy Nguyen
8c0090030b
[llvm]Add a simple Telemetry framework (#102323)
Objective:

- Provide a common framework in LLVM for collecting various usage
metrics
-  Characteristics: 
  -   Extensible and configurable by: 
    -  tools in LLVM that want to use it 
    -  vendors in their downstream codebase 
    -  tools users (as allowed by vendor)


Background:
The framework was originally proposed only for LLDB, but there were
quite a few requests  to move it to llvm/lib given telemetry
is a common use case in a lot of tools, not just LLDB.

See more details on the design and discussions here on the RFC:
https://discourse.llvm.org/t/rfc-lldb-telemetry-metrics/64588/20?u=oontvoo

---------

Co-authored-by: Alina Sbirlea <alina.g.simion@gmail.com>
Co-authored-by: James Henderson <James.Henderson@sony.com>
Co-authored-by: Pavel Labath <pavel@labath.sk>
2024-12-20 11:04:55 -05:00