mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
perf trace: Add --bitmask-list command-line option
Introduce a new '--bitmask-list' command-line option for 'perf trace'.
When this option is specified, the formatting of cpumasks is delegated
to bitmap_scnprintf(), enabling cpumasks to be displayed as a condensed,
human-readable list (e.g., "0,2-5,7") instead of the default hexadecimal
representation. An example is provided below:
❯ sudo ./perf trace --show-cpu --bitmask-list --event ipi:ipi_send_cpumask --max-event 5
0.000 [000] Xorg/1434 ipi:ipi_send_cpumask(cpumask: 2-3,6, callsite: 0xffffffff9994f8e4, callback: 0xffffffff9994fdd0)
694.527 [002] chrome/2894 ipi:ipi_send_cpumask(cpumask: 1,3-5, callsite: 0xffffffff9994f8e4, callback: 0xffffffff9994fdd0)
2666.608 [003] Chrome_ChildIO/2948 ipi:ipi_send_cpumask(cpumask: 4,7, callsite: 0xffffffff9994f8e4, callback: 0xffffffff9994fdd0)
2673.638 [000] Chrome_IOThrea/2920 ipi:ipi_send_cpumask(cpumask: 2-5, callsite: 0xffffffff9994f8e4, callback: 0xffffffff9994fdd0)
2714.228 [005] chrome/3375 ipi:ipi_send_cpumask(cpumask: 0-4,6-7, callsite: 0xffffffff9994f8e4, callback: 0xffffffff9994fdd0)
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
89493fe58c
commit
ab74d1fbe0
|
|
@ -247,6 +247,10 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
|
|||
pretty-printing serves as a fallback to hand-crafted pretty printers, as the latter can
|
||||
better pretty-print integer flags and struct pointers.
|
||||
|
||||
--bitmask-list::
|
||||
Show bitmasks as a human-readable, condensed list (e.g. "0,2-5,7")
|
||||
instead of the default hexadecimal representation.
|
||||
|
||||
--bpf-summary::
|
||||
Collect system call statistics in BPF. This is only for live mode and
|
||||
works well with -s/--summary option where no argument information is
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ struct trace {
|
|||
bool force;
|
||||
bool vfs_getname;
|
||||
bool force_btf;
|
||||
bool bitmask_list;
|
||||
bool summary_bpf;
|
||||
int trace_pgfaults;
|
||||
char *perfconfig_events;
|
||||
|
|
@ -3280,6 +3281,9 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct perf_sample *
|
|||
|
||||
if (syscall_arg.len == 0) {
|
||||
printed += scnprintf(bf + printed, size - printed, "0");
|
||||
} else if (trace->bitmask_list) {
|
||||
printed += bitmap_scnprintf(mask, syscall_arg.len * 8,
|
||||
bf + printed, size - printed);
|
||||
} else {
|
||||
int i;
|
||||
bool skip_zero = true;
|
||||
|
|
@ -5593,6 +5597,7 @@ int cmd_trace(int argc, const char **argv)
|
|||
"start"),
|
||||
OPT_BOOLEAN(0, "force-btf", &trace.force_btf, "Prefer btf_dump general pretty printer"
|
||||
"to customized ones"),
|
||||
OPT_BOOLEAN(0, "bitmask-list", &trace.bitmask_list, "Show bitmask as a human-readable list"),
|
||||
OPT_BOOLEAN(0, "bpf-summary", &trace.summary_bpf, "Summary syscall stats in BPF"),
|
||||
OPT_INTEGER(0, "max-summary", &trace.max_summary,
|
||||
"Max number of entries in the summary."),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user