| /linux/drivers/isdn/mISDN/ |
| H A D | dsp_audio.c | 105 static unsigned char linear2ulaw(short sample) in linear2ulaw() argument 128 sign = (sample >> 8) & 0x80; /* set aside the sign */ in linear2ulaw() 130 sample = -sample; /* get magnitude */ in linear2ulaw() 133 sample = sample + BIAS; in linear2ulaw() 134 exponent = exp_lut[(sample >> 7) & 0xFF]; in linear2ulaw() 135 mantissa = (sample >> (exponent + 3)) & 0x0F; in linear2ulaw() 242 s32 sample; in dsp_audio_generate_mix_table() local 248 sample = dsp_audio_law_to_s32[i]; in dsp_audio_generate_mix_table() 249 sample += dsp_audio_law_to_s32[j]; in dsp_audio_generate_mix_table() 250 if (sample > 32767) in dsp_audio_generate_mix_table() [all …]
|
| /linux/tools/perf/ |
| H A 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 …]
|
| H A D | builtin-script.c | 789 static int perf_sample__fprintf_iregs(struct perf_sample *sample, in perf_sample__fprintf_iregs() argument 792 if (!sample->intr_regs) in perf_sample__fprintf_iregs() 795 return perf_sample__fprintf_regs(perf_sample__intr_regs(sample), in perf_sample__fprintf_iregs() 799 static int perf_sample__fprintf_uregs(struct perf_sample *sample, in perf_sample__fprintf_uregs() argument 802 if (!sample->user_regs) in perf_sample__fprintf_uregs() 805 return perf_sample__fprintf_regs(perf_sample__user_regs(sample), in perf_sample__fprintf_uregs() 810 struct perf_sample *sample, in perf_sample__fprintf_start() argument 833 if (PRINT_FIELD(MACHINE_PID) && sample->machine_pid) in perf_sample__fprintf_start() 834 printed += fprintf(fp, "VM:%5d ", sample->machine_pid); in perf_sample__fprintf_start() 837 if (PRINT_FIELD(VCPU) && sample->machine_pid) in perf_sample__fprintf_start() [all …]
|
| H A D | builtin-kwork.c | 241 struct perf_sample *sample) in atom_new() argument 271 atom->time = sample->time; in atom_new() 396 struct perf_sample *sample) in profile_update_timespan() argument 401 if ((kwork->timestart == 0) || (kwork->timestart > sample->time)) in profile_update_timespan() 402 kwork->timestart = sample->time; in profile_update_timespan() 404 if (kwork->timeend < sample->time) in profile_update_timespan() 405 kwork->timeend = sample->time; in profile_update_timespan() 421 struct perf_sample *sample) in profile_event_match() argument 424 u64 time = sample->time; in profile_event_match() 443 profile_update_timespan(kwork, sample); in profile_event_match() [all …]
|
| H A D | builtin-inject.c | 48 struct perf_sample sample; member 145 struct perf_sample *sample, 152 struct perf_sample *sample, 300 struct perf_sample *sample __maybe_unused, in perf_event__repipe() 308 struct perf_sample *sample __maybe_unused, in perf_event__drop() 316 struct perf_sample *sample, in perf_event__drop_aux() argument 322 inject->aux_id = sample->id; in perf_event__drop_aux() 330 struct perf_sample *sample) in perf_inject__cut_auxtrace_sample() argument 332 size_t sz1 = sample->aux_sample.data - (void *)event; in perf_inject__cut_auxtrace_sample() 333 size_t sz2 = event->header.size - sample->aux_sample.size - sz1; in perf_inject__cut_auxtrace_sample() [all …]
|
| H A D | builtin-sched.c | 129 struct perf_sample *sample, struct machine *machine); 132 struct perf_sample *sample, struct machine *machine); 135 struct perf_sample *sample, struct machine *machine); 143 struct perf_sample *sample, 822 struct evsel *evsel, struct perf_sample *sample, in replay_wakeup_event() argument 825 const char *comm = evsel__strval(evsel, sample, "comm"); in replay_wakeup_event() 826 const u32 pid = evsel__intval(evsel, sample, "pid"); in replay_wakeup_event() 832 printf(" ... pid %d woke up %s/%d\n", sample->tid, comm, pid); in replay_wakeup_event() 835 waker = register_pid(sched, sample->tid, "<unknown>"); in replay_wakeup_event() 838 add_sched_event_wakeup(sched, waker, sample->time, wakee); in replay_wakeup_event() [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A 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 …]
|
| H A 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 …]
|
| H A D | test_ringbuf_n.c | 14 struct sample { struct 31 struct sample *sample; in test_ringbuf_n() argument 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()
|
| H A 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()
|
| /linux/tools/perf/scripts/python/ |
| H A 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 …]
|
| /linux/tools/perf/util/ |
| H A D | arm64-frame-pointer-unwind-support.c | 18 static bool get_leaf_frame_caller_enabled(struct perf_sample *sample) in get_leaf_frame_caller_enabled() 25 regs = perf_sample__user_regs(sample); in add_entry() 37 u64 get_leaf_frame_caller_aarch64(struct perf_sample *sample, struct thread *thread, int usr_idx) in get_leaf_frame_caller_aarch64() 43 if (!get_leaf_frame_caller_enabled(sample)) in get_leaf_frame_caller_aarch64() 51 regs = perf_sample__user_regs(sample); in get_leaf_frame_caller_aarch64() 55 regs->cache_regs[PERF_REG_ARM64_PC] = sample->callchain->ips[usr_idx+1]; in get_leaf_frame_caller_aarch64() 63 ret = unwind__get_entries(add_entry, &entries, thread, sample, 2, true); in get_leaf_frame_caller_aarch64() 17 get_leaf_frame_caller_enabled(struct perf_sample * sample) get_leaf_frame_caller_enabled() argument 31 get_leaf_frame_caller_aarch64(struct perf_sample * sample,struct thread * thread,int usr_idx) get_leaf_frame_caller_aarch64() argument
|
| H A 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_TI [all...] |
| H A 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 …]
|
| H A D | print_insn.c | 21 size_t sample__fprintf_insn_raw(struct perf_sample *sample, FILE *fp) in sample__fprintf_insn_raw() argument 25 for (int i = 0; i < sample->insn_len; i++) { in sample__fprintf_insn_raw() 26 printed += fprintf(fp, "%02x", (unsigned char)sample->insn[i]); in sample__fprintf_insn_raw() 27 if (sample->insn_len - i > 1) in sample__fprintf_insn_raw() 53 size_t sample__fprintf_insn_asm(struct perf_sample *sample, struct thread *thread, in sample__fprintf_insn_asm() argument 60 printed = fprintf_insn_asm(machine, thread, sample->cpumode, is64bit, in sample__fprintf_insn_asm() 61 (uint8_t *)sample->insn, sample->insn_len, in sample__fprintf_insn_asm() 62 sample->ip, NULL, 0, fp); in sample__fprintf_insn_asm() 64 return sample__fprintf_insn_raw(sample, fp); in sample__fprintf_insn_asm()
|
| H A D | session.c | 796 static void callchain__lbr_callstack_printf(struct perf_sample *sample) in callchain__lbr_callstack_printf() argument 798 struct ip_callchain *callchain = sample->callchain; in callchain__lbr_callstack_printf() 799 struct branch_stack *lbr_stack = sample->branch_stack; in callchain__lbr_callstack_printf() 800 struct branch_entry *entries = perf_sample__branch_entries(sample); in callchain__lbr_callstack_printf() 845 struct perf_sample *sample) in callchain__printf() argument 848 struct ip_callchain *callchain = sample->callchain; in callchain__printf() 851 callchain__lbr_callstack_printf(sample); in callchain__printf() 859 if (sample->deferred_callchain) in callchain__printf() 863 static void branch_stack__printf(struct perf_sample *sample, in branch_stack__printf() argument 866 struct branch_entry *entries = perf_sample__branch_entries(sample); in branch_stack__printf() [all …]
|
| H A D | event.c | 227 struct perf_sample *sample, in perf_event__process_comm() argument 230 return machine__process_comm_event(machine, event, sample); in perf_event__process_comm() 235 struct perf_sample *sample, in perf_event__process_namespaces() argument 238 return machine__process_namespaces_event(machine, event, sample); in perf_event__process_namespaces() 243 struct perf_sample *sample, in perf_event__process_cgroup() argument 246 return machine__process_cgroup_event(machine, event, sample); in perf_event__process_cgroup() 251 struct perf_sample *sample, in perf_event__process_lost() argument 254 return machine__process_lost_event(machine, event, sample); in perf_event__process_lost() 259 struct perf_sample *sample __maybe_unused, in perf_event__process_aux() 267 struct perf_sample *sample __maybe_unused, in perf_event__process_itrace_start() [all …]
|
| /linux/tools/testing/selftests/ftrace/test.d/event/ |
| H A D | event-mod.tc | 7 rmmod trace-events-sample ||: 8 if ! modprobe trace-events-sample ; then 20 grep -q sample-trace:foo_bar set_event 21 grep -q sample-trace:foo_bar_with_cond set_event 22 grep -q sample-trace:foo_bar_with_fn set_event 25 val=`cat events/sample-trace/enable` 49 val=`cat events/sample-trace/enable` 65 val=`cat events/sample-trace/enable` 80 val=`cat events/sample-trace/enable` 96 val=`cat events/sample-trace/enable` [all …]
|
| /linux/tools/perf/arch/x86/util/ |
| H A D | kvm-stat.c | 32 static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument 35 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key() 36 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key() 44 struct perf_sample *sample, struct event_key *key) in mmio_event_begin() argument 52 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin() 53 mmio_event_get_key(evsel, sample, key); in mmio_event_begin() 60 static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument 69 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_READ) { in mmio_event_end() 70 mmio_event_get_key(evsel, sample, key); in mmio_event_end() 95 struct perf_sample *sample, in ioport_event_get_key() argument [all …]
|
| /linux/net/netfilter/ |
| H A D | xt_rateest.c | 18 struct gnet_stats_rate_est64 sample = {0}; in xt_rateest_mt() local 22 gen_estimator_read(&info->est1->rate_est, &sample); in xt_rateest_mt() 25 bps1 = info->bps1 >= sample.bps ? info->bps1 - sample.bps : 0; in xt_rateest_mt() 26 pps1 = info->pps1 >= sample.pps ? info->pps1 - sample.pps : 0; in xt_rateest_mt() 28 bps1 = sample.bps; in xt_rateest_mt() 29 pps1 = sample.pps; in xt_rateest_mt() 36 gen_estimator_read(&info->est2->rate_est, &sample); in xt_rateest_mt() 39 bps2 = info->bps2 >= sample.bps ? info->bps2 - sample.bps : 0; in xt_rateest_mt() 40 pps2 = info->pps2 >= sample.pps ? info->pps2 - sample.pps : 0; in xt_rateest_mt() 42 bps2 = sample.bps; in xt_rateest_mt() [all …]
|
| /linux/tools/testing/selftests/rust/ |
| H A 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"
|
| /linux/tools/perf/util/scripting-engines/ |
| H A D | trace-event-python.c | 391 static PyObject *python_process_callchain(struct perf_sample *sample, in python_process_callchain() argument 402 if (!symbol_conf.use_callchain || !sample->callchain) in python_process_callchain() 407 sample, NULL, NULL, in python_process_callchain() 483 static PyObject *python_process_brstack(struct perf_sample *sample, in python_process_brstack() argument 486 struct branch_stack *br = sample->branch_stack; in python_process_brstack() 487 struct branch_entry *entries = perf_sample__branch_entries(sample); in python_process_brstack() 523 thread__find_map_fb(thread, sample->cpumode, in python_process_brstack() 529 thread__find_map_fb(thread, sample->cpumode, in python_process_brstack() 571 static PyObject *python_process_brstacksym(struct perf_sample *sample, in python_process_brstacksym() argument 574 struct branch_stack *br = sample->branch_stack; in python_process_brstacksym() [all …]
|
| /linux/samples/qmi/ |
| H A D | qmi_sample_client.c | 456 struct qmi_sample *sample; in qmi_sample_probe() local 460 sample = devm_kzalloc(&pdev->dev, sizeof(*sample), GFP_KERNEL); in qmi_sample_probe() 461 if (!sample) in qmi_sample_probe() 464 ret = qmi_handle_init(&sample->qmi, TEST_DATA_REQ_MAX_MSG_LEN_V01, in qmi_sample_probe() 471 ret = kernel_connect(sample->qmi.sock, (struct sockaddr_unsized *)sq, in qmi_sample_probe() 480 sample->de_dir = debugfs_create_dir(path, qmi_debug_dir); in qmi_sample_probe() 481 if (IS_ERR(sample->de_dir)) { in qmi_sample_probe() 482 ret = PTR_ERR(sample->de_dir); in qmi_sample_probe() 486 sample in qmi_sample_probe() 516 struct qmi_sample *sample = platform_get_drvdata(pdev); qmi_sample_remove() local [all...] |
| /linux/tools/perf/dlfilters/ |
| H A 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 …]
|
| /linux/samples/ |
| H A D | Kconfig | 5 You can build and test sample kernel code here. 10 bool "auxdisplay sample" 57 tristate "Build sample module for kernel access to Ftrace instances" 67 different kobject sample modules showing how to use kobjects, 101 different kfifo sample modules showing how to use the 114 tristate "Build qmi client sample -- loadable modules only" 120 Build an QMI client sample driver, which demonstrates how to 124 tristate "Build rpmsg client sample -- loadable modules only" 127 Build an rpmsg client sample driver, which demonstrates how 135 Build sample live patch demonstrations. [all …]
|