From: Waldemar Kozaczuk <jwkozac...@gmail.com> Committer: Waldemar Kozaczuk <jwkozac...@gmail.com> Branch: master
trace.py: add --tracepoint to filter specific tracepoints Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> --- diff --git a/scripts/trace.py b/scripts/trace.py --- a/scripts/trace.py +++ b/scripts/trace.py @@ -110,11 +110,17 @@ def data_formatter(sample): return format_packet_sample(sample) return sample.format_data(sample) + def name_filter(sample): + if args.tracepoint: + return sample.name.startswith(args.tracepoint) + else: + return True + backtrace_formatter = get_backtrace_formatter(args) time_range = get_time_range(args) with get_trace_reader(args) as reader: for t in reader.get_traces(): - if t.time in time_range: + if t.time in time_range and name_filter(t): print(t.format(backtrace_formatter, data_formatter=data_formatter)) def mem_analys(args): @@ -671,6 +677,8 @@ def download_dump(args): cmd_list = subparsers.add_parser("list", help="list trace") add_trace_listing_options(cmd_list) cmd_list.add_argument("--tcpdump", action="store_true") + cmd_list.add_argument("-t", "--tracepoint", action="store", + help="prefix of name of the tracepoint to show; shows all by default") cmd_list.set_defaults(func=list_trace, paginate=True) cmd_wakeup_latency = subparsers.add_parser("wakeup-latency") -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/00000000000052745c05e507ffbd%40google.com.