Skip to content

Commit

Permalink
Use errno symbol instead of hard-coded numbers in offcputime.py
Browse files Browse the repository at this point in the history
  • Loading branch information
palmtenor committed Jul 18, 2016
1 parent b755c70 commit 0b11d22
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/offcputime.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from sys import stderr
from time import sleep, strftime
import argparse
import errno
import signal

# arg validation
Expand Down Expand Up @@ -215,10 +216,11 @@ def signal_ignore(signal, frame):
# handle get_stackid erorrs
if (not args.user_stacks_only and k.kernel_stack_id < 0) or \
(not args.kernel_stacks_only and k.user_stack_id < 0 and \
k.user_stack_id != -14):
k.user_stack_id != -errno.EFAULT):
missing_stacks += 1
# check for an ENOMEM error
if k.kernel_stack_id == -12 or k.user_stack_id == -12:
if k.kernel_stack_id == -errno.ENOMEM or \
k.user_stack_id == -errno.ENOMEM:
has_enomem = True
continue

Expand Down

0 comments on commit 0b11d22

Please sign in to comment.