/tools/lib/bpf/ |
D | bpf.c | 62 static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, in sys_bpf() argument 65 return syscall(__NR_bpf, cmd, attr, size); in sys_bpf() 68 static inline int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size) in sys_bpf_prog_load() argument 73 fd = sys_bpf(BPF_PROG_LOAD, attr, size); in sys_bpf_prog_load() 81 union bpf_attr attr; in bpf_create_map_xattr() local 83 memset(&attr, '\0', sizeof(attr)); in bpf_create_map_xattr() 85 attr.map_type = create_attr->map_type; in bpf_create_map_xattr() 86 attr.key_size = create_attr->key_size; in bpf_create_map_xattr() 87 attr.value_size = create_attr->value_size; in bpf_create_map_xattr() 88 attr.max_entries = create_attr->max_entries; in bpf_create_map_xattr() [all …]
|
/tools/arch/x86/include/asm/ |
D | inat.h | 110 static inline int inat_is_legacy_prefix(insn_attr_t attr) in inat_is_legacy_prefix() argument 112 attr &= INAT_PFX_MASK; in inat_is_legacy_prefix() 113 return attr && attr <= INAT_LGCPFX_MAX; in inat_is_legacy_prefix() 116 static inline int inat_is_address_size_prefix(insn_attr_t attr) in inat_is_address_size_prefix() argument 118 return (attr & INAT_PFX_MASK) == INAT_PFX_ADDRSZ; in inat_is_address_size_prefix() 121 static inline int inat_is_operand_size_prefix(insn_attr_t attr) in inat_is_operand_size_prefix() argument 123 return (attr & INAT_PFX_MASK) == INAT_PFX_OPNDSZ; in inat_is_operand_size_prefix() 126 static inline int inat_is_rex_prefix(insn_attr_t attr) in inat_is_rex_prefix() argument 128 return (attr & INAT_PFX_MASK) == INAT_PFX_REX; in inat_is_rex_prefix() 131 static inline int inat_last_prefix_id(insn_attr_t attr) in inat_last_prefix_id() argument [all …]
|
/tools/perf/tests/ |
D | parse-events.c | 53 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint() 55 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint() 56 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint() 69 PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint_multi() 71 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint_multi() 73 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint_multi() 83 TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type); in test__checkevent_raw() 84 TEST_ASSERT_VAL("wrong config", 0x1a == evsel->core.attr.config); in test__checkevent_raw() 93 TEST_ASSERT_VAL("wrong type", 1 == evsel->core.attr.type); in test__checkevent_numeric() 94 TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); in test__checkevent_numeric() [all …]
|
D | bp_account.c | 33 static int __event(bool is_x, void *addr, struct perf_event_attr *attr) in __event() argument 37 memset(attr, 0, sizeof(struct perf_event_attr)); in __event() 38 attr->type = PERF_TYPE_BREAKPOINT; in __event() 39 attr->size = sizeof(struct perf_event_attr); in __event() 41 attr->config = 0; in __event() 42 attr->bp_type = is_x ? HW_BREAKPOINT_X : HW_BREAKPOINT_W; in __event() 43 attr->bp_addr = (unsigned long) addr; in __event() 44 attr->bp_len = sizeof(long); in __event() 46 attr->sample_period = 1; in __event() 47 attr->sample_type = PERF_SAMPLE_IP; in __event() [all …]
|
D | wp.c | 35 static void get__perf_event_attr(struct perf_event_attr *attr, int wp_type, in get__perf_event_attr() argument 38 memset(attr, 0, sizeof(struct perf_event_attr)); in get__perf_event_attr() 39 attr->type = PERF_TYPE_BREAKPOINT; in get__perf_event_attr() 40 attr->size = sizeof(struct perf_event_attr); in get__perf_event_attr() 41 attr->config = 0; in get__perf_event_attr() 42 attr->bp_type = wp_type; in get__perf_event_attr() 43 attr->bp_addr = (unsigned long)wp_addr; in get__perf_event_attr() 44 attr->bp_len = wp_len; in get__perf_event_attr() 45 attr->sample_period = 1; in get__perf_event_attr() 46 attr->sample_type = PERF_SAMPLE_IP; in get__perf_event_attr() [all …]
|
D | task-exit.c | 93 evsel->core.attr.task = 1; in test__task_exit() 95 evsel->core.attr.sample_freq = 1000000; in test__task_exit() 97 evsel->core.attr.sample_freq = 1; in test__task_exit() 99 evsel->core.attr.inherit = 0; in test__task_exit() 100 evsel->core.attr.watermark = 0; in test__task_exit() 101 evsel->core.attr.wakeup_events = 1; in test__task_exit() 102 evsel->core.attr.exclude_kernel = 1; in test__task_exit()
|
D | pmu.c | 151 struct perf_event_attr attr; in test__pmu() local 153 memset(&attr, 0, sizeof(attr)); in test__pmu() 159 ret = perf_pmu__config_terms(&formats, &attr, terms, in test__pmu() 166 if (attr.config != 0xc00000000002a823) in test__pmu() 168 if (attr.config1 != 0x8000400000000145) in test__pmu() 170 if (attr.config2 != 0x0400000020041d07) in test__pmu()
|
/tools/testing/selftests/bpf/prog_tests/ |
D | obj_name.c | 25 union bpf_attr attr; in test_obj_name() local 30 ncopy = name_len < sizeof(attr.prog_name) ? in test_obj_name() 31 name_len : sizeof(attr.prog_name); in test_obj_name() 32 bzero(&attr, sizeof(attr)); in test_obj_name() 33 attr.prog_type = BPF_PROG_TYPE_SCHED_CLS; in test_obj_name() 34 attr.insn_cnt = 2; in test_obj_name() 35 attr.insns = ptr_to_u64(prog); in test_obj_name() 36 attr.license = ptr_to_u64(""); in test_obj_name() 37 memcpy(attr.prog_name, tests[i].name, ncopy); in test_obj_name() 39 fd = syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)); in test_obj_name() [all …]
|
D | bpf_verif_scale.c | 20 struct bpf_prog_load_attr attr; in check_load() local 24 memset(&attr, 0, sizeof(struct bpf_prog_load_attr)); in check_load() 25 attr.file = file; in check_load() 26 attr.prog_type = type; in check_load() 27 attr.log_level = 4; in check_load() 28 attr.prog_flags = BPF_F_TEST_RND_HI32; in check_load() 29 err = bpf_prog_load_xattr(&attr, &obj, &prog_fd); in check_load()
|
D | task_fd_query_tp.c | 9 struct perf_event_attr attr = {}; in test_task_fd_query_tp_core() local 31 attr.config = strtol(buf, NULL, 0); in test_task_fd_query_tp_core() 32 attr.type = PERF_TYPE_TRACEPOINT; in test_task_fd_query_tp_core() 33 attr.sample_type = PERF_SAMPLE_RAW; in test_task_fd_query_tp_core() 34 attr.sample_period = 1; in test_task_fd_query_tp_core() 35 attr.wakeup_events = 1; in test_task_fd_query_tp_core() 36 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_task_fd_query_tp_core()
|
D | send_signal.c | 11 static void test_send_signal_common(struct perf_event_attr *attr, in test_send_signal_common() argument 81 pmu_fd = syscall(__NR_perf_event_open, attr, pid, -1, in test_send_signal_common() 146 struct perf_event_attr attr = { in test_send_signal_tracepoint() local 169 attr.config = strtol(buf, NULL, 0); in test_send_signal_tracepoint() 171 test_send_signal_common(&attr, BPF_PROG_TYPE_TRACEPOINT, "tracepoint"); in test_send_signal_tracepoint() 176 struct perf_event_attr attr = { in test_send_signal_perf() local 182 test_send_signal_common(&attr, BPF_PROG_TYPE_PERF_EVENT, in test_send_signal_perf() 188 struct perf_event_attr attr = { in test_send_signal_nmi() local 199 pmu_fd = syscall(__NR_perf_event_open, &attr, 0 /* pid */, in test_send_signal_nmi() 213 test_send_signal_common(&attr, BPF_PROG_TYPE_PERF_EVENT, in test_send_signal_nmi()
|
/tools/testing/selftests/powerpc/ptrace/ |
D | perf-hwbreak.c | 37 static inline int sys_perf_event_open(struct perf_event_attr *attr, pid_t pid, in sys_perf_event_open() argument 41 attr->size = sizeof(*attr); in sys_perf_event_open() 42 return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags); in sys_perf_event_open() 47 struct perf_event_attr attr; in breakpoint_test() local 51 memset(&attr, 0, sizeof(attr)); in breakpoint_test() 52 attr.disabled = 1; in breakpoint_test() 53 attr.type = PERF_TYPE_BREAKPOINT; in breakpoint_test() 54 attr.bp_type = HW_BREAKPOINT_R; in breakpoint_test() 56 attr.bp_addr = (__u64)(&attr) & 0xfffffffffffff800; in breakpoint_test() 57 attr.bp_len = len; in breakpoint_test() [all …]
|
/tools/build/feature/ |
D | test-bpf.c | 24 union bpf_attr attr; in main() local 27 attr.prog_type = BPF_PROG_TYPE_KPROBE; in main() 28 attr.insn_cnt = 0; in main() 29 attr.insns = 0; in main() 30 attr.license = 0; in main() 31 attr.log_buf = 0; in main() 32 attr.log_size = 0; in main() 33 attr.log_level = 0; in main() 34 attr.kern_version = 0; in main() 35 attr.prog_flags = 0; in main() [all …]
|
/tools/testing/selftests/mqueue/ |
D | mq_open_tests.c | 68 static inline void test_queue(struct mq_attr *attr, struct mq_attr *result); 69 static inline int test_queue_fail(struct mq_attr *attr, struct mq_attr *result); 200 static inline void test_queue(struct mq_attr *attr, struct mq_attr *result) in test_queue() argument 205 if ((queue = mq_open(queue_path, flags, perms, attr)) == -1) in test_queue() 222 static inline int test_queue_fail(struct mq_attr *attr, struct mq_attr *result) in test_queue_fail() argument 227 if ((queue = mq_open(queue_path, flags, perms, attr)) == -1) in test_queue_fail() 241 struct mq_attr attr, result; in main() local 430 attr.mq_maxmsg = cur_max_msgs; in main() 431 attr.mq_msgsize = cur_max_msgsize; in main() 432 if (test_queue_fail(&attr, &result)) in main() [all …]
|
/tools/perf/util/ |
D | evsel.c | 183 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->core.attr.sample_type); in perf_evsel__calc_id_pos() 184 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); in perf_evsel__calc_id_pos() 190 if (!(evsel->core.attr.sample_type & bit)) { in __perf_evsel__set_sample_bit() 191 evsel->core.attr.sample_type |= bit; in __perf_evsel__set_sample_bit() 200 if (evsel->core.attr.sample_type & bit) { in __perf_evsel__reset_sample_bit() 201 evsel->core.attr.sample_type &= ~bit; in __perf_evsel__reset_sample_bit() 216 evsel->core.attr.read_format |= PERF_FORMAT_ID; in perf_evsel__set_sample_id() 238 struct perf_event_attr *attr, int idx) in evsel__init() argument 240 perf_evsel__init(&evsel->core, attr); in evsel__init() 252 evsel->sample_size = __perf_evsel__sample_size(attr->sample_type); in evsel__init() [all …]
|
/tools/testing/selftests/powerpc/pmu/ |
D | per_event_excludes.c | 40 e->attr.disabled = 1; in per_event_excludes() 45 e->attr.disabled = 1; in per_event_excludes() 46 e->attr.exclude_user = 1; in per_event_excludes() 47 e->attr.exclude_hv = 1; in per_event_excludes() 52 e->attr.disabled = 1; in per_event_excludes() 53 e->attr.exclude_user = 1; in per_event_excludes() 54 e->attr.exclude_kernel = 1; in per_event_excludes() 59 e->attr.disabled = 1; in per_event_excludes() 60 e->attr.exclude_hv = 1; in per_event_excludes() 61 e->attr.exclude_kernel = 1; in per_event_excludes()
|
D | event.c | 16 int perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu, in perf_event_open() argument 19 return syscall(__NR_perf_event_open, attr, pid, cpu, in perf_event_open() 29 e->attr.type = type; in event_init_opts() 30 e->attr.config = config; in event_init_opts() 31 e->attr.size = sizeof(e->attr); in event_init_opts() 33 e->attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | \ in event_init_opts() 54 e->fd = perf_event_open(&e->attr, pid, cpu, group_fd, 0); in event_open_with_options()
|
/tools/bpf/bpftool/ |
D | netlink_dumper.c | 14 static void xdp_dump_prog_id(struct nlattr **tb, int attr, in xdp_dump_prog_id() argument 18 if (!tb[attr]) in xdp_dump_prog_id() 24 NET_DUMP_UINT("id", " id %u", libbpf_nla_getattr_u32(tb[attr])) in xdp_dump_prog_id() 29 static int do_xdp_dump_one(struct nlattr *attr, unsigned int ifindex, in do_xdp_dump_one() argument 35 if (libbpf_nla_parse_nested(tb, IFLA_XDP_MAX, attr, NULL) < 0) in do_xdp_dump_one() 81 static int do_bpf_dump_one_act(struct nlattr *attr) in do_bpf_dump_one_act() argument 85 if (libbpf_nla_parse_nested(tb, TCA_ACT_BPF_MAX, attr, NULL) < 0) in do_bpf_dump_one_act() 102 static int do_dump_one_act(struct nlattr *attr) in do_dump_one_act() argument 106 if (!attr) in do_dump_one_act() 109 if (libbpf_nla_parse_nested(tb, TCA_ACT_MAX, attr, NULL) < 0) in do_dump_one_act() [all …]
|
/tools/testing/selftests/bpf/ |
D | test_stub.c | 11 struct bpf_prog_load_attr attr; in bpf_prog_test_load() local 13 memset(&attr, 0, sizeof(struct bpf_prog_load_attr)); in bpf_prog_test_load() 14 attr.file = file; in bpf_prog_test_load() 15 attr.prog_type = type; in bpf_prog_test_load() 16 attr.expected_attach_type = 0; in bpf_prog_test_load() 17 attr.prog_flags = BPF_F_TEST_RND_HI32; in bpf_prog_test_load() 19 return bpf_prog_load_xattr(&attr, pobj, prog_fd); in bpf_prog_test_load()
|
D | test_verifier_log.c | 50 union bpf_attr attr; in load() local 52 bzero(&attr, sizeof(attr)); in load() 53 attr.prog_type = BPF_PROG_TYPE_SOCKET_FILTER; in load() 54 attr.insn_cnt = (__u32)(sizeof(code_sample) / sizeof(struct bpf_insn)); in load() 55 attr.insns = ptr_to_u64(code_sample); in load() 56 attr.license = ptr_to_u64("GPL"); in load() 57 attr.log_buf = ptr_to_u64(log); in load() 58 attr.log_size = log_len; in load() 59 attr.log_level = log_level; in load() 61 return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr)); in load()
|
/tools/arch/x86/lib/ |
D | insn.c | 104 insn_attr_t attr; in insn_get_prefixes() local 116 attr = inat_get_opcode_attribute(b); in insn_get_prefixes() 117 while (inat_is_legacy_prefix(attr)) { in insn_get_prefixes() 126 if (inat_is_address_size_prefix(attr)) { in insn_get_prefixes() 132 } else if (inat_is_operand_size_prefix(attr)) { in insn_get_prefixes() 141 attr = inat_get_opcode_attribute(b); in insn_get_prefixes() 158 attr = inat_get_opcode_attribute(b); in insn_get_prefixes() 159 if (inat_is_rex_prefix(attr)) { in insn_get_prefixes() 172 attr = inat_get_opcode_attribute(b); in insn_get_prefixes() 173 if (inat_is_vex_prefix(attr)) { in insn_get_prefixes() [all …]
|
/tools/testing/selftests/powerpc/pmu/ebb/ |
D | event_attributes_test.c | 36 event.attr.exclusive = 0; in event_attributes() 43 event.attr.freq = 1; in event_attributes() 50 event.attr.sample_period = 1; in event_attributes() 57 event.attr.enable_on_exec = 1; in event_attributes() 64 event.attr.inherit = 1; in event_attributes() 96 leader.attr.config &= ~(1ull << 63); in event_attributes() 110 leader.attr.exclusive = 0; in event_attributes() 117 leader.attr.pinned = 0; in event_attributes()
|
/tools/perf/arch/arm64/util/ |
D | arm-spe.c | 78 if (evsel->core.attr.type == arm_spe_pmu->type) { in arm_spe_recording_options() 83 evsel->core.attr.freq = 0; in arm_spe_recording_options() 84 evsel->core.attr.sample_period = 1; in arm_spe_recording_options() 135 tracking_evsel->core.attr.freq = 0; in arm_spe_recording_options() 136 tracking_evsel->core.attr.sample_period = 1; in arm_spe_recording_options() 168 if (evsel->core.attr.type == sper->arm_spe_pmu->type) { in arm_spe_read_finish() 210 struct perf_event_attr *attr; in arm_spe_pmu_default_config() local 212 attr = zalloc(sizeof(struct perf_event_attr)); in arm_spe_pmu_default_config() 213 if (!attr) { in arm_spe_pmu_default_config() 223 &attr->sample_period) != 1) { in arm_spe_pmu_default_config() [all …]
|
/tools/perf/ |
D | perf-sys.h | 15 void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu, 23 sys_perf_event_open(struct perf_event_attr *attr, in sys_perf_event_open() argument 29 fd = syscall(__NR_perf_event_open, attr, pid, cpu, in sys_perf_event_open() 34 test_attr__open(attr, pid, cpu, fd, group_fd, flags); in sys_perf_event_open()
|
/tools/testing/selftests/powerpc/tm/ |
D | tm-unavailable.c | 298 void test_fp_vec(int fp, int vec, pthread_attr_t *attr) in test_fp_vec() argument 318 rc = pthread_create(&t0, attr, tm_una_ping, (void *) &flags); in test_fp_vec() 343 pthread_attr_t attr; in tm_unavailable_test() local 353 rc = pthread_attr_init(&attr); in tm_unavailable_test() 358 rc = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset); in tm_unavailable_test() 362 rc = pthread_create(&t1, &attr /* Bind to CPU 0 */, tm_una_pong, NULL); in tm_unavailable_test() 387 test_fp_vec(0, 0, &attr); in tm_unavailable_test() 388 test_fp_vec(1, 0, &attr); in tm_unavailable_test() 389 test_fp_vec(0, 1, &attr); in tm_unavailable_test() 390 test_fp_vec(1, 1, &attr); in tm_unavailable_test()
|