|
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', |
|
286 | 286 | return 0; |
287 | 287 | } |
288 | 288 |
|
289 | | -int zil_commit_waiter_skip_entry(struct pt_regs *cts) |
290 | | -{ |
291 | | - u32 tid = bpf_get_current_pid_tgid(); |
292 | | - zil_tid_info_t *info = zil_info_map.lookup(&tid); |
293 | | - if (info == NULL) { |
294 | | - return 0; |
295 | | - } |
296 | | -
|
297 | | - count_call("waiter skip"); |
298 | | - return 0; |
299 | | -} |
300 | | -
|
301 | 289 | int zil_commit_writer_stall_entry(struct pt_regs *cts) |
302 | 290 | { |
303 | 291 | u32 tid = bpf_get_current_pid_tgid(); |
|
319 | 307 | "-include", |
320 | 308 | "/usr/src/zfs-" + KVER + "/include/spl/sys/types.h", |
321 | 309 | "-I/usr/src/zfs-" + KVER + "/include/", |
322 | | - "-I/usr/src/zfs-" + KVER + "/include/spl"]) |
| 310 | + "-I/usr/src/zfs-" + KVER + "/include/spl", |
| 311 | + "-D__KERNEL__", "-D_KERNEL"]) |
323 | 312 |
|
324 | 313 | b.attach_kprobe(event="zfs_write", fn_name="zfs_write_entry") |
325 | 314 | b.attach_kretprobe(event="zfs_write", fn_name="zfs_write_return") |
|
337 | 326 | fn_name="zil_commit_waiter_return") |
338 | 327 | b.attach_kretprobe(event="zio_alloc_zil", |
339 | 328 | fn_name="zio_alloc_zil_return") |
340 | | -b.attach_kprobe(event="zil_commit_waiter_skip", |
341 | | - fn_name="zil_commit_waiter_skip_entry") |
342 | 329 | b.attach_kprobe(event="zil_commit_writer_stall", |
343 | 330 | fn_name="zil_commit_writer_stall_entry") |
344 | 331 |
|
|
354 | 341 | BCCHelper.COUNT_AGGREGATION, "count") |
355 | 342 | call_count_helper.add_key_type("name") |
356 | 343 |
|
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 |
| 344 | +# |
| 345 | +# Collect data until keyboard interrupt |
| 346 | +# |
| 347 | +print(" Tracing enabled... Hit Ctrl-C to end.") |
373 | 348 | while True: |
374 | 349 | try: |
375 | | - sleep(60) |
| 350 | + sleep(args.collection_sec) |
376 | 351 | except KeyboardInterrupt: |
377 | 352 | print("%-16s\n" % strftime("%D - %H:%M:%S %Z")) |
378 | 353 | latency_helper.printall() |
|
0 commit comments