Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
bcc
Commits
0b11d222
Commit
0b11d222
authored
8 years ago
by
Teng Qin
Browse files
Options
Download
Email Patches
Plain Diff
Use errno symbol instead of hard-coded numbers in offcputime.py
parent
b755c709
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
tools/offcputime.py
tools/offcputime.py
+4
-2
No files found.
tools/offcputime.py
View file @
0b11d222
...
...
@@ -15,6 +15,7 @@ from bcc import BPF
from
sys
import
stderr
from
time
import
sleep
,
strftime
import
argparse
import
errno
import
signal
# arg validation
...
...
@@ -215,10 +216,11 @@ for k, v in sorted(counts.items(), key=lambda counts: counts[1].value):
# 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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment