|
13 | 13 | from psutil import NoSuchProcess, Process |
14 | 14 |
|
15 | 15 | from gprofiler.exceptions import CalledProcessError, ProcessStoppedException, StopEventSetException |
16 | | -from gprofiler.gprofiler_types import ProcessToStackSampleCounters, StackToSampleCount, positive_integer |
| 16 | +from gprofiler.gprofiler_types import ProcessToStackSampleCounters, StackToSampleCount, nonnegative_integer |
17 | 17 | from gprofiler.log import get_logger_adapter |
18 | 18 | from gprofiler.merge import parse_and_remove_one_collapsed, parse_many_collapsed |
19 | 19 | from gprofiler.metadata.system_metadata import get_arch |
@@ -215,7 +215,7 @@ def start(self): |
215 | 215 | ] |
216 | 216 |
|
217 | 217 | if self.user_stacks_pages is not None: |
218 | | - cmd.extend(["--user-stacks-pages", self.user_stacks_pages]) |
| 218 | + cmd.extend(["--user-stacks-pages", str(self.user_stacks_pages)]) |
219 | 219 |
|
220 | 220 | process = start_process(cmd, via_staticx=True) |
221 | 221 | # wait until the transient data file appears - because once returning from here, PyPerf may |
@@ -289,7 +289,12 @@ def stop(self): |
289 | 289 | " or disabled (no runtime profilers for Python).", |
290 | 290 | profiler_arguments=[ |
291 | 291 | ProfilerArgument( |
292 | | - "--pyperf-user-stacks-pages", dest="python_pyperf_user_stacks_pages", default=None, type=positive_integer |
| 292 | + "--pyperf-user-stacks-pages", |
| 293 | + dest="python_pyperf_user_stacks_pages", |
| 294 | + default=None, |
| 295 | + type=nonnegative_integer, |
| 296 | + help="Number of user stack-pages that PyPerf will collect, this controls the maximum stack depth of native" |
| 297 | + " user frames. Pass 0 to disable user native stacks altogether.", |
293 | 298 | ) |
294 | 299 | ], |
295 | 300 | ) |
|
0 commit comments