Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf script: Display new D (Intr Disabled) and t (Intr Toggle) flags

Amend the display to include D and t flags in the same way as the x flag.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20220124084201.2699795-21-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
26738598 a48b96ca

+24 -13
+8 -5
tools/perf/Documentation/perf-script.txt
··· 195 195 At this point usage is displayed, and perf-script exits. 196 196 197 197 The flags field is synthesized and may have a value when Instruction 198 - Trace decoding. The flags are "bcrosyiABExgh" which stand for branch, 198 + Trace decoding. The flags are "bcrosyiABExghDt" which stand for branch, 199 199 call, return, conditional, system, asynchronous, interrupt, 200 - transaction abort, trace begin, trace end, in transaction, VM-Entry, and VM-Exit 201 - respectively. Known combinations of flags are printed more nicely e.g. 200 + transaction abort, trace begin, trace end, in transaction, VM-Entry, 201 + VM-Exit, interrupt disabled and interrupt disable toggle respectively. 202 + Known combinations of flags are printed more nicely e.g. 202 203 "call" for "bc", "return" for "br", "jcc" for "bo", "jmp" for "b", 203 204 "int" for "bci", "iret" for "bri", "syscall" for "bcs", "sysret" for "brs", 204 205 "async" for "by", "hw int" for "bcyi", "tx abrt" for "bA", "tr strt" for "bB", 205 206 "tr end" for "bE", "vmentry" for "bcg", "vmexit" for "bch". 206 - However the "x" flag will be displayed separately in those 207 - cases e.g. "jcc (x)" for a condition branch within a transaction. 207 + However the "x", "D" and "t" flags will be displayed separately in those 208 + cases e.g. "jcc (xD)" for a condition branch within a transaction 209 + with interrupts disabled. Note, interrupts becoming disabled is "t", 210 + whereas interrupts becoming enabled is "Dt". 208 211 209 212 The callindent field is synthesized and may have a value when 210 213 Instruction Trace decoding. For calls and returns, it will display the
+16 -8
tools/perf/builtin-script.c
··· 1579 1579 1580 1580 int perf_sample__sprintf_flags(u32 flags, char *str, size_t sz) 1581 1581 { 1582 + u32 xf = PERF_IP_FLAG_IN_TX | PERF_IP_FLAG_INTR_DISABLE | 1583 + PERF_IP_FLAG_INTR_TOGGLE; 1582 1584 const char *chars = PERF_IP_FLAG_CHARS; 1583 1585 const size_t n = strlen(PERF_IP_FLAG_CHARS); 1584 - bool in_tx = flags & PERF_IP_FLAG_IN_TX; 1585 1586 const char *name = NULL; 1586 1587 size_t i, pos = 0; 1588 + char xs[16] = {0}; 1587 1589 1588 - name = sample_flags_to_name(flags & ~PERF_IP_FLAG_IN_TX); 1590 + if (flags & xf) 1591 + snprintf(xs, sizeof(xs), "(%s%s%s)", 1592 + flags & PERF_IP_FLAG_IN_TX ? "x" : "", 1593 + flags & PERF_IP_FLAG_INTR_DISABLE ? "D" : "", 1594 + flags & PERF_IP_FLAG_INTR_TOGGLE ? "t" : ""); 1595 + 1596 + name = sample_flags_to_name(flags & ~xf); 1589 1597 if (name) 1590 - return snprintf(str, sz, "%-15s%4s", name, in_tx ? "(x)" : ""); 1598 + return snprintf(str, sz, "%-15s%6s", name, xs); 1591 1599 1592 1600 if (flags & PERF_IP_FLAG_TRACE_BEGIN) { 1593 - name = sample_flags_to_name(flags & ~(PERF_IP_FLAG_IN_TX | PERF_IP_FLAG_TRACE_BEGIN)); 1601 + name = sample_flags_to_name(flags & ~(xf | PERF_IP_FLAG_TRACE_BEGIN)); 1594 1602 if (name) 1595 - return snprintf(str, sz, "tr strt %-7s%4s", name, in_tx ? "(x)" : ""); 1603 + return snprintf(str, sz, "tr strt %-7s%6s", name, xs); 1596 1604 } 1597 1605 1598 1606 if (flags & PERF_IP_FLAG_TRACE_END) { 1599 - name = sample_flags_to_name(flags & ~(PERF_IP_FLAG_IN_TX | PERF_IP_FLAG_TRACE_END)); 1607 + name = sample_flags_to_name(flags & ~(xf | PERF_IP_FLAG_TRACE_END)); 1600 1608 if (name) 1601 - return snprintf(str, sz, "tr end %-7s%4s", name, in_tx ? "(x)" : ""); 1609 + return snprintf(str, sz, "tr end %-7s%6s", name, xs); 1602 1610 } 1603 1611 1604 1612 for (i = 0; i < n; i++, flags >>= 1) { ··· 1628 1620 char str[SAMPLE_FLAGS_BUF_SIZE]; 1629 1621 1630 1622 perf_sample__sprintf_flags(flags, str, sizeof(str)); 1631 - return fprintf(fp, " %-19s ", str); 1623 + return fprintf(fp, " %-21s ", str); 1632 1624 } 1633 1625 1634 1626 struct printer_data {