-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
24 lines (21 loc) · 821 Bytes
/
example.py
File metadata and controls
24 lines (21 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from nsys_analyser import NodeFilter, Report, ReportGuard, create_tree
from nsys_analyser.analyser import (
analyse_kernel_coverage,
analyse_kernel_status,
)
json_path = "./xxx.json"
# create call stack tree, with filters to local your target (use nvtx to capture)
# (NodeFilter.text_filter need the full name of a nvtx event)
tree = create_tree(
json_path, NodeFilter.thread(775).first_text("run_batch:4142")
)
# use analyse tools, they print the result
# you can add your analyser under dir `nsys_analyser/analyser`
analyse_kernel_coverage(tree)
analyse_kernel_status(tree)
# if you want dump to file, use `>` in bash
# or use ReportGuard if you want dump results to different files
report = Report("./log.log")
with ReportGuard(report):
analyse_kernel_coverage(tree)
analyse_kernel_status(tree)