History

perf branch: Add branch privilege information request flag

This updates the perf tools with branch privilege information request flag i.e PERF_SAMPLE_BRANCH_PRIV_SAVE that has been added earlier in the kernel. This also updates 'perf record' documentation, branch_modes[], and generic branch privilege level enumeration as added earlier in the kernel.

Anshuman Khandual committed 4 years ago

Commit bcb96ce1 parent 0ddea8e5 files · +18 −3Browse files

Showing the changes to tools/include/uapi/linux (1 of 5 files). Show all

Unified · Split

tools/include/uapi/linux/perf_event.h+13−1
@@ -204,6 +204,8 @@ enum perf_branch_sample_type_shift { · 203 unmodified lines
204204
205205 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, /* save low level index of raw branch records */
206206
207+ PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */
208+
207209 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
208210 };
209211
@@ -233,6 +235,8 @@ enum perf_branch_sample_type { · 23 unmodified lines
233235
234236 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
235237
238+ PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
239+
236240 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
237241 };
238242
@@ -271,6 +275,13 @@ enum { · 32 unmodified lines
271275 PERF_BR_NEW_MAX,
272276 };
273277
278+enum {
279+ PERF_BR_PRIV_UNKNOWN = 0,
280+ PERF_BR_PRIV_USER = 1,
281+ PERF_BR_PRIV_KERNEL = 2,
282+ PERF_BR_PRIV_HV = 3,
283+};
284+
274285 #define PERF_SAMPLE_BRANCH_PLM_ALL \
275286 (PERF_SAMPLE_BRANCH_USER|\
276287 PERF_SAMPLE_BRANCH_KERNEL|\
@@ -1389,7 +1400,8 @@ struct perf_branch_entry { · 1112 unmodified lines
13891400 cycles:16, /* cycle count to last branch */
13901401 type:4, /* branch type */
13911402 new_type:4, /* additional branch type */
1392− reserved:36;
1403+ priv:3, /* privilege level */
1404+ reserved:33;
13931405 };
13941406
13951407 union perf_sample_weight {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t