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 Intel PT CFE (Control Flow Event) / EVD (Event Data) synthesized event

Similar to other Intel PT synth events, display Event Trace events recorded
by CFE / EVD packets.

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-19-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
5b11749b e9240355

+39
+39
tools/perf/builtin-script.c
··· 1811 1811 return len + perf_sample__fprintf_pt_spacing(len, fp); 1812 1812 } 1813 1813 1814 + /* Intel PT Event Trace */ 1815 + static int perf_sample__fprintf_synth_evt(struct perf_sample *sample, FILE *fp) 1816 + { 1817 + struct perf_synth_intel_evt *data = perf_sample__synth_ptr(sample); 1818 + const char *cfe[32] = {NULL, "INTR", "IRET", "SMI", "RSM", "SIPI", 1819 + "INIT", "VMENTRY", "VMEXIT", "VMEXIT_INTR", 1820 + "SHUTDOWN"}; 1821 + const char *evd[64] = {"PFA", "VMXQ", "VMXR"}; 1822 + const char *s; 1823 + int len, i; 1824 + 1825 + if (perf_sample__bad_synth_size(sample, *data)) 1826 + return 0; 1827 + 1828 + s = cfe[data->type]; 1829 + if (s) { 1830 + len = fprintf(fp, " cfe: %s IP: %d vector: %u", 1831 + s, data->ip, data->vector); 1832 + } else { 1833 + len = fprintf(fp, " cfe: %u IP: %d vector: %u", 1834 + data->type, data->ip, data->vector); 1835 + } 1836 + for (i = 0; i < data->evd_cnt; i++) { 1837 + unsigned int et = data->evd[i].evd_type & 0x3f; 1838 + 1839 + s = evd[et]; 1840 + if (s) { 1841 + len += fprintf(fp, " %s: %#" PRIx64, 1842 + s, data->evd[i].payload); 1843 + } else { 1844 + len += fprintf(fp, " EVD_%u: %#" PRIx64, 1845 + et, data->evd[i].payload); 1846 + } 1847 + } 1848 + return len + perf_sample__fprintf_pt_spacing(len, fp); 1849 + } 1850 + 1814 1851 static int perf_sample__fprintf_synth(struct perf_sample *sample, 1815 1852 struct evsel *evsel, FILE *fp) 1816 1853 { ··· 1866 1829 return perf_sample__fprintf_synth_cbr(sample, fp); 1867 1830 case PERF_SYNTH_INTEL_PSB: 1868 1831 return perf_sample__fprintf_synth_psb(sample, fp); 1832 + case PERF_SYNTH_INTEL_EVT: 1833 + return perf_sample__fprintf_synth_evt(sample, fp); 1869 1834 default: 1870 1835 break; 1871 1836 }