Skip to content

Commit

Permalink
refactor: remove exclude-empty option
Browse files Browse the repository at this point in the history
The option has been broken for the past few releases and it didn't
seem to cause major issues. So we make the assumption that this option
is not used frequently and therefore we make the decision to drop it.
  • Loading branch information
P403n1x87 committed Mar 16, 2024
1 parent 0bbe368 commit 1c15ea8
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 38 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2024-xx-xx v3.7.0

Removed the exclude-empty option.


2023-10-04 v3.6.0

Added support for CPython 3.12
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
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AC_PREREQ([2.69])
# from scripts.utils import get_current_version_from_changelog as version
# print(f"AC_INIT([austin], [{version()}], [https://github.com/p403n1x87/austin/issues])")
# ]]]
AC_INIT([austin], [3.6.0], [https://github.com/p403n1x87/austin/issues])
AC_INIT([austin], [3.7.0], [https://github.com/p403n1x87/austin/issues])
# [[[end]]]
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
Expand Down
2 changes: 1 addition & 1 deletion doc/cheatsheet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ base: core20
# from scripts.utils import get_current_version_from_changelog as version
# print(f"version: '{version()}+git'")
# ]]]
version: '3.6.0+git'
version: '3.7.0+git'
# [[[end]]]
summary: A Python frame stack sampler for CPython
description: |
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
2 changes: 1 addition & 1 deletion src/austin.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from scripts.utils import get_current_version_from_changelog as version
print(f'#define VERSION "{version()}"')
]]] */
#define VERSION "3.6.0"
#define VERSION "3.7.0"
// [[[end]]]

#endif
4 changes: 0 additions & 4 deletions src/py_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,10 +900,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 1c15ea8

Please sign in to comment.