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.
Showing the changes to tools/include/uapi/linux (1 of 5 files). Show all
Unified · Split
| @@ -204,6 +204,8 @@ enum perf_branch_sample_type_shift { · 203 unmodified lines | ||
| 204 | 204 | |
| 205 | 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 | 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 | 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 | 240 | PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT, |
| 237 | 241 | }; |
| 238 | 242 | |
| @@ -271,6 +275,13 @@ enum { · 32 unmodified lines | ||
| 271 | 275 | PERF_BR_NEW_MAX, |
| 272 | 276 | }; |
| 273 | 277 | |
| 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 | + | |
| 274 | 285 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ |
| 275 | 286 | (PERF_SAMPLE_BRANCH_USER|\ |
| 276 | 287 | PERF_SAMPLE_BRANCH_KERNEL|\ |
| @@ -1389,7 +1400,8 @@ struct perf_branch_entry { · 1112 unmodified lines | ||
| 1389 | 1400 | cycles:16, /* cycle count to last branch */ |
| 1390 | 1401 | type:4, /* branch type */ |
| 1391 | 1402 | new_type:4, /* additional branch type */ |
| 1392 | − reserved:36; | |
| 1403 | + priv:3, /* privilege level */ | |
| 1404 | + reserved:33; | |
| 1393 | 1405 | }; |
| 1394 | 1406 | |
| 1395 | 1407 | union perf_sample_weight { |