|
48 | 48 | description='Collect zil latency statistics.', |
49 | 49 | usage='estat zil [options]') |
50 | 50 | parser.add_argument('-c', '--coll', type=int, action='store', |
51 | | - dest='collection_sec', |
| 51 | + dest='collection_sec', default=60, |
52 | 52 | help='The collection interval in seconds') |
53 | 53 | parser.add_argument('-p', '--pool', type=str, action='store', |
54 | 54 | dest='pool', |
|
319 | 319 | "-include", |
320 | 320 | "/usr/src/zfs-" + KVER + "/include/spl/sys/types.h", |
321 | 321 | "-I/usr/src/zfs-" + KVER + "/include/", |
322 | | - "-I/usr/src/zfs-" + KVER + "/include/spl"]) |
| 322 | + "-I/usr/src/zfs-" + KVER + "/include/spl", |
| 323 | + "-D__KERNEL__", "-D_KERNEL"]) |
323 | 324 |
|
324 | 325 | b.attach_kprobe(event="zfs_write", fn_name="zfs_write_entry") |
325 | 326 | b.attach_kretprobe(event="zfs_write", fn_name="zfs_write_return") |
|
337 | 338 | fn_name="zil_commit_waiter_return") |
338 | 339 | b.attach_kretprobe(event="zio_alloc_zil", |
339 | 340 | fn_name="zio_alloc_zil_return") |
340 | | -b.attach_kprobe(event="zil_commit_waiter_skip", |
341 | | - fn_name="zil_commit_waiter_skip_entry") |
342 | 341 | b.attach_kprobe(event="zil_commit_writer_stall", |
343 | 342 | fn_name="zil_commit_writer_stall_entry") |
344 | 343 |
|
|
354 | 353 | BCCHelper.COUNT_AGGREGATION, "count") |
355 | 354 | call_count_helper.add_key_type("name") |
356 | 355 |
|
357 | | -if (not args.collection_sec): |
358 | | - print(" Tracing enabled... Hit Ctrl-C to end.") |
359 | | - |
360 | | -# Collect data for a collection interval if specified |
361 | | -if (args.collection_sec): |
362 | | - sleep(args.collection_sec) |
363 | | - try: |
364 | | - print("%-16s\n" % strftime("%D - %H:%M:%S %Z")) |
365 | | - latency_helper.printall() |
366 | | - call_count_helper.printall() |
367 | | - exit(0) |
368 | | - except Exception as e: |
369 | | - print(str(e)) |
370 | | - exit(0) |
371 | | - |
372 | | -# Collect data until keyborad interrupt with output for each second |
| 356 | +# |
| 357 | +# Collect data until keyborad interrupt |
| 358 | +# |
| 359 | +print(" Tracing enabled... Hit Ctrl-C to end.") |
373 | 360 | while True: |
374 | 361 | try: |
375 | | - sleep(60) |
| 362 | + sleep(args.collection_sec) |
376 | 363 | except KeyboardInterrupt: |
377 | 364 | print("%-16s\n" % strftime("%D - %H:%M:%S %Z")) |
378 | 365 | latency_helper.printall() |
|
0 commit comments