From 4870819affc1cae8c9d0594970624ba4251c4125 Mon Sep 17 00:00:00 2001 From: Brendan Gregg Date: Thu, 3 Aug 2017 11:49:27 -0700 Subject: [PATCH] better state default value handling --- tools/offcputime.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/offcputime.py b/tools/offcputime.py index f136698a..1f47459f 100755 --- a/tools/offcputime.py +++ b/tools/offcputime.py @@ -88,8 +88,7 @@ parser.add_argument("-M", "--max-block-time", default=(1 << 64) - 1, type=positive_nonzero_int, help="the amount of time in microseconds under which we " + "store traces (default U64_MAX)") -parser.add_argument("--state", default=999, - type=positive_int, +parser.add_argument("--state", type=positive_int, help="filter on this thread state bitmask (eg, 2 == TASK_UNINTERRUPTIBLE" + ") see include/linux/sched.h") args = parser.parse_args() @@ -184,7 +183,7 @@ else: thread_filter = '1' if args.state == 0: state_filter = 'prev->state == 0' -elif args.state != 999: +elif args.state: # these states are sometimes bitmask checked state_filter = 'prev->state & %d' % args.state else: -- 2.34.1