| /tools/testing/selftests/bpf/progs/ |
| D | test_ringbuf_map_key.c | 10 struct sample { struct 24 __type(key, struct sample); argument 38 struct sample *sample, sample_copy; in test_ringbuf_mem_map_key() local 44 sample = bpf_ringbuf_reserve(&ringbuf, sizeof(*sample), 0); in test_ringbuf_mem_map_key() 45 if (!sample) in test_ringbuf_mem_map_key() 48 sample->pid = pid; in test_ringbuf_mem_map_key() 49 bpf_get_current_comm(sample->comm, sizeof(sample->comm)); in test_ringbuf_mem_map_key() 50 sample->seq = ++seq; in test_ringbuf_mem_map_key() 51 sample->value = 42; in test_ringbuf_mem_map_key() 55 lookup_val = (int *)bpf_map_lookup_elem(&hash_map, sample); in test_ringbuf_mem_map_key() [all …]
|
| D | test_ringbuf.c | 10 struct sample { struct 43 struct sample *sample; in test_ringbuf() local 48 sample = bpf_ringbuf_reserve(&ringbuf, sizeof(*sample), 0); in test_ringbuf() 49 if (!sample) { in test_ringbuf() 54 sample->pid = pid; in test_ringbuf() 55 bpf_get_current_comm(sample->comm, sizeof(sample->comm)); in test_ringbuf() 56 sample->value = value; in test_ringbuf() 58 sample->seq = seq++; in test_ringbuf() 61 if (sample->seq & 1) { in test_ringbuf() 63 bpf_ringbuf_output(&ringbuf, sample, sizeof(*sample), flags); in test_ringbuf() [all …]
|
| D | test_ringbuf_n.c | 14 struct sample { struct 31 struct sample *sample; in test_ringbuf_n() local 36 sample = bpf_ringbuf_reserve(&ringbuf, sizeof(*sample), 0); in test_ringbuf_n() 37 if (!sample) in test_ringbuf_n() 40 sample->pid = pid; in test_ringbuf_n() 41 sample->value = value; in test_ringbuf_n() 42 bpf_get_current_comm(sample->comm, sizeof(sample->comm)); in test_ringbuf_n() 44 bpf_ringbuf_submit(sample, 0); in test_ringbuf_n()
|
| D | test_ringbuf_multi.c | 9 struct sample { struct 60 struct sample *sample; in test_ringbuf() local 72 sample = bpf_ringbuf_reserve(rb, sizeof(*sample), 0); in test_ringbuf() 73 if (!sample) { in test_ringbuf() 78 sample->pid = pid; in test_ringbuf() 79 bpf_get_current_comm(sample->comm, sizeof(sample->comm)); in test_ringbuf() 80 sample->value = value; in test_ringbuf() 82 sample->seq = total; in test_ringbuf() 85 bpf_ringbuf_submit(sample, 0); in test_ringbuf()
|
| D | test_lirc_mode2_kern.c | 11 int bpf_decoder(unsigned int *sample) in bpf_decoder() argument 13 if (LIRC_IS_PULSE(*sample)) { in bpf_decoder() 14 unsigned int duration = LIRC_VALUE(*sample); in bpf_decoder() 17 bpf_rc_keydown(sample, 0x40, duration & 0xffff, 0); in bpf_decoder() 19 bpf_rc_pointer_rel(sample, (duration >> 8) & 0xff, in bpf_decoder()
|
| D | user_ringbuf_fail.c | 10 struct sample { struct 32 const struct sample *sample; in bad_access1() argument 34 sample = bpf_dynptr_data(dynptr - 1, 0, sizeof(*sample)); in bad_access1() 55 const struct sample *sample; in bad_access2() local 57 sample = bpf_dynptr_data(dynptr + 1, 0, sizeof(*sample)); in bad_access2()
|
| D | ringbuf_bench.c | 37 long *sample, flags; in bench_ringbuf() local 42 sample = bpf_ringbuf_reserve(&ringbuf, in bench_ringbuf() 44 if (!sample) { in bench_ringbuf() 47 *sample = sample_val; in bench_ringbuf() 49 bpf_ringbuf_submit(sample, flags); in bench_ringbuf()
|
| /tools/perf/util/ |
| D | arm64-frame-pointer-unwind-support.c | 17 static bool get_leaf_frame_caller_enabled(struct perf_sample *sample) in get_leaf_frame_caller_enabled() argument 19 return callchain_param.record_mode == CALLCHAIN_FP && sample->user_regs.regs in get_leaf_frame_caller_enabled() 20 && sample->user_regs.mask & SMPL_REG_MASK(PERF_REG_ARM64_LR); in get_leaf_frame_caller_enabled() 31 u64 get_leaf_frame_caller_aarch64(struct perf_sample *sample, struct thread *thread, int usr_idx) in get_leaf_frame_caller_aarch64() argument 35 struct regs_dump old_regs = sample->user_regs; in get_leaf_frame_caller_aarch64() 37 if (!get_leaf_frame_caller_enabled(sample)) in get_leaf_frame_caller_aarch64() 46 if (!(sample->user_regs.mask & SMPL_REG_MASK(PERF_REG_ARM64_PC))) { in get_leaf_frame_caller_aarch64() 47 sample->user_regs.cache_mask |= SMPL_REG_MASK(PERF_REG_ARM64_PC); in get_leaf_frame_caller_aarch64() 48 sample->user_regs.cache_regs[PERF_REG_ARM64_PC] = sample->callchain->ips[usr_idx+1]; in get_leaf_frame_caller_aarch64() 51 if (!(sample->user_regs.mask & SMPL_REG_MASK(PERF_REG_ARM64_SP))) { in get_leaf_frame_caller_aarch64() [all …]
|
| D | bpf-filter.l | 14 static int sample(enum perf_bpf_filter_term term) in sample() function 17 perf_bpf_filter_lval.sample.term = term; in sample() 18 perf_bpf_filter_lval.sample.part = 0; in sample() 25 perf_bpf_filter_lval.sample.term = term; in sample_part() 26 perf_bpf_filter_lval.sample.part = part; in sample_part() 33 perf_bpf_filter_lval.sample.term = term; in sample_path() 34 perf_bpf_filter_lval.sample.part = 0; in sample_path() 88 ip { return sample(PBF_TERM_IP); } 89 id { return sample(PBF_TERM_ID); } 90 tid { return sample(PBF_TERM_TID); } [all …]
|
| D | dlfilter.h | 32 struct perf_sample *sample; member 45 const struct perf_dlfilter_sample *sample, 48 const struct perf_dlfilter_sample *sample, 60 struct perf_sample *sample, 71 struct perf_sample *sample, in dlfilter__filter_event() argument 79 return dlfilter__do_filter_event(d, event, sample, evsel, machine, al, addr_al, false); in dlfilter__filter_event() 84 struct perf_sample *sample, in dlfilter__filter_event_early() argument 92 return dlfilter__do_filter_event(d, event, sample, evsel, machine, al, addr_al, true); in dlfilter__filter_event_early()
|
| D | s390-sample-raw.c | 47 static bool s390_cpumcfdg_testctr(struct perf_sample *sample) in s390_cpumcfdg_testctr() argument 49 size_t len = sample->raw_size, offset = 0; in s390_cpumcfdg_testctr() 50 unsigned char *buf = sample->raw_data; in s390_cpumcfdg_testctr() 180 static void s390_cpumcfdg_dump(struct perf_pmu *pmu, struct perf_sample *sample) in s390_cpumcfdg_dump() argument 182 size_t i, len = sample->raw_size, offset = 0; in s390_cpumcfdg_dump() 183 unsigned char *buf = sample->raw_data; in s390_cpumcfdg_dump() 233 static bool s390_pai_all_test(struct perf_sample *sample) in s390_pai_all_test() argument 235 size_t len = sample->raw_size; in s390_pai_all_test() 242 static void s390_pai_all_dump(struct evsel *evsel, struct perf_sample *sample) in s390_pai_all_dump() argument 244 size_t len = sample->raw_size, offset = 0; in s390_pai_all_dump() [all …]
|
| D | intel-pt.c | 291 struct perf_sample *sample) in intel_pt_dump_sample() argument 297 intel_pt_dump(pt, sample->aux_sample.data, sample->aux_sample.size); in intel_pt_dump_sample() 1238 struct perf_sample *sample) in intel_pt_add_callchain() argument 1241 sample->pid, in intel_pt_add_callchain() 1242 sample->tid); in intel_pt_add_callchain() 1244 thread_stack__sample_late(thread, sample->cpu, pt->chain, in intel_pt_add_callchain() 1245 pt->synth_opts.callchain_sz + 1, sample->ip, in intel_pt_add_callchain() 1248 sample->callchain = pt->chain; in intel_pt_add_callchain() 1276 struct perf_sample *sample) in intel_pt_add_br_stack() argument 1279 sample->pid, in intel_pt_add_br_stack() [all …]
|
| D | print_insn.c | 20 size_t sample__fprintf_insn_raw(struct perf_sample *sample, FILE *fp) in sample__fprintf_insn_raw() argument 24 for (int i = 0; i < sample->insn_len; i++) { in sample__fprintf_insn_raw() 25 printed += fprintf(fp, "%02x", (unsigned char)sample->insn[i]); in sample__fprintf_insn_raw() 26 if (sample->insn_len - i > 1) in sample__fprintf_insn_raw() 154 size_t sample__fprintf_insn_asm(struct perf_sample *sample, struct thread *thread, in sample__fprintf_insn_asm() argument 161 printed = fprintf_insn_asm(machine, thread, sample->cpumode, is64bit, in sample__fprintf_insn_asm() 162 (uint8_t *)sample->insn, sample->insn_len, in sample__fprintf_insn_asm() 163 sample->ip, NULL, 0, fp); in sample__fprintf_insn_asm() 165 return sample__fprintf_insn_raw(sample, fp); in sample__fprintf_insn_asm() 170 size_t sample__fprintf_insn_asm(struct perf_sample *sample __maybe_unused, in sample__fprintf_insn_asm()
|
| /tools/perf/ |
| D | builtin-timechart.c | 286 struct cpu_sample *sample; in pid_put_sample() local 295 sample = zalloc(sizeof(*sample)); in pid_put_sample() 296 assert(sample != NULL); in pid_put_sample() 297 sample->start_time = start; in pid_put_sample() 298 sample->end_time = end; in pid_put_sample() 299 sample->type = type; in pid_put_sample() 300 sample->next = c->samples; in pid_put_sample() 301 sample->cpu = cpu; in pid_put_sample() 302 sample->backtrace = backtrace; in pid_put_sample() 303 c->samples = sample; in pid_put_sample() [all …]
|
| D | builtin-script.c | 775 static int perf_sample__fprintf_iregs(struct perf_sample *sample, in perf_sample__fprintf_iregs() argument 778 return perf_sample__fprintf_regs(&sample->intr_regs, in perf_sample__fprintf_iregs() 782 static int perf_sample__fprintf_uregs(struct perf_sample *sample, in perf_sample__fprintf_uregs() argument 785 return perf_sample__fprintf_regs(&sample->user_regs, in perf_sample__fprintf_uregs() 790 struct perf_sample *sample, in perf_sample__fprintf_start() argument 814 if (PRINT_FIELD(MACHINE_PID) && sample->machine_pid) in perf_sample__fprintf_start() 815 printed += fprintf(fp, "VM:%5d ", sample->machine_pid); in perf_sample__fprintf_start() 818 if (PRINT_FIELD(VCPU) && sample->machine_pid) in perf_sample__fprintf_start() 819 printed += fprintf(fp, "VCPU:%03d ", sample->vcpu); in perf_sample__fprintf_start() 833 printed += fprintf(fp, "%7d/%-7d ", sample->pid, sample->tid); in perf_sample__fprintf_start() [all …]
|
| /tools/testing/selftests/rust/ |
| D | test_probe_samples.sh | 23 for sample in "${rust_sample_modules[@]}"; do 24 if ! /sbin/modprobe -n -q "$sample"; then 25 ktap_skip_all "module $sample is not found in /lib/modules/$(uname -r)" 32 for sample in "${rust_sample_modules[@]}"; do 33 if /sbin/modprobe -q "$sample"; then 34 /sbin/modprobe -q -r "$sample" 35 ktap_test_pass "$sample" 37 ktap_test_fail "$sample"
|
| /tools/perf/scripts/python/ |
| D | intel-pt-events.py | 231 def common_start_str(comm, sample): argument 232 ts = sample["time"] 233 cpu = sample["cpu"] 234 pid = sample["pid"] 235 tid = sample["tid"] 236 if "machine_pid" in sample: 237 machine_pid = sample["machine_pid"] 238 vcpu = sample["vcpu"] 243 def print_common_start(comm, sample, name): argument 244 flags_disp = get_optional_null(sample, "flags_disp") [all …]
|
| D | arm-cs-trace-disasm.py | 113 def print_sample(sample): argument 116 (sample['cpu'], sample['addr'], sample['phys_addr'], \ 117 sample['ip'], sample['pid'], sample['tid'], \ 118 sample['period'], sample['time'])) 129 def common_start_str(comm, sample): argument 130 sec = int(sample["time"] / 1000000000) 131 ns = sample["time"] % 1000000000 132 cpu = sample["cpu"] 133 pid = sample["pid"] 134 tid = sample["tid"] [all …]
|
| /tools/perf/arch/x86/util/ |
| D | kvm-stat.c | 30 static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument 33 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key() 34 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key() 42 struct perf_sample *sample, struct event_key *key) in mmio_event_begin() argument 50 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin() 51 mmio_event_get_key(evsel, sample, key); in mmio_event_begin() 58 static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument 67 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_READ) { in mmio_event_end() 68 mmio_event_get_key(evsel, sample, key); in mmio_event_end() 93 struct perf_sample *sample, in ioport_event_get_key() argument [all …]
|
| D | archinsn.c | 9 void arch_fetch_insn(struct perf_sample *sample, in arch_fetch_insn() argument 17 if (!sample->ip) in arch_fetch_insn() 19 len = thread__memcpy(thread, machine, sample->insn, sample->ip, sizeof(sample->insn), &is64bit); in arch_fetch_insn() 23 ret = insn_decode(&insn, sample->insn, len, in arch_fetch_insn() 26 sample->insn_len = insn.length; in arch_fetch_insn()
|
| /tools/perf/dlfilters/ |
| D | dlfilter-show-cycles.c | 80 int filter_event_early(void *data, const struct perf_dlfilter_sample *sample, void *ctx) in filter_event_early() argument 82 __s32 cpu = sample->cpu; in filter_event_early() 83 __s32 tid = sample->tid; in filter_event_early() 86 if (!sample->cyc_cnt) in filter_event_early() 89 pos = event_entry(sample->event); in filter_event_early() 92 cycles[cpu][pos] += sample->cyc_cnt; in filter_event_early() 94 add_entry(tid, pos, sample->cyc_cnt); in filter_event_early() 106 int filter_event(void *data, const struct perf_dlfilter_sample *sample, void *ctx) in filter_event() argument 108 __s32 cpu = sample->cpu; in filter_event() 109 __s32 tid = sample->tid; in filter_event() [all …]
|
| D | dlfilter-test-api-v0.c | 181 if (sample->x != expected.x) \ 185 static int check_sample(struct filter_data *d, const struct perf_dlfilter_sample *sample) in check_sample() argument 202 CHECK(sample->size >= sizeof(struct perf_dlfilter_sample)); in check_sample() 217 CHECK(!sample->raw_data); in check_sample() 219 CHECK(!sample->brstack); in check_sample() 221 CHECK(!sample->raw_callchain); in check_sample() 224 CHECK(!strncmp(sample->event, EVENT_NAME, strlen(EVENT_NAME))); in check_sample() 257 static int check_address_al(void *ctx, const struct perf_dlfilter_sample *sample) in check_address_al() argument 267 if (perf_dlfilter_fns.resolve_address(ctx, sample->ip, &address_al)) in check_address_al() 292 static int check_object_code(void *ctx, const struct perf_dlfilter_sample *sample) in check_object_code() argument [all …]
|
| D | dlfilter-test-api-v2.c | 196 if (sample->x != expected.x) \ 200 static int check_sample(struct filter_data *d, const struct perf_dlfilter_sample *sample) in check_sample() argument 217 CHECK(sample->size >= sizeof(struct perf_dlfilter_sample)); in check_sample() 232 CHECK(!sample->raw_data); in check_sample() 234 CHECK(!sample->brstack); in check_sample() 236 CHECK(!sample->raw_callchain); in check_sample() 239 CHECK(!strncmp(sample->event, EVENT_NAME, strlen(EVENT_NAME))); in check_sample() 272 static int check_address_al(void *ctx, const struct perf_dlfilter_sample *sample) in check_address_al() argument 282 if (perf_dlfilter_fns.resolve_address(ctx, sample->ip, &address_al)) in check_address_al() 311 static int check_object_code(void *ctx, const struct perf_dlfilter_sample *sample) in check_object_code() argument [all …]
|
| /tools/perf/arch/s390/util/ |
| D | kvm-stat.c | 27 struct perf_sample *sample, in event_icpt_insn_get_key() argument 32 insn = evsel__intval(evsel, sample, "instruction"); in event_icpt_insn_get_key() 38 struct perf_sample *sample, in event_sigp_get_key() argument 41 key->key = evsel__intval(evsel, sample, "order_code"); in event_sigp_get_key() 46 struct perf_sample *sample, in event_diag_get_key() argument 49 key->key = evsel__intval(evsel, sample, "code"); in event_diag_get_key() 54 struct perf_sample *sample, in event_icpt_prog_get_key() argument 57 key->key = evsel__intval(evsel, sample, "code"); in event_icpt_prog_get_key()
|
| /tools/perf/arch/arm64/util/ |
| D | kvm-stat.c | 25 struct perf_sample *sample, in event_get_key() argument 29 key->key = evsel__intval(evsel, sample, kvm_exit_reason); in event_get_key() 38 key->key = evsel__intval(evsel, sample, kvm_trap_exit_reason); in event_get_key() 44 struct perf_sample *sample __maybe_unused, in event_begin() 51 struct perf_sample *sample, in event_end() argument 55 event_get_key(evsel, sample, key); in event_end()
|