Skip to content

Commit 1e7ccf9

Browse files
authored
fix(python): ignore native in ffi (#131)
1 parent ad88f50 commit 1e7ccf9

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

pyroscope_cli/src/core/profiler.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ impl Profiler {
6363
.gil_only(pyspy_gil)
6464
.native(pyspy_native);
6565

66+
if blocking {
67+
log::warn!("blocking is not recommended for production use");
68+
}
69+
if pyspy_native && !blocking {
70+
log::warn!("native profiling is not supported without blocking");
71+
}
72+
6673
let backend = pyspy_backend(config);
6774

6875
let mut builder = PyroscopeAgent::default_builder();

pyroscope_ffi/python/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pyroscope.configure(
4747
sample_rate = 100, # default is 100
4848
detect_subprocesses = False, # detect subprocesses started by the main process; default is False
4949
oncpu = True # report cpu time only; default is True
50-
native = False # profile native extensions; default is False
5150
gil_only = True # only include traces for threads that are holding on to the Global Interpreter Lock; default is True
5251
log_level = "info" # default is info, possible values: trace, debug, info, warn, error and critical
5352
tags = {

pyroscope_ffi/python/lib/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub extern "C" fn initialize_agent(
4949
sample_rate: u32,
5050
detect_subprocesses: bool,
5151
oncpu: bool,
52-
native: bool,
5352
gil_only: bool,
5453
report_pid: bool,
5554
report_thread_id: bool,
@@ -117,7 +116,7 @@ pub extern "C" fn initialize_agent(
117116
.lock_process(false)
118117
.detect_subprocesses(detect_subprocesses)
119118
.oncpu(oncpu)
120-
.native(native)
119+
.native(false)
121120
.gil_only(gil_only);
122121

123122
// Report the PID.

pyroscope_ffi/python/pyroscope/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def configure(
1818
sample_rate=100,
1919
detect_subprocesses=False,
2020
oncpu=True,
21-
native=False,
21+
native=None,
2222
gil_only=True,
2323
report_pid=False,
2424
report_thread_id=False,
@@ -32,6 +32,9 @@ def configure(
3232
warnings.warn("app_name is deprecated, use application_name", DeprecationWarning)
3333
application_name = app_name
3434

35+
if native is not None:
36+
warnings.warn("native is deprecated and not supported", DeprecationWarning)
37+
3538
if enable_logging:
3639
logger = logging.getLogger()
3740
log_level = logger.getEffectiveLevel()
@@ -46,7 +49,6 @@ def configure(
4649
sample_rate,
4750
detect_subprocesses,
4851
oncpu,
49-
native,
5052
gil_only,
5153
report_pid,
5254
report_thread_id,

0 commit comments

Comments
 (0)