Skip to content

Commit a4a5943

Browse files
brad-lewisSebastien Roy
authored andcommitted
stbtrace can't find input files for package installations, collection (#12)
interval in seconds
1 parent 4ae96a6 commit a4a5943

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cmd/stbtrace.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
help='A comma separated list of statistics to'
4949
'collect')
5050
parser.add_argument('-c', '--coll', type=int, action='store',
51-
dest='collection_ns',
52-
help='The collection interval specified in ns')
51+
dest='collection_sec',
52+
help='The collection interval in seconds')
5353
parser.add_argument('-b', '--bcc', action='store_true', dest='bcc',
5454
help='Emit the bcc script without executing it')
5555
parser.add_argument('-p', '--path', action='store', dest='PATH',
@@ -62,7 +62,7 @@
6262
if args.PATH:
6363
filename = args.PATH + '/' + args.tracer + '.json'
6464
else:
65-
filename = '../bpf/stbtrace/' + args.tracer + '.json'
65+
filename = base_dir + '/bpf/stbtrace/' + args.tracer + '.json'
6666
try:
6767
with open(filename, 'r') as json_file:
6868
data = json.load(json_file)
@@ -91,7 +91,7 @@
9191
if args.PATH:
9292
filename = args.PATH + '/' + args.tracer + '.st'
9393
else:
94-
filename = '../bpf/stbtrace/' + args.tracer + '.st'
94+
filename = base_dir + '/bpf/stbtrace/' + args.tracer + '.st'
9595

9696
try:
9797
with open(filename, 'r') as f:
@@ -118,8 +118,9 @@
118118
template.selectFields('maps', args.STATS.split(","))
119119
template.selectFields('hists', args.STATS.split(","))
120120

121-
if args.collection_ns:
122-
template.addSingleton('collection_period_in_ns', args.collection_ns)
121+
if args.collection_sec:
122+
template.addSingleton('collection_period_in_ns',
123+
args.collection_sec * 1000000000)
123124
else:
124125
for node in data:
125126
if node != 'keys' and \

0 commit comments

Comments
 (0)