Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
a3771944
Commit
a3771944
authored
Apr 10, 2016
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #483 from iovisor/bblanco_dev
miscellaneous cleanups to C++ and tools/trace
parents
5a0dbcf8
c98ffd63
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
47 deletions
+33
-47
src/cc/frontends/clang/b_frontend_action.cc
src/cc/frontends/clang/b_frontend_action.cc
+23
-40
src/cc/frontends/clang/b_frontend_action.h
src/cc/frontends/clang/b_frontend_action.h
+3
-0
src/cc/perf_reader.c
src/cc/perf_reader.c
+1
-1
tests/python/test_stackid.py
tests/python/test_stackid.py
+4
-4
tools/trace.py
tools/trace.py
+2
-2
No files found.
src/cc/frontends/clang/b_frontend_action.cc
View file @
a3771944
...
@@ -248,8 +248,7 @@ bool BTypeVisitor::VisitFunctionDecl(FunctionDecl *D) {
...
@@ -248,8 +248,7 @@ bool BTypeVisitor::VisitFunctionDecl(FunctionDecl *D) {
string
preamble
=
"{"
;
string
preamble
=
"{"
;
for
(
auto
arg
:
D
->
params
())
{
for
(
auto
arg
:
D
->
params
())
{
if
(
arg
->
getName
()
==
""
)
{
if
(
arg
->
getName
()
==
""
)
{
C
.
getDiagnostics
().
Report
(
arg
->
getLocEnd
(),
diag
::
err_expected
)
error
(
arg
->
getLocEnd
(),
"arguments to BPF program definition must be named"
);
<<
"named arguments in BPF program definition"
;
return
false
;
return
false
;
}
}
fn_args_
.
push_back
(
arg
);
fn_args_
.
push_back
(
arg
);
...
@@ -307,8 +306,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
...
@@ -307,8 +306,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
for
(;
table_it
!=
tables_
.
end
();
++
table_it
)
for
(;
table_it
!=
tables_
.
end
();
++
table_it
)
if
(
table_it
->
name
==
Ref
->
getDecl
()
->
getName
())
break
;
if
(
table_it
->
name
==
Ref
->
getDecl
()
->
getName
())
break
;
if
(
table_it
==
tables_
.
end
())
{
if
(
table_it
==
tables_
.
end
())
{
C
.
getDiagnostics
().
Report
(
Ref
->
getLocEnd
(),
diag
::
err_expected
)
error
(
Ref
->
getLocEnd
(),
"bpf_table %s failed to open"
)
<<
Ref
->
getDecl
()
->
getName
();
<<
"initialized handle for bpf_table"
;
return
false
;
return
false
;
}
}
string
fd
=
to_string
(
table_it
->
fd
);
string
fd
=
to_string
(
table_it
->
fd
);
...
@@ -362,9 +360,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
...
@@ -362,9 +360,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
txt
+=
"bpf_pseudo_fd(1, "
+
fd
+
"), "
+
arg0
;
txt
+=
"bpf_pseudo_fd(1, "
+
fd
+
"), "
+
arg0
;
rewrite_end
=
Call
->
getArg
(
0
)
->
getLocEnd
();
rewrite_end
=
Call
->
getArg
(
0
)
->
getLocEnd
();
}
else
{
}
else
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
Call
->
getLocStart
(),
"get_stackid only available on stacktrace maps"
);
"get_stackid only available on stacktrace maps"
);
C
.
getDiagnostics
().
Report
(
Call
->
getLocStart
(),
diag_id
);
return
false
;
return
false
;
}
}
}
else
{
}
else
{
...
@@ -384,8 +380,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
...
@@ -384,8 +380,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
prefix
=
"bpf_perf_event_read"
;
prefix
=
"bpf_perf_event_read"
;
suffix
=
")"
;
suffix
=
")"
;
}
else
{
}
else
{
C
.
getDiagnostics
().
Report
(
Call
->
getLocStart
(),
diag
::
err_expected
)
error
(
Call
->
getLocStart
(),
"invalid bpf_table operation %s"
)
<<
memb_name
;
<<
"valid bpf_table operation"
;
return
false
;
return
false
;
}
}
prefix
+=
"((void *)bpf_pseudo_fd(1, "
+
fd
+
"), "
;
prefix
+=
"((void *)bpf_pseudo_fd(1, "
+
fd
+
"), "
;
...
@@ -393,8 +388,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
...
@@ -393,8 +388,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
txt
=
prefix
+
args
+
suffix
;
txt
=
prefix
+
args
+
suffix
;
}
}
if
(
!
rewriter_
.
isRewritable
(
rewrite_start
)
||
!
rewriter_
.
isRewritable
(
rewrite_end
))
{
if
(
!
rewriter_
.
isRewritable
(
rewrite_start
)
||
!
rewriter_
.
isRewritable
(
rewrite_end
))
{
C
.
getDiagnostics
().
Report
(
Call
->
getLocStart
(),
diag
::
err_expected
)
error
(
Call
->
getLocStart
(),
"cannot use map function inside a macro"
);
<<
"use of map function not in a macro"
;
return
false
;
return
false
;
}
}
rewriter_
.
ReplaceText
(
SourceRange
(
rewrite_start
,
rewrite_end
),
txt
);
rewriter_
.
ReplaceText
(
SourceRange
(
rewrite_start
,
rewrite_end
),
txt
);
...
@@ -411,8 +405,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
...
@@ -411,8 +405,7 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) {
// unless one preprocesses the entire source file.
// unless one preprocesses the entire source file.
if
(
A
->
getLabel
()
==
"llvm.bpf.extra"
)
{
if
(
A
->
getLabel
()
==
"llvm.bpf.extra"
)
{
if
(
!
rewriter_
.
isRewritable
(
Call
->
getLocStart
()))
{
if
(
!
rewriter_
.
isRewritable
(
Call
->
getLocStart
()))
{
C
.
getDiagnostics
().
Report
(
Call
->
getLocStart
(),
diag
::
err_expected
)
error
(
Call
->
getLocStart
(),
"cannot use builtin inside a macro"
);
<<
"use of extra builtin not in a macro"
;
return
false
;
return
false
;
}
}
...
@@ -465,8 +458,7 @@ bool BTypeVisitor::VisitBinaryOperator(BinaryOperator *E) {
...
@@ -465,8 +458,7 @@ bool BTypeVisitor::VisitBinaryOperator(BinaryOperator *E) {
if
(
A
->
getMessage
()
==
"packet"
)
{
if
(
A
->
getMessage
()
==
"packet"
)
{
if
(
FieldDecl
*
F
=
dyn_cast
<
FieldDecl
>
(
Memb
->
getMemberDecl
()))
{
if
(
FieldDecl
*
F
=
dyn_cast
<
FieldDecl
>
(
Memb
->
getMemberDecl
()))
{
if
(
!
rewriter_
.
isRewritable
(
E
->
getLocStart
()))
{
if
(
!
rewriter_
.
isRewritable
(
E
->
getLocStart
()))
{
C
.
getDiagnostics
().
Report
(
E
->
getLocStart
(),
diag
::
err_expected
)
error
(
E
->
getLocStart
(),
"cannot use
\"
packet
\"
header type inside a macro"
);
<<
"use of
\"
packet
\"
header type not in a macro"
;
return
false
;
return
false
;
}
}
uint64_t
ofs
=
C
.
getFieldOffset
(
F
);
uint64_t
ofs
=
C
.
getFieldOffset
(
F
);
...
@@ -496,8 +488,7 @@ bool BTypeVisitor::VisitImplicitCastExpr(ImplicitCastExpr *E) {
...
@@ -496,8 +488,7 @@ bool BTypeVisitor::VisitImplicitCastExpr(ImplicitCastExpr *E) {
if
(
A
->
getMessage
()
==
"packet"
)
{
if
(
A
->
getMessage
()
==
"packet"
)
{
if
(
FieldDecl
*
F
=
dyn_cast
<
FieldDecl
>
(
Memb
->
getMemberDecl
()))
{
if
(
FieldDecl
*
F
=
dyn_cast
<
FieldDecl
>
(
Memb
->
getMemberDecl
()))
{
if
(
!
rewriter_
.
isRewritable
(
E
->
getLocStart
()))
{
if
(
!
rewriter_
.
isRewritable
(
E
->
getLocStart
()))
{
C
.
getDiagnostics
().
Report
(
E
->
getLocStart
(),
diag
::
err_expected
)
error
(
E
->
getLocStart
(),
"cannot use
\"
packet
\"
header type inside a macro"
);
<<
"use of
\"
packet
\"
header type not in a macro"
;
return
false
;
return
false
;
}
}
uint64_t
ofs
=
C
.
getFieldOffset
(
F
);
uint64_t
ofs
=
C
.
getFieldOffset
(
F
);
...
@@ -512,6 +503,12 @@ bool BTypeVisitor::VisitImplicitCastExpr(ImplicitCastExpr *E) {
...
@@ -512,6 +503,12 @@ bool BTypeVisitor::VisitImplicitCastExpr(ImplicitCastExpr *E) {
return
true
;
return
true
;
}
}
template
<
unsigned
N
>
DiagnosticBuilder
BTypeVisitor
::
error
(
SourceLocation
loc
,
const
char
(
&
fmt
)[
N
])
{
unsigned
int
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
fmt
);
return
C
.
getDiagnostics
().
Report
(
loc
,
diag_id
);
}
// Open table FDs when bpf tables (as denoted by section("maps*") attribute)
// Open table FDs when bpf tables (as denoted by section("maps*") attribute)
// are declared.
// are declared.
bool
BTypeVisitor
::
VisitVarDecl
(
VarDecl
*
Decl
)
{
bool
BTypeVisitor
::
VisitVarDecl
(
VarDecl
*
Decl
)
{
...
@@ -520,8 +517,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -520,8 +517,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
if
(
!
A
->
getName
().
startswith
(
"maps"
))
if
(
!
A
->
getName
().
startswith
(
"maps"
))
return
true
;
return
true
;
if
(
!
R
)
{
if
(
!
R
)
{
C
.
getDiagnostics
().
Report
(
Decl
->
getLocEnd
(),
diag
::
err_expected
)
error
(
Decl
->
getLocEnd
(),
"invalid type for bpf_table, expect struct"
);
<<
"struct type for bpf_table"
;
return
false
;
return
false
;
}
}
const
RecordDecl
*
RD
=
R
->
getDecl
()
->
getDefinition
();
const
RecordDecl
*
RD
=
R
->
getDecl
()
->
getDefinition
();
...
@@ -541,9 +537,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -541,9 +537,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
size_t
sz
=
C
.
getTypeSize
(
F
->
getType
())
>>
3
;
size_t
sz
=
C
.
getTypeSize
(
F
->
getType
())
>>
3
;
if
(
F
->
getName
()
==
"key"
)
{
if
(
F
->
getName
()
==
"key"
)
{
if
(
sz
==
0
)
{
if
(
sz
==
0
)
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
F
->
getLocStart
(),
"invalid zero-sized leaf"
);
"invalid zero-sized leaf"
);
C
.
getDiagnostics
().
Report
(
F
->
getLocStart
(),
diag_id
);
return
false
;
return
false
;
}
}
table
.
key_size
=
sz
;
table
.
key_size
=
sz
;
...
@@ -551,9 +545,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -551,9 +545,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
visitor
.
TraverseType
(
F
->
getType
());
visitor
.
TraverseType
(
F
->
getType
());
}
else
if
(
F
->
getName
()
==
"leaf"
)
{
}
else
if
(
F
->
getName
()
==
"leaf"
)
{
if
(
sz
==
0
)
{
if
(
sz
==
0
)
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
F
->
getLocStart
(),
"invalid zero-sized leaf"
);
"invalid zero-sized leaf"
);
C
.
getDiagnostics
().
Report
(
F
->
getLocStart
(),
diag_id
);
return
false
;
return
false
;
}
}
table
.
leaf_size
=
sz
;
table
.
leaf_size
=
sz
;
...
@@ -580,9 +572,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -580,9 +572,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
else
else
map_type
=
BPF_MAP_TYPE_HASH
;
map_type
=
BPF_MAP_TYPE_HASH
;
if
(
table
.
leaf_desc
!=
"
\"
unsigned long long
\"
"
)
{
if
(
table
.
leaf_desc
!=
"
\"
unsigned long long
\"
"
)
{
unsigned
diag_id
=
diag_
.
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
Decl
->
getLocStart
(),
"histogram leaf type must be u64, got %0"
)
<<
table
.
leaf_desc
;
"histogram leaf type must be u64, got %0"
);
diag_
.
Report
(
Decl
->
getLocStart
(),
diag_id
)
<<
table
.
leaf_desc
;
}
}
}
else
if
(
A
->
getName
()
==
"maps/prog"
)
{
}
else
if
(
A
->
getName
()
==
"maps/prog"
)
{
map_type
=
BPF_MAP_TYPE_PROG_ARRAY
;
map_type
=
BPF_MAP_TYPE_PROG_ARRAY
;
...
@@ -606,15 +596,11 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -606,15 +596,11 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
for
(;
table_it
!=
tables_
.
end
();
++
table_it
)
for
(;
table_it
!=
tables_
.
end
();
++
table_it
)
if
(
table_it
->
name
==
table
.
name
)
break
;
if
(
table_it
->
name
==
table
.
name
)
break
;
if
(
table_it
==
tables_
.
end
())
{
if
(
table_it
==
tables_
.
end
())
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
Decl
->
getLocStart
(),
"reference to undefined table"
);
"reference to undefined table"
);
C
.
getDiagnostics
().
Report
(
Decl
->
getLocStart
(),
diag_id
);
return
false
;
return
false
;
}
}
if
(
!
SharedTables
::
instance
()
->
insert_fd
(
table
.
name
,
table_it
->
fd
))
{
if
(
!
SharedTables
::
instance
()
->
insert_fd
(
table
.
name
,
table_it
->
fd
))
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
Decl
->
getLocStart
(),
"could not export bpf map %0: %1"
)
<<
table
.
name
<<
"already in use"
;
"could not export bpf map %0: %1"
);
C
.
getDiagnostics
().
Report
(
Decl
->
getLocStart
(),
diag_id
)
<<
table
.
name
<<
"already in use"
;
return
false
;
return
false
;
}
}
table_it
->
is_shared
=
true
;
table_it
->
is_shared
=
true
;
...
@@ -623,9 +609,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -623,9 +609,7 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
if
(
!
is_extern
)
{
if
(
!
is_extern
)
{
if
(
map_type
==
BPF_MAP_TYPE_UNSPEC
)
{
if
(
map_type
==
BPF_MAP_TYPE_UNSPEC
)
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
Decl
->
getLocStart
(),
"unsupported map type: %0"
)
<<
A
->
getName
();
"unsupported map type: %0"
);
C
.
getDiagnostics
().
Report
(
Decl
->
getLocStart
(),
diag_id
)
<<
A
->
getName
();
return
false
;
return
false
;
}
}
...
@@ -633,9 +617,8 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
...
@@ -633,9 +617,8 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
table
.
fd
=
bpf_create_map
(
map_type
,
table
.
key_size
,
table
.
leaf_size
,
table
.
max_entries
);
table
.
fd
=
bpf_create_map
(
map_type
,
table
.
key_size
,
table
.
leaf_size
,
table
.
max_entries
);
}
}
if
(
table
.
fd
<
0
)
{
if
(
table
.
fd
<
0
)
{
unsigned
diag_id
=
C
.
getDiagnostics
().
getCustomDiagID
(
DiagnosticsEngine
::
Error
,
error
(
Decl
->
getLocStart
(),
"could not open bpf map: %0
\n
is %s map type enabled in your kernel?"
)
<<
"could not open bpf map: %0"
);
strerror
(
errno
)
<<
A
->
getName
();
C
.
getDiagnostics
().
Report
(
Decl
->
getLocStart
(),
diag_id
)
<<
strerror
(
errno
);
return
false
;
return
false
;
}
}
...
...
src/cc/frontends/clang/b_frontend_action.h
View file @
a3771944
...
@@ -73,6 +73,9 @@ class BTypeVisitor : public clang::RecursiveASTVisitor<BTypeVisitor> {
...
@@ -73,6 +73,9 @@ class BTypeVisitor : public clang::RecursiveASTVisitor<BTypeVisitor> {
bool
VisitImplicitCastExpr
(
clang
::
ImplicitCastExpr
*
E
);
bool
VisitImplicitCastExpr
(
clang
::
ImplicitCastExpr
*
E
);
private:
private:
template
<
unsigned
N
>
clang
::
DiagnosticBuilder
error
(
clang
::
SourceLocation
loc
,
const
char
(
&
fmt
)[
N
]);
clang
::
ASTContext
&
C
;
clang
::
ASTContext
&
C
;
clang
::
DiagnosticsEngine
&
diag_
;
clang
::
DiagnosticsEngine
&
diag_
;
clang
::
Rewriter
&
rewriter_
;
/// modifications to the source go into this class
clang
::
Rewriter
&
rewriter_
;
/// modifications to the source go into this class
...
...
src/cc/perf_reader.c
View file @
a3771944
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
* limitations under the License.
* limitations under the License.
*/
*/
#include <linux/perf_event.h>
#include <poll.h>
#include <poll.h>
#include <stdio.h>
#include <stdio.h>
#include <stdint.h>
#include <stdint.h>
...
@@ -22,6 +21,7 @@
...
@@ -22,6 +21,7 @@
#include <string.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/mman.h>
#include <unistd.h>
#include <unistd.h>
#include <linux/perf_event.h>
#include "libbpf.h"
#include "libbpf.h"
#include "perf_reader.h"
#include "perf_reader.h"
...
...
tests/python/test_stackid.py
View file @
a3771944
...
@@ -24,11 +24,11 @@ class TestStackid(unittest.TestCase):
...
@@ -24,11 +24,11 @@ class TestStackid(unittest.TestCase):
def
test_simple
(
self
):
def
test_simple
(
self
):
b
=
bcc
.
BPF
(
text
=
"""
b
=
bcc
.
BPF
(
text
=
"""
#include <uapi/linux/ptrace.h>
#include <uapi/linux/ptrace.h>
#include <linux/bpf.h>
struct bpf_map;
BPF_STACK_TRACE(stack_traces, 10240);
BPF_STACK_TRACE(stack_traces, 10240);
BPF_HASH(stack_entries, int, int);
BPF_HASH(stack_entries, int, int);
BPF_HASH(stub);
BPF_HASH(stub);
int kprobe__htab_map_
delete
_elem(struct pt_regs *ctx, struct bpf_map *map, u64 *k) {
int kprobe__htab_map_
lookup
_elem(struct pt_regs *ctx, struct bpf_map *map, u64 *k) {
int id = stack_traces.get_stackid(ctx, BPF_F_REUSE_STACKID);
int id = stack_traces.get_stackid(ctx, BPF_F_REUSE_STACKID);
if (id < 0)
if (id < 0)
return 0;
return 0;
...
@@ -40,14 +40,14 @@ int kprobe__htab_map_delete_elem(struct pt_regs *ctx, struct bpf_map *map, u64 *
...
@@ -40,14 +40,14 @@ int kprobe__htab_map_delete_elem(struct pt_regs *ctx, struct bpf_map *map, u64 *
stub
=
b
[
"stub"
]
stub
=
b
[
"stub"
]
stack_traces
=
b
[
"stack_traces"
]
stack_traces
=
b
[
"stack_traces"
]
stack_entries
=
b
[
"stack_entries"
]
stack_entries
=
b
[
"stack_entries"
]
try
:
del
stub
[
stub
.
Key
(
1
)]
try
:
x
=
stub
[
stub
.
Key
(
1
)]
except
:
pass
except
:
pass
k
=
stack_entries
.
Key
(
1
)
k
=
stack_entries
.
Key
(
1
)
self
.
assertIn
(
k
,
stack_entries
)
self
.
assertIn
(
k
,
stack_entries
)
stackid
=
stack_entries
[
k
]
stackid
=
stack_entries
[
k
]
self
.
assertIsNotNone
(
stackid
)
self
.
assertIsNotNone
(
stackid
)
stack
=
stack_traces
[
stackid
].
ip
stack
=
stack_traces
[
stackid
].
ip
self
.
assertEqual
(
b
.
ksym
(
stack
[
0
]),
"htab_map_
delete
_elem"
)
self
.
assertEqual
(
b
.
ksym
(
stack
[
0
]),
"htab_map_
lookup
_elem"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
tools/trace.py
View file @
a3771944
...
@@ -545,8 +545,8 @@ trace 'u:pthread:pthread_create (arg4 != 0)'
...
@@ -545,8 +545,8 @@ trace 'u:pthread:pthread_create (arg4 != 0)'
except
:
except
:
if
self
.
args
.
verbose
:
if
self
.
args
.
verbose
:
traceback
.
print_exc
()
traceback
.
print_exc
()
elif
sys
.
exc_
type
is
not
SystemExit
:
elif
sys
.
exc_
info
()[
0
]
is
not
SystemExit
:
print
(
sys
.
exc_
value
)
print
(
sys
.
exc_
info
()[
1
]
)
self
.
_close_probes
()
self
.
_close_probes
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
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