mm: rename alloc_pages_exact_node() to __alloc_pages_node()
[linux/fpc-iii.git] / tools / perf / util / perf_regs.c
blob885e8ac83997905db7baa0d334015b5cf46e37d9
1 #include <errno.h>
2 #include "perf_regs.h"
3 #include "event.h"
5 const struct sample_reg __weak sample_reg_masks[] = {
6 SMPL_REG_END
7 };
9 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
11 int i, idx = 0;
12 u64 mask = regs->mask;
14 if (regs->cache_mask & (1 << id))
15 goto out;
17 if (!(mask & (1 << id)))
18 return -EINVAL;
20 for (i = 0; i < id; i++) {
21 if (mask & (1 << i))
22 idx++;
25 regs->cache_mask |= (1 << id);
26 regs->cache_regs[id] = regs->regs[idx];
28 out:
29 *valp = regs->cache_regs[id];
30 return 0;