Skip to content

Commit

Permalink
Merge pull request #213 from P403n1x87/refactor/remove-exclude-empty
Browse files Browse the repository at this point in the history
refactor: remove exclude-empty option
  • Loading branch information
P403n1x87 authored Oct 13, 2024
2 parents dd5b67e + 9804459 commit d50ab47
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 34 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Improve support for Python processes running in containers.

Removed the exclude-empty option.

Bugfix: fixed a bug with the MOJO binary format that caused the line end
position to wrongly be set to a non-zero value for CPython < 3.11, where line
end information is not actually available.
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ requires no instrumentation and has practically no impact on the tracee.
https://github.com/P403n1x87/austin/wiki/The-MOJO-file-format
for more details.
-C, --children Attach to child processes.
-e, --exclude-empty Do not output samples of threads with no frame
stacks.
-f, --full Produce the full set of metrics (time +mem -mem).
-g, --gc Sample the garbage collector state.
-h, --heap=n_mb Maximum heap size to allocate to increase sampling
Expand Down
26 changes: 5 additions & 21 deletions src/argparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ parsed_args_t pargs = {
/* timeout */ DEFAULT_INIT_TIMEOUT_MS * 1000,
/* attach_pid */ 0,
/* where */ 0,
/* exclude_empty */ 0,
/* sleepless */ 0,
/* format */ (char *) SAMPLE_FORMAT_NORMAL,
#ifdef NATIVE
Expand Down Expand Up @@ -219,10 +218,6 @@ static struct argp_option options[] = {
"timeout", 't', "n_ms", 0,
"Start up wait time in milliseconds (default is 100). Accepted units: s, ms."
},
{
"exclude-empty",'e', NULL, 0,
"Do not output samples of threads with no frame stacks."
},
{
"sleepless", 's', NULL, 0,
"Suppress idle samples to estimate CPU time."
Expand Down Expand Up @@ -339,10 +334,6 @@ parse_opt (int key, char *arg, struct argp_state *state)
pargs.binary = 1;
break;

case 'e':
pargs.exclude_empty = 1;
break;

case 's':
pargs.sleepless = 1;
break;
Expand Down Expand Up @@ -566,8 +557,6 @@ print(";")
" https://github.com/P403n1x87/austin/wiki/The-MOJO-file-format\n"
" for more details.\n"
" -C, --children Attach to child processes.\n"
" -e, --exclude-empty Do not output samples of threads with no frame\n"
" stacks.\n"
" -f, --full Produce the full set of metrics (time +mem -mem).\n"
" -g, --gc Sample the garbage collector state.\n"
" -h, --heap=n_mb Maximum heap size to allocate to increase sampling\n"
Expand Down Expand Up @@ -602,12 +591,11 @@ for line in check_output(["src/austin", "--usage"]).decode().strip().splitlines(
print(f'"{line}\\n"')
print(";")
]]]*/
"Usage: austin [-bCefgmPs?V] [-h n_mb] [-i n_us] [-o FILE] [-p PID] [-t n_ms]\n"
" [-w PID] [-x n_sec] [--binary] [--children] [--exclude-empty]\n"
" [--full] [--gc] [--heap=n_mb] [--interval=n_us] [--memory]\n"
" [--output=FILE] [--pid=PID] [--pipe] [--sleepless] [--timeout=n_ms]\n"
" [--where=PID] [--exposure=n_sec] [--help] [--usage] [--version]\n"
" command [ARG...]\n"
"Usage: austin [-bCfgmPs?V] [-h n_mb] [-i n_us] [-o FILE] [-p PID] [-t n_ms]\n"
" [-w PID] [-x n_sec] [--binary] [--children] [--full] [--gc]\n"
" [--heap=n_mb] [--interval=n_us] [--memory] [--output=FILE]\n"
" [--pid=PID] [--pipe] [--sleepless] [--timeout=n_ms] [--where=PID]\n"
" [--exposure=n_sec] [--help] [--usage] [--version] command [ARG...]\n"
;
/*[[[end]]]*/

Expand Down Expand Up @@ -686,10 +674,6 @@ cb(const char opt, const char * arg) {
pargs.binary = 1;
break;

case 'e':
pargs.exclude_empty = 1;
break;

case 's':
pargs.sleepless = 1;
break;
Expand Down
1 change: 0 additions & 1 deletion src/argparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ typedef struct {
ctime_t timeout;
pid_t attach_pid;
int where;
int exclude_empty;
int sleepless;
char * format;
#ifdef NATIVE
Expand Down
8 changes: 2 additions & 6 deletions src/austin.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH AUSTIN "1" "October 2023" "austin 3.6.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH AUSTIN "1" "February 2024" "austin 3.7.0" "User Commands"
.SH NAME
austin \- Frame stack sampler for CPython
.SH SYNOPSIS
Expand All @@ -18,10 +18,6 @@ for more details.
\fB\-C\fR, \fB\-\-children\fR
Attach to child processes.
.TP
\fB\-e\fR, \fB\-\-exclude\-empty\fR
Do not output samples of threads with no frame
stacks.
.TP
\fB\-f\fR, \fB\-\-full\fR
Produce the full set of metrics (time +mem \fB\-mem\fR).
.TP
Expand Down
4 changes: 0 additions & 4 deletions src/py_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,6 @@ py_thread__emit_collapsed_stack(py_thread_t * self, int64_t interp_id, ctime_t t
if (self->invalid)
return;

if (pargs.exclude_empty && stack_is_empty())
// Skip if thread has no frames and we want to exclude empty threads
return;

if (mem_delta == 0 && time_delta == 0)
return;

Expand Down

0 comments on commit d50ab47

Please sign in to comment.