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
204 204
205 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, /* save low level index of raw branch records */205 PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17, /* save low level index of raw branch records */
206 206
207 PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT = 18, /* save privilege mode */
208
207 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */209 PERF_SAMPLE_BRANCH_MAX_SHIFT /* non-ABI */
208};210};
209 211
@@ -233,6 +235,8 @@ enum perf_branch_sample_type { · 23 unmodified lines
233 235
234 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,236 PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
235 237
238 PERF_SAMPLE_BRANCH_PRIV_SAVE = 1U << PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT,
239
236 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,240 PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
237};241};
238 242
@@ -271,6 +275,13 @@ enum { · 32 unmodified lines
271 PERF_BR_NEW_MAX,275 PERF_BR_NEW_MAX,
272};276};
273 277
278enum {
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
274#define PERF_SAMPLE_BRANCH_PLM_ALL \285#define PERF_SAMPLE_BRANCH_PLM_ALL \
275 (PERF_SAMPLE_BRANCH_USER|\286 (PERF_SAMPLE_BRANCH_USER|\
276 PERF_SAMPLE_BRANCH_KERNEL|\287 PERF_SAMPLE_BRANCH_KERNEL|\
@@ -1389,7 +1400,8 @@ struct perf_branch_entry { · 1112 unmodified lines
1389 cycles:16, /* cycle count to last branch */1400 cycles:16, /* cycle count to last branch */
1390 type:4, /* branch type */1401 type:4, /* branch type */
1391 new_type:4, /* additional branch type */1402 new_type:4, /* additional branch type */
1392 reserved:36;1403 priv:3, /* privilege level */
1404 reserved:33;
1393};1405};
1394 1406
1395union perf_sample_weight {1407union 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