Skip to content

Commit

Permalink
stbtrace can't find input files for package installations, collection (
Browse files Browse the repository at this point in the history
…#12) (#13)

interval in seconds
  • Loading branch information
brad-lewis authored and Sebastien Roy committed Nov 19, 2019
1 parent 4ae96a6 commit 8049b85
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd/stbtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
help='A comma separated list of statistics to'
'collect')
parser.add_argument('-c', '--coll', type=int, action='store',
dest='collection_ns',
help='The collection interval specified in ns')
dest='collection_sec',
help='The collection interval in seconds')
parser.add_argument('-b', '--bcc', action='store_true', dest='bcc',
help='Emit the bcc script without executing it')
parser.add_argument('-p', '--path', action='store', dest='PATH',
Expand All @@ -62,7 +62,7 @@
if args.PATH:
filename = args.PATH + '/' + args.tracer + '.json'
else:
filename = '../bpf/stbtrace/' + args.tracer + '.json'
filename = base_dir + '/bpf/stbtrace/' + args.tracer + '.json'
try:
with open(filename, 'r') as json_file:
data = json.load(json_file)
Expand Down Expand Up @@ -91,7 +91,7 @@
if args.PATH:
filename = args.PATH + '/' + args.tracer + '.st'
else:
filename = '../bpf/stbtrace/' + args.tracer + '.st'
filename = base_dir + '/bpf/stbtrace/' + args.tracer + '.st'

try:
with open(filename, 'r') as f:
Expand All @@ -118,8 +118,9 @@
template.selectFields('maps', args.STATS.split(","))
template.selectFields('hists', args.STATS.split(","))

if args.collection_ns:
template.addSingleton('collection_period_in_ns', args.collection_ns)
if args.collection_sec:
template.addSingleton('collection_period_in_ns',
args.collection_sec * 1000000000)
else:
for node in data:
if node != 'keys' and \
Expand Down

0 comments on commit 8049b85

Please sign in to comment.