|
48 | 48 | help='A comma separated list of statistics to'
|
49 | 49 | 'collect')
|
50 | 50 | 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') |
53 | 53 | parser.add_argument('-b', '--bcc', action='store_true', dest='bcc',
|
54 | 54 | help='Emit the bcc script without executing it')
|
55 | 55 | parser.add_argument('-p', '--path', action='store', dest='PATH',
|
|
62 | 62 | if args.PATH:
|
63 | 63 | filename = args.PATH + '/' + args.tracer + '.json'
|
64 | 64 | else:
|
65 |
| - filename = '../bpf/stbtrace/' + args.tracer + '.json' |
| 65 | + filename = base_dir + '/bpf/stbtrace/' + args.tracer + '.json' |
66 | 66 | try:
|
67 | 67 | with open(filename, 'r') as json_file:
|
68 | 68 | data = json.load(json_file)
|
|
91 | 91 | if args.PATH:
|
92 | 92 | filename = args.PATH + '/' + args.tracer + '.st'
|
93 | 93 | else:
|
94 |
| - filename = '../bpf/stbtrace/' + args.tracer + '.st' |
| 94 | + filename = base_dir + '/bpf/stbtrace/' + args.tracer + '.st' |
95 | 95 |
|
96 | 96 | try:
|
97 | 97 | with open(filename, 'r') as f:
|
|
118 | 118 | template.selectFields('maps', args.STATS.split(","))
|
119 | 119 | template.selectFields('hists', args.STATS.split(","))
|
120 | 120 |
|
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) |
123 | 124 | else:
|
124 | 125 | for node in data:
|
125 | 126 | if node != 'keys' and \
|
|
0 commit comments