pyroscope-io 1.2.0__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyroscope_io-1.2.0/python/pyroscope_io.egg-info → pyroscope_io-1.2.2}/PKG-INFO +1 -1
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/pyproject.toml +1 -1
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2/python/pyroscope_io.egg-info}/PKG-INFO +1 -1
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/Cargo.lock +1 -1
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/Cargo.toml +1 -1
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/ffikit.rs +3 -3
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/pyroscope.rs +7 -50
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/LICENSE +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/MANIFEST.in +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/README.md +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/BundleStaticLibrary.cmake +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/CMakeLists.txt +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/Pyroscope.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc.cpp +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_debug.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_frame.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_gc_guard.hpp +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_heap.cpp +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_heap.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_reentrant.cpp +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_reentrant.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_tb.cpp +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_memalloc_tb.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/_pymacro.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/profiling_helpers/frame_accessors.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/profiling_helpers/linetable_parser.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/cpp/profiling_helpers/version_compat.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/python/pyroscope/__init__.py +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/python/pyroscope_io/__init__.py +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/python/pyroscope_io.egg-info/SOURCES.txt +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/python/pyroscope_io.egg-info/dependency_links.txt +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/python/pyroscope_io.egg-info/top_level.txt +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/build.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/include/pyroscope_ffi.h +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/backend/backend.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/backend/mod.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/backend/ruleset.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/backend/tests.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/backend/types.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/encode/gen/google.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/encode/gen/mod.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/encode/gen/push.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/encode/gen/types.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/encode/mod.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/encode/pprof.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/error.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/forksafety.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/lib.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/memory.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/pyspy_backend.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/session.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/rust/src/utils.rs +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/setup.cfg +0 -0
- {pyroscope_io-1.2.0 → pyroscope_io-1.2.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use crate::backend::Tag;
|
|
2
2
|
use crate::error::{PyroscopeError, Result};
|
|
3
|
-
use crate::pyroscope::
|
|
3
|
+
use crate::pyroscope::PyroscopeAgentBuilder;
|
|
4
4
|
use crate::{PyroscopeAgent, ThreadId};
|
|
5
5
|
use crate::{forksafety, memory};
|
|
6
6
|
use pyo3::Python;
|
|
@@ -12,7 +12,7 @@ enum State {
|
|
|
12
12
|
#[default]
|
|
13
13
|
Idle,
|
|
14
14
|
Busy,
|
|
15
|
-
Running(Box<PyroscopeAgent
|
|
15
|
+
Running(Box<PyroscopeAgent>),
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
fn create_http_client() -> Result<reqwest::blocking::Client> {
|
|
@@ -43,7 +43,7 @@ pub fn run(py: Python<'_>, agent: PyroscopeAgentBuilder) -> Result<()> {
|
|
|
43
43
|
State::Running(_) => return Err(PyroscopeError::AgentAlreadyRunning),
|
|
44
44
|
}
|
|
45
45
|
let mem_config = agent.config.mem_config.clone();
|
|
46
|
-
let start_agent = || -> Result<PyroscopeAgent
|
|
46
|
+
let start_agent = || -> Result<PyroscopeAgent> {
|
|
47
47
|
// Create the client only after the Idle check, so an already-running or
|
|
48
48
|
// busy agent doesn't build (and, on macOS, spawn a thread for) a client
|
|
49
49
|
// that would just be thrown away.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
use std::{
|
|
2
2
|
collections::HashMap,
|
|
3
|
-
marker::PhantomData,
|
|
4
3
|
sync::mpsc::{self, Sender},
|
|
5
4
|
thread::JoinHandle,
|
|
6
5
|
};
|
|
@@ -147,10 +146,7 @@ impl PyroscopeAgentBuilder {
|
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
pub fn build(
|
|
151
|
-
self,
|
|
152
|
-
http_client: reqwest::blocking::Client,
|
|
153
|
-
) -> Result<PyroscopeAgent<PyroscopeAgentReady>> {
|
|
149
|
+
pub fn build(self, http_client: reqwest::blocking::Client) -> Result<PyroscopeAgent> {
|
|
154
150
|
let config = self.config;
|
|
155
151
|
|
|
156
152
|
// Set Global Tags
|
|
@@ -176,34 +172,12 @@ impl PyroscopeAgentBuilder {
|
|
|
176
172
|
session_manager,
|
|
177
173
|
terminate_channel: None,
|
|
178
174
|
handle: None,
|
|
179
|
-
_state: PhantomData,
|
|
180
175
|
ruleset: self.ruleset,
|
|
181
176
|
})
|
|
182
177
|
}
|
|
183
178
|
}
|
|
184
179
|
|
|
185
|
-
|
|
186
|
-
pub trait PyroscopeAgentState {}
|
|
187
|
-
|
|
188
|
-
/// Marker struct for an Uninitialized state.
|
|
189
|
-
#[derive(Debug)]
|
|
190
|
-
pub struct PyroscopeAgentBare;
|
|
191
|
-
|
|
192
|
-
/// Marker struct for a Ready state.
|
|
193
|
-
#[derive(Debug)]
|
|
194
|
-
pub struct PyroscopeAgentReady;
|
|
195
|
-
|
|
196
|
-
/// Marker struct for a Running state.
|
|
197
|
-
#[derive(Debug)]
|
|
198
|
-
pub struct PyroscopeAgentRunning;
|
|
199
|
-
|
|
200
|
-
impl PyroscopeAgentState for PyroscopeAgentBare {}
|
|
201
|
-
|
|
202
|
-
impl PyroscopeAgentState for PyroscopeAgentReady {}
|
|
203
|
-
|
|
204
|
-
impl PyroscopeAgentState for PyroscopeAgentRunning {}
|
|
205
|
-
|
|
206
|
-
pub struct PyroscopeAgent<S: PyroscopeAgentState> {
|
|
180
|
+
pub struct PyroscopeAgent {
|
|
207
181
|
session_manager: SessionManager,
|
|
208
182
|
terminate_channel: Option<Sender<()>>,
|
|
209
183
|
/// Handle to the thread that runs the Pyroscope Agent
|
|
@@ -212,28 +186,11 @@ pub struct PyroscopeAgent<S: PyroscopeAgentState> {
|
|
|
212
186
|
pub backend: Option<Pyspy>,
|
|
213
187
|
/// Configuration Object
|
|
214
188
|
pub config: PyroscopeConfig,
|
|
215
|
-
/// PyroscopeAgent State
|
|
216
|
-
_state: PhantomData<S>,
|
|
217
189
|
|
|
218
190
|
ruleset: ThreadTagsSet,
|
|
219
191
|
}
|
|
220
192
|
|
|
221
|
-
impl
|
|
222
|
-
/// Transition the PyroscopeAgent to a new state.
|
|
223
|
-
fn transition<D: PyroscopeAgentState>(self) -> PyroscopeAgent<D> {
|
|
224
|
-
PyroscopeAgent {
|
|
225
|
-
session_manager: self.session_manager,
|
|
226
|
-
terminate_channel: self.terminate_channel,
|
|
227
|
-
handle: self.handle,
|
|
228
|
-
backend: self.backend,
|
|
229
|
-
config: self.config,
|
|
230
|
-
_state: PhantomData,
|
|
231
|
-
ruleset: self.ruleset,
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
impl<S: PyroscopeAgentState> PyroscopeAgent<S> {
|
|
193
|
+
impl PyroscopeAgent {
|
|
237
194
|
fn shutdown(mut self) {
|
|
238
195
|
log::debug!(target: LOG_TAG, "PyroscopeAgent::drop()");
|
|
239
196
|
|
|
@@ -263,8 +220,8 @@ impl<S: PyroscopeAgentState> PyroscopeAgent<S> {
|
|
|
263
220
|
}
|
|
264
221
|
}
|
|
265
222
|
|
|
266
|
-
impl PyroscopeAgent
|
|
267
|
-
pub fn start(mut self) -> Result<PyroscopeAgent
|
|
223
|
+
impl PyroscopeAgent {
|
|
224
|
+
pub fn start(mut self) -> Result<PyroscopeAgent> {
|
|
268
225
|
log::debug!(target: LOG_TAG, "Starting");
|
|
269
226
|
|
|
270
227
|
let reporter = self.backend.as_ref().map(Pyspy::reporter);
|
|
@@ -297,7 +254,7 @@ impl PyroscopeAgent<PyroscopeAgentReady> {
|
|
|
297
254
|
}
|
|
298
255
|
}));
|
|
299
256
|
|
|
300
|
-
Ok(self
|
|
257
|
+
Ok(self)
|
|
301
258
|
}
|
|
302
259
|
|
|
303
260
|
fn snapshot(
|
|
@@ -334,7 +291,7 @@ impl PyroscopeAgent<PyroscopeAgentReady> {
|
|
|
334
291
|
}
|
|
335
292
|
}
|
|
336
293
|
|
|
337
|
-
impl PyroscopeAgent
|
|
294
|
+
impl PyroscopeAgent {
|
|
338
295
|
pub fn stop(mut self) -> Result<()> {
|
|
339
296
|
log::debug!(target: LOG_TAG, "Stopping");
|
|
340
297
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|