1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! `cu-profiler-core` — the Solana compute-intelligence engine.
//!
//! This crate owns the domain model, the Solana log parser, the CPI call-tree
//! and scope-marker analysis, the budget policy engine, baselines, confidence
//! scoring, and diagnostics. It depends on no CLI code and no live Solana
//! runtime by default: the [`backend::RecordedLogsBackend`] drives the entire
//! pipeline from logs, which is how the parser, reports and CI logic are
//! developed and tested.
//!
//! # Honesty about limitations
//! - Scope/function attribution requires explicit markers; there is no automatic
//! source-line profiling.
//! - `program-test` results may differ from mainnet runtime conditions.
//! - Baselines are only valid when their [`baseline::Fingerprint`] matches.
//!
//! # Example
//! ```
//! use cu_profiler_core::backend::RecordedLogsBackend;
//! use cu_profiler_core::metadata::RunMetadata;
//! use cu_profiler_core::scenario::Scenario;
//! use cu_profiler_core::Profiler;
//!
//! let mut backend = RecordedLogsBackend::new();
//! backend.insert_blob(
//! "swap",
//! "Program P invoke [1]\nProgram P consumed 1000 of 200000 compute units\nProgram P success",
//! true,
//! );
//! let report = Profiler::new().run(
//! &backend,
//! &[Scenario::new("swap")],
//! None,
//! RunMetadata::recorded(cu_profiler_core::VERSION),
//! );
//! assert_eq!(report.scenarios[0].measurement.total_cu, 1000);
//! ```
pub use ;
pub use Profiler;
/// The version of `cu-profiler-core`.
pub const VERSION: &str = env!;