Home
last modified time | relevance | path

Searched refs:val (Results 1 – 25 of 422) sorted by relevance

12345678910>>...17

/tools/testing/selftests/kvm/x86_64/
Dtsc_msrs_test.c23 u64 val = 0; in guest_code() local
25 GUEST_ASSERT_EQ(rounded_rdmsr(MSR_IA32_TSC), val); in guest_code()
26 GUEST_ASSERT_EQ(rounded_rdmsr(MSR_IA32_TSC_ADJUST), val); in guest_code()
29 val = 1ull * GUEST_STEP; in guest_code()
30 wrmsr(MSR_IA32_TSC, val); in guest_code()
31 GUEST_ASSERT_EQ(rounded_rdmsr(MSR_IA32_TSC), val); in guest_code()
32 GUEST_ASSERT_EQ(rounded_rdmsr(MSR_IA32_TSC_ADJUST), val); in guest_code()
36 val = 2ull * GUEST_STEP; in guest_code()
37 wrmsr(MSR_IA32_TSC_ADJUST, val); in guest_code()
38 GUEST_ASSERT_EQ(rounded_rdmsr(MSR_IA32_TSC), val); in guest_code()
[all …]
/tools/include/linux/
Dhash.h16 #define hash_long(val, bits) hash_32(val, bits) argument
18 #define hash_long(val, bits) hash_64(val, bits) argument
60 static inline u32 __hash_32_generic(u32 val) in __hash_32_generic() argument
62 return val * GOLDEN_RATIO_32; in __hash_32_generic()
68 static inline u32 hash_32_generic(u32 val, unsigned int bits) in hash_32_generic() argument
71 return __hash_32(val) >> (32 - bits); in hash_32_generic()
77 static __always_inline u32 hash_64_generic(u64 val, unsigned int bits) in hash_64_generic() argument
81 return val * GOLDEN_RATIO_64 >> (64 - bits); in hash_64_generic()
84 return hash_32((u32)val ^ __hash_32(val >> 32), bits); in hash_64_generic()
96 unsigned long val = (unsigned long)ptr; in hash32_ptr() local
[all …]
Drefcount.h78 unsigned int old, new, val = atomic_read(&r->refs); in refcount_inc_not_zero() local
81 new = val + 1; in refcount_inc_not_zero()
83 if (!val) in refcount_inc_not_zero()
89 old = atomic_cmpxchg_relaxed(&r->refs, val, new); in refcount_inc_not_zero()
90 if (old == val) in refcount_inc_not_zero()
93 val = old; in refcount_inc_not_zero()
123 unsigned int old, new, val = atomic_read(&r->refs); in refcount_sub_and_test() local
126 if (unlikely(val == UINT_MAX)) in refcount_sub_and_test()
129 new = val - i; in refcount_sub_and_test()
130 if (new > val) { in refcount_sub_and_test()
[all …]
/tools/testing/selftests/bpf/progs/
Dtimer.c156 static int timer_cb2(void *map, int *key, struct hmap_elem *val) in timer_cb2() argument
162 if (val->counter > 0 && --val->counter) { in timer_cb2()
164 bpf_timer_start(&val->timer, 1000, 0); in timer_cb2()
182 if (bpf_timer_cancel(&val->timer) != -EDEADLK) in timer_cb2()
195 if (bpf_timer_start(&val->timer, 1000, 0) != -EINVAL) in timer_cb2()
203 if (bpf_timer_cancel(&val->timer) != -EDEADLK) in timer_cb2()
220 if (bpf_timer_start(&val->timer, 1ull << 35, 0) != 0) in timer_cb2()
229 struct hmap_elem *val; in bpf_timer_test() local
232 val = bpf_map_lookup_elem(&hmap, &key); in bpf_timer_test()
233 if (val) { in bpf_timer_test()
[all …]
Dtimer_mim.c39 static int timer_cb1(void *map, int *key, struct hmap_elem *val);
41 static int timer_cb2(void *map, int *key, struct hmap_elem *val) in timer_cb2() argument
44 bpf_timer_set_callback(&val->timer, timer_cb1); in timer_cb2()
45 if (bpf_timer_start(&val->timer, 1000, 0)) in timer_cb2()
52 static int timer_cb1(void *map, int *key, struct hmap_elem *val) in timer_cb1() argument
55 bpf_timer_set_callback(&val->timer, timer_cb2); in timer_cb1()
56 if (bpf_timer_start(&val->timer, 1000, 0)) in timer_cb1()
69 struct hmap_elem *val; in BPF_PROG() local
78 val = bpf_map_lookup_elem(inner_map, &hash_key); in BPF_PROG()
79 if (!val) in BPF_PROG()
[all …]
Dlinked_maps2.c42 int key = 2, val = 2; in BPF_PROG() local
47 bpf_map_update_elem(&map2, &key, &val, 0); in BPF_PROG()
48 bpf_map_update_elem(&map_weak, &key, &val, 0); in BPF_PROG()
57 int key = 1, *val; in BPF_PROG() local
65 val = bpf_map_lookup_elem(&map2, &key); in BPF_PROG()
66 if (val) in BPF_PROG()
67 output_second2 = *val; in BPF_PROG()
69 val = bpf_map_lookup_elem(&map_weak, &key); in BPF_PROG()
70 if (val) in BPF_PROG()
71 output_weak2 = *val; in BPF_PROG()
Dlinked_maps1.c48 int key = 1, val = 1; in BPF_PROG() local
53 bpf_map_update_elem(&map2, &key, &val, 0); in BPF_PROG()
54 bpf_map_update_elem(&map_weak, &key, &val, 0); in BPF_PROG()
63 int key = 2, *val; in BPF_PROG() local
71 val = bpf_map_lookup_elem(&map2, &key); in BPF_PROG()
72 if (val) in BPF_PROG()
73 output_second1 = *val; in BPF_PROG()
75 val = bpf_map_lookup_elem(&map_weak, &key); in BPF_PROG()
76 if (val) in BPF_PROG()
77 output_weak1 = *val; in BPF_PROG()
Dperf_event_stackmap.c35 long val; in oncpu() local
37 val = bpf_get_stackid(ctx, &stackmap, 0); in oncpu()
38 if (val > 0) in oncpu()
40 val = bpf_get_stackid(ctx, &stackmap, BPF_F_USER_STACK); in oncpu()
41 if (val > 0) in oncpu()
48 val = bpf_get_stack(ctx, trace, sizeof(stack_trace_t), 0); in oncpu()
49 if (val > 0) in oncpu()
52 val = bpf_get_stack(ctx, trace, sizeof(stack_trace_t), BPF_F_USER_STACK); in oncpu()
53 if (val > 0) in oncpu()
/tools/lib/traceevent/plugins/
Dplugin_sched_switch.c12 static void write_state(struct trace_seq *s, int val) in write_state() argument
19 if (!(val & (1 << i))) in write_state()
58 unsigned long long val; in sched_wakeup_handler() local
60 if (tep_get_field_val(s, event, "pid", record, &val, 1)) in sched_wakeup_handler()
65 write_and_save_comm(field, record, s, val); in sched_wakeup_handler()
68 trace_seq_printf(s, "%lld", val); in sched_wakeup_handler()
70 if (tep_get_field_val(s, event, "prio", record, &val, 0) == 0) in sched_wakeup_handler()
71 trace_seq_printf(s, " [%lld]", val); in sched_wakeup_handler()
73 if (tep_get_field_val(s, event, "success", record, &val, 1) == 0) in sched_wakeup_handler()
74 trace_seq_printf(s, " success=%lld", val); in sched_wakeup_handler()
[all …]
/tools/include/tools/
Dbe_byteshift.h23 static inline void __put_unaligned_be16(uint16_t val, uint8_t *p) in __put_unaligned_be16() argument
25 *p++ = val >> 8; in __put_unaligned_be16()
26 *p++ = val; in __put_unaligned_be16()
29 static inline void __put_unaligned_be32(uint32_t val, uint8_t *p) in __put_unaligned_be32() argument
31 __put_unaligned_be16(val >> 16, p); in __put_unaligned_be32()
32 __put_unaligned_be16(val, p + 2); in __put_unaligned_be32()
35 static inline void __put_unaligned_be64(uint64_t val, uint8_t *p) in __put_unaligned_be64() argument
37 __put_unaligned_be32(val >> 32, p); in __put_unaligned_be64()
38 __put_unaligned_be32(val, p + 4); in __put_unaligned_be64()
56 static inline void put_unaligned_be16(uint16_t val, void *p) in put_unaligned_be16() argument
[all …]
Dle_byteshift.h23 static inline void __put_unaligned_le16(uint16_t val, uint8_t *p) in __put_unaligned_le16() argument
25 *p++ = val; in __put_unaligned_le16()
26 *p++ = val >> 8; in __put_unaligned_le16()
29 static inline void __put_unaligned_le32(uint32_t val, uint8_t *p) in __put_unaligned_le32() argument
31 __put_unaligned_le16(val >> 16, p + 2); in __put_unaligned_le32()
32 __put_unaligned_le16(val, p); in __put_unaligned_le32()
35 static inline void __put_unaligned_le64(uint64_t val, uint8_t *p) in __put_unaligned_le64() argument
37 __put_unaligned_le32(val >> 32, p + 4); in __put_unaligned_le64()
38 __put_unaligned_le32(val, p); in __put_unaligned_le64()
56 static inline void put_unaligned_le16(uint16_t val, void *p) in put_unaligned_le16() argument
[all …]
/tools/include/asm-generic/bitops/
Dfind.h27 unsigned long val; in find_next_bit() local
32 val = *addr & GENMASK(size - 1, offset); in find_next_bit()
33 return val ? __ffs(val) : size; in find_next_bit()
57 unsigned long val; in find_next_and_bit() local
62 val = *addr1 & *addr2 & GENMASK(size - 1, offset); in find_next_and_bit()
63 return val ? __ffs(val) : size; in find_next_and_bit()
85 unsigned long val; in find_next_zero_bit() local
90 val = *addr | ~GENMASK(size - 1, offset); in find_next_zero_bit()
91 return val == ~0UL ? size : ffz(val); in find_next_zero_bit()
112 unsigned long val = *addr & GENMASK(size - 1, 0); in find_first_bit() local
[all …]
/tools/testing/ktest/examples/bootconfigs/
Dverify-functiongraph.sh7 val="$2"
9 if [ "$content" != "$val" ]; then
10 echo "FAILED: $file has '$content', expected '$val'"
17 val="$2"
18 content=`cat $file | sed -ne "/^$val/p"`
20 echo "FAILED: $file does not contain '$val'"
28 val="$2"
30 if ! grep -q "$val" $file ; then
31 echo "FAILED: $file does not contain $val"
39 val="$2"
[all …]
Dverify-tracing.sh7 val="$2"
9 if [ "$content" != "$val" ]; then
10 echo "FAILED: $file has '$content', expected '$val'"
17 val="$2"
18 content=`cat $file | sed -ne "/^$val/p"`
20 echo "FAILED: $file does not contain '$val'"
28 val="$2"
30 if ! grep -q "$val" $file ; then
31 echo "FAILED: $file does not contain $val"
39 val="$2"
[all …]
Dverify-boottrace.sh7 val="$2"
9 if [ "$content" != "$val" ]; then
10 echo "FAILED: $file has '$content', expected '$val'"
17 val="$2"
18 content=`cat $file | sed -ne "/^$val/p"`
20 echo "FAILED: $file does not contain '$val'"
28 val="$2"
30 if ! grep -q "$val" $file ; then
31 echo "FAILED: $file does not contain $val"
39 val="$2"
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dbtf_map_in_map.c28 int err, key = 0, val, i, fd; in test_lookup_update() local
53 bpf_map_lookup_elem(map1_fd, &key, &val); in test_lookup_update()
54 CHECK(val != 1, "inner1", "got %d != exp %d\n", val, 1); in test_lookup_update()
55 bpf_map_lookup_elem(map2_fd, &key, &val); in test_lookup_update()
56 CHECK(val != 2, "inner2", "got %d != exp %d\n", val, 2); in test_lookup_update()
57 bpf_map_lookup_elem(map3_fd, &key, &val); in test_lookup_update()
58 CHECK(val != 3, "inner3", "got %d != exp %d\n", val, 3); in test_lookup_update()
66 bpf_map_lookup_elem(map1_fd, &key, &val); in test_lookup_update()
67 CHECK(val != 4, "inner1", "got %d != exp %d\n", val, 4); in test_lookup_update()
68 bpf_map_lookup_elem(map2_fd, &key, &val); in test_lookup_update()
[all …]
/tools/objtool/include/objtool/
Dendianness.h25 #define bswap_if_needed(val) \ argument
27 __typeof__(val) __ret; \
28 switch (sizeof(val)) { \
29 case 8: __ret = __NEED_BSWAP ? bswap_64(val) : (val); break; \
30 case 4: __ret = __NEED_BSWAP ? bswap_32(val) : (val); break; \
31 case 2: __ret = __NEED_BSWAP ? bswap_16(val) : (val); break; \
/tools/include/uapi/linux/
Dlirc.h24 #define LIRC_SPACE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_SPACE) argument
25 #define LIRC_PULSE(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_PULSE) argument
26 #define LIRC_FREQUENCY(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_FREQUENCY) argument
27 #define LIRC_TIMEOUT(val) (((val)&LIRC_VALUE_MASK) | LIRC_MODE2_TIMEOUT) argument
29 #define LIRC_VALUE(val) ((val)&LIRC_VALUE_MASK) argument
30 #define LIRC_MODE2(val) ((val)&LIRC_MODE2_MASK) argument
32 #define LIRC_IS_SPACE(val) (LIRC_MODE2(val) == LIRC_MODE2_SPACE) argument
33 #define LIRC_IS_PULSE(val) (LIRC_MODE2(val) == LIRC_MODE2_PULSE) argument
34 #define LIRC_IS_FREQUENCY(val) (LIRC_MODE2(val) == LIRC_MODE2_FREQUENCY) argument
35 #define LIRC_IS_TIMEOUT(val) (LIRC_MODE2(val) == LIRC_MODE2_TIMEOUT) argument
/tools/virtio/linux/
Dvirtio_config.h64 static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) in virtio16_to_cpu() argument
66 return __virtio16_to_cpu(virtio_is_little_endian(vdev), val); in virtio16_to_cpu()
69 static inline __virtio16 cpu_to_virtio16(struct virtio_device *vdev, u16 val) in cpu_to_virtio16() argument
71 return __cpu_to_virtio16(virtio_is_little_endian(vdev), val); in cpu_to_virtio16()
74 static inline u32 virtio32_to_cpu(struct virtio_device *vdev, __virtio32 val) in virtio32_to_cpu() argument
76 return __virtio32_to_cpu(virtio_is_little_endian(vdev), val); in virtio32_to_cpu()
79 static inline __virtio32 cpu_to_virtio32(struct virtio_device *vdev, u32 val) in cpu_to_virtio32() argument
81 return __cpu_to_virtio32(virtio_is_little_endian(vdev), val); in cpu_to_virtio32()
84 static inline u64 virtio64_to_cpu(struct virtio_device *vdev, __virtio64 val) in virtio64_to_cpu() argument
86 return __virtio64_to_cpu(virtio_is_little_endian(vdev), val); in virtio64_to_cpu()
[all …]
/tools/power/cpupower/utils/helpers/
Dmsr.c26 int read_msr(int cpu, unsigned int idx, unsigned long long *val) in read_msr() argument
37 if (read(fd, val, sizeof *val) != sizeof *val) in read_msr()
55 int write_msr(int cpu, unsigned int idx, unsigned long long val) in write_msr() argument
66 if (write(fd, &val, sizeof val) != sizeof val) in write_msr()
77 unsigned long long val; in msr_intel_get_turbo_ratio() local
83 ret = read_msr(cpu, MSR_NEHALEM_TURBO_RATIO_LIMIT, &val); in msr_intel_get_turbo_ratio()
86 return val; in msr_intel_get_turbo_ratio()
/tools/perf/trace/beauty/
Dfcntl.c12 static size_t fcntl__scnprintf_getfd(unsigned long val, char *bf, size_t size, bool show_prefix) in fcntl__scnprintf_getfd() argument
14 return val ? scnprintf(bf, size, "%s", "0") : in fcntl__scnprintf_getfd()
20 return fcntl__scnprintf_getfd(arg->val, bf, size, arg->show_string_prefix); in syscall_arg__scnprintf_fcntl_getfd()
23 static size_t fcntl__scnprintf_getlease(unsigned long val, char *bf, size_t size, bool show_prefix) in fcntl__scnprintf_getlease() argument
28 return strarray__scnprintf(&strarray__fcntl_setlease, bf, size, "%x", show_prefix, val); in fcntl__scnprintf_getlease()
33 return fcntl__scnprintf_getlease(arg->val, bf, size, arg->show_string_prefix); in syscall_arg__scnprintf_fcntl_getlease()
38 if (arg->val == F_GETFL) { in syscall_arg__scnprintf_fcntl_cmd()
42 if (arg->val == F_GETFD) { in syscall_arg__scnprintf_fcntl_cmd()
46 if (arg->val == F_DUPFD_CLOEXEC || arg->val == F_DUPFD) { in syscall_arg__scnprintf_fcntl_cmd()
50 if (arg->val == F_GETOWN) { in syscall_arg__scnprintf_fcntl_cmd()
[all …]
/tools/perf/arch/x86/tests/
Dinsn-x86.c39 int val; in get_op() member
54 struct val_data *val; in get_op() local
59 for (val = vals; val->name; val++) { in get_op()
60 if (!strcmp(val->name, op_str)) in get_op()
61 return val->val; in get_op()
73 int val; in get_branch() member
81 struct val_data *val; in get_branch() local
86 for (val = vals; val->name; val++) { in get_branch()
87 if (!strcmp(val->name, branch_str)) in get_branch()
88 return val->val; in get_branch()
/tools/perf/tests/
Dparse-metric.c91 u64 val; member
100 return v->val; in find_value()
215 { .event = "inst_retired.any", .val = 300 }, in test_ipc()
216 { .event = "cpu_clk_unhalted.thread", .val = 200 }, in test_ipc()
232 { .event = "idq_uops_not_delivered.core", .val = 300 }, in test_frontend()
233 { .event = "cpu_clk_unhalted.thread", .val = 200 }, in test_frontend()
234 { .event = "cpu_clk_unhalted.one_thread_active", .val = 400 }, in test_frontend()
235 { .event = "cpu_clk_unhalted.ref_xclk", .val = 600 }, in test_frontend()
251 { .event = "l1d-loads-misses", .val = 300 }, in test_cache_miss_cycles()
252 { .event = "l1i-loads-misses", .val = 200 }, in test_cache_miss_cycles()
[all …]
/tools/testing/selftests/powerpc/ptrace/
Dptrace-gpr.h21 int validate_gpr(unsigned long *gpr, unsigned long val) in validate_gpr() argument
26 if (gpr[i] != val) { in validate_gpr()
28 i+14, gpr[i], val); in validate_gpr()
39 int validate_fpr(unsigned long *fpr, unsigned long val) in validate_fpr() argument
44 if (fpr[i] != val) { in validate_fpr()
45 printf("FPR[%d]: %lx Expected: %lx\n", i, fpr[i], val); in validate_fpr()
56 int validate_fpr_float(float *fpr, float val) in validate_fpr_float() argument
61 if (fpr[i] != val) { in validate_fpr_float()
62 printf("FPR[%d]: %f Expected: %f\n", i, fpr[i], val); in validate_fpr_float()
/tools/testing/selftests/kvm/
Dset_memory_region_test.c45 uint64_t val; in guest_spin_on_val() local
48 val = READ_ONCE(*((uint64_t *)MEM_REGION_GPA)); in guest_spin_on_val()
49 } while (val == spin_val); in guest_spin_on_val()
52 return val; in guest_spin_on_val()
152 uint64_t val; in guest_code_move_memory_region() local
162 val = guest_spin_on_val(0); in guest_code_move_memory_region()
163 GUEST_ASSERT_1(val == 1 || val == MMIO_VAL, val); in guest_code_move_memory_region()
166 val = guest_spin_on_val(MMIO_VAL); in guest_code_move_memory_region()
167 GUEST_ASSERT_1(val == 1 || val == 0, val); in guest_code_move_memory_region()
170 val = guest_spin_on_val(0); in guest_code_move_memory_region()
[all …]

12345678910>>...17