| /tools/testing/selftests/bpf/progs/ |
| A D | task_kfunc_failure.c | 37 v = insert_lookup_task(task); in BPF_PROG() 74 acquired = bpf_task_acquire(task); in BPF_PROG() 89 if (!task) { in BPF_PROG() 94 acquired = bpf_task_acquire(task); in BPF_PROG() 138 v = insert_lookup_task(task); in BPF_PROG() 170 v = insert_lookup_task(task); in BPF_PROG() 175 bpf_task_release(v->task); in BPF_PROG() 205 local.task = NULL; in BPF_PROG() 231 bpf_task_release(task); in BPF_PROG() 299 bpf_probe_read_kernel(task->comm, 16, task->comm); in BPF_PROG() [all …]
|
| A D | rcu_read_lock.c | 33 struct task_struct *task; in get_cgroup_id() local 36 task = bpf_get_current_task_btf(); in get_cgroup_id() 37 if (task->pid != target_pid) in get_cgroup_id() 42 cgroups = task->cgroups; in get_cgroup_id() 59 if (task->pid != target_pid) in task_succ() 64 real_parent = task->real_parent; in task_succ() 87 real_parent = task->real_parent; in no_lock() 102 real_parent = task->real_parent; in two_regions() 118 real_parent = task->real_parent; in non_sleepable_1() 177 struct task_struct *task; in miss_lock() local [all …]
|
| A D | bpf_iter_tasks.c | 24 struct task_struct *task = ctx->task; in dump_task() local 27 if (task == (void *)0) { in dump_task() 32 if (task->pid != (pid_t)tid) in dump_task() 40 BPF_SEQ_PRINTF(seq, "%8d %8d\n", task->tgid, task->pid); in dump_task() 53 struct task_struct *task = ctx->task; in dump_task_sleepable() local 63 if (task == (void *)0) { in dump_task_sleepable() 70 ret = bpf_copy_from_user_task(&user_data, sizeof(uint32_t), ptr, task, 0); in dump_task_sleepable() 81 regs = (struct pt_regs *)bpf_task_pt_regs(task); in dump_task_sleepable() 107 ptr, task, BPF_F_PAD_ZEROS); in dump_task_sleepable() 147 ret = bpf_copy_from_user_task_str(big_str1, 5000, user_ptr, task, 0); in dump_task_sleepable() [all …]
|
| A D | task_kfunc_success.c | 57 acquired = bpf_task_acquire(task); in test_acquire_release() 116 return test_acquire_release(task); in BPF_PROG() 136 status = tasks_kfunc_map_insert(task); in BPF_PROG() 154 status = tasks_kfunc_map_insert(task); in BPF_PROG() 160 v = tasks_kfunc_map_value_lookup(task); in BPF_PROG() 166 kptr = bpf_kptr_xchg(&v->task, NULL); in BPF_PROG() 237 status = tasks_kfunc_map_insert(task); in BPF_PROG() 250 kptr = v->task; in BPF_PROG() 304 lookup_compare_pid(task); in BPF_PROG() 337 bpf_strncmp(task->comm, 12, "foo"); in BPF_PROG() [all …]
|
| A D | verifier_global_ptr_args.c | 17 if (!task) in subprog_trusted_task_nullable() 19 return task->pid + task->tgid; in subprog_trusted_task_nullable() 61 return task->pid + task->tgid; in subprog_trusted_task_nonnull() 112 if (!task) in subprog_nullable_task_flavor() 149 bpf_task_release(task); /* should be rejected */ in subprog_trusted_destroy() 159 return subprog_trusted_destroy(task); in BPF_PROG() 166 owned = bpf_task_acquire(task); in subprog_trusted_acq_rel() 179 return subprog_trusted_acq_rel(task); in BPF_PROG() 184 return task->pid; in subprog_untrusted_bad_tags() 212 return task->pid; in subprog_untrusted() [all …]
|
| A D | bpf_iter_task_file.c | 17 struct task_struct *task = ctx->task; in dump_task_file() local 21 if (task == (void *)0 || file == (void *)0) in dump_task_file() 29 if (tgid == task->tgid && task->tgid != task->pid) in dump_task_file() 32 if (last_tgid != task->tgid) { in dump_task_file() 33 last_tgid = task->tgid; in dump_task_file() 37 BPF_SEQ_PRINTF(seq, "%8d %8d %8d %lx\n", task->tgid, task->pid, fd, in dump_task_file()
|
| A D | uptr_failure.c | 21 struct task_struct *task; in uptr_write() local 24 task = bpf_get_current_task_btf(); in uptr_write() 25 v = bpf_task_storage_get(&datamap, task, 0, in uptr_write() 38 struct task_struct *task; in uptr_write_nested() local 41 task = bpf_get_current_task_btf(); in uptr_write_nested() 42 v = bpf_task_storage_get(&datamap, task, 0, in uptr_write_nested() 55 struct task_struct *task; in uptr_no_null_check() local 58 task = bpf_get_current_task_btf(); in uptr_no_null_check() 59 v = bpf_task_storage_get(&datamap, task, 0, in uptr_no_null_check() 73 struct task_struct *task; in uptr_kptr_xchg() local [all …]
|
| A D | cgrp_ls_sleepable.c | 59 struct task_struct *task; in cgrp1_no_rcu_lock() local 62 task = bpf_get_current_task_btf(); in cgrp1_no_rcu_lock() 63 if (task->pid != target_pid) in cgrp1_no_rcu_lock() 79 struct task_struct *task; in no_rcu_lock() local 81 task = bpf_get_current_task_btf(); in no_rcu_lock() 82 if (task->pid != target_pid) in no_rcu_lock() 86 __no_rcu_lock(task->cgroups->dfl_cgrp); in no_rcu_lock() 93 struct task_struct *task; in yes_rcu_lock() local 97 task = bpf_get_current_task_btf(); in yes_rcu_lock() 98 if (task->pid != target_pid) in yes_rcu_lock() [all …]
|
| A D | task_ls_recursion.c | 33 struct task_struct *task = bpf_get_current_task_btf(); in BPF_PROG() local 36 if (!test_pid || task->pid != test_pid) in BPF_PROG() 39 ptr = bpf_task_storage_get(&map_a, task, 0, in BPF_PROG() 51 err = bpf_task_storage_delete(&map_a, task); in BPF_PROG() 62 ptr = bpf_task_storage_get(&map_b, task, 0, in BPF_PROG() 73 struct task_struct *task; in BPF_PROG() local 76 task = bpf_get_current_task_btf(); in BPF_PROG() 77 if (!test_pid || task->pid != test_pid) in BPF_PROG() 80 ptr = bpf_task_storage_get(&map_a, task, 0, in BPF_PROG() 85 ptr = bpf_task_storage_get(&map_b, task, 0, in BPF_PROG()
|
| A D | bpf_iter_task_stack.c | 16 struct task_struct *task = ctx->task; in dump_task_stack() local 19 if (task == (void *)0) in dump_task_stack() 22 retlen = bpf_get_task_stack(task, entries, in dump_task_stack() 27 BPF_SEQ_PRINTF(seq, "pid: %8u num_entries: %8u\n", task->pid, in dump_task_stack() 44 struct task_struct *task = ctx->task; in get_task_user_stacks() local 48 if (task == (void *)0) in get_task_user_stacks() 51 res = bpf_get_task_stack(task, entries, in get_task_user_stacks()
|
| A D | find_vma.c | 23 static long check_vma(struct task_struct *task, struct vm_area_struct *vma, in check_vma() argument 40 struct task_struct *task = bpf_get_current_task_btf(); in handle_getpid() local 43 if (task->pid != target_pid) in handle_getpid() 46 find_addr_ret = bpf_find_vma(task, addr, check_vma, &data, 0); in handle_getpid() 49 find_zero_ret = bpf_find_vma(task, 0, check_vma, &data, 0); in handle_getpid() 56 struct task_struct *task = bpf_get_current_task_btf(); in handle_pe() local 59 if (task->pid != target_pid) in handle_pe() 62 find_addr_ret = bpf_find_vma(task, addr, check_vma, &data, 0); in handle_pe() 67 find_zero_ret = bpf_find_vma(task, 0, check_vma, &data, 0); in handle_pe()
|
| A D | test_core_reloc_kernel.c | 62 if (CORE_READ(&pid, &task->pid) || in test_core_kernel() 63 CORE_READ(&tgid, &task->tgid)) in test_core_kernel() 70 out->valid[1] = BPF_CORE_READ(task, in test_core_kernel() 72 out->valid[2] = BPF_CORE_READ(task, in test_core_kernel() 75 out->valid[3] = BPF_CORE_READ(task, in test_core_kernel() 78 out->valid[4] = BPF_CORE_READ(task, in test_core_kernel() 81 out->valid[5] = BPF_CORE_READ(task, in test_core_kernel() 85 out->valid[6] = BPF_CORE_READ(task, in test_core_kernel() 89 out->valid[7] = BPF_CORE_READ(task, in test_core_kernel() 93 out->valid[8] = BPF_CORE_READ(task, in test_core_kernel() [all …]
|
| A D | task_local_storage.c | 27 struct task_struct *task; in BPF_PROG() local 30 task = bpf_get_current_task_btf(); in BPF_PROG() 31 if (task->pid != target_pid) in BPF_PROG() 34 ptr = bpf_task_storage_get(&enter_id, task, 0, in BPF_PROG() 48 struct task_struct *task; in BPF_PROG() local 51 task = bpf_get_current_task_btf(); in BPF_PROG() 52 if (task->pid != target_pid) in BPF_PROG() 55 ptr = bpf_task_storage_get(&enter_id, task, 0, in BPF_PROG()
|
| A D | cgrp_ls_tp_btf.c | 33 struct cgroup *bpf_task_get_cgroup1(struct task_struct *task, int hierarchy_id) __ksym; 69 struct task_struct *task; in BPF_PROG() local 72 task = bpf_get_current_task_btf(); in BPF_PROG() 73 if (task->pid != target_pid) in BPF_PROG() 77 cgrp = bpf_task_get_cgroup1(task, target_hid); in BPF_PROG() 86 __on_enter(regs, id, task->cgroups->dfl_cgrp); in BPF_PROG() 107 struct task_struct *task; in BPF_PROG() local 110 task = bpf_get_current_task_btf(); in BPF_PROG() 111 if (task->pid != target_pid) in BPF_PROG() 115 cgrp = bpf_task_get_cgroup1(task, target_hid); in BPF_PROG() [all …]
|
| A D | percpu_alloc_cgrp_local_storage.c | 25 struct task_struct *task; in BPF_PROG() local 29 task = bpf_get_current_task_btf(); in BPF_PROG() 30 e = bpf_cgrp_storage_get(&cgrp, task->cgroups->dfl_cgrp, 0, in BPF_PROG() 50 struct task_struct *task; in BPF_PROG() local 55 task = bpf_get_current_task_btf(); in BPF_PROG() 56 e = bpf_cgrp_storage_get(&cgrp, task->cgroups->dfl_cgrp, 0, 0); in BPF_PROG() 79 struct task_struct *task; in BPF_PROG() local 88 task = bpf_get_current_task_btf(); in BPF_PROG() 89 e = bpf_cgrp_storage_get(&cgrp, task->cgroups->dfl_cgrp, 0, 0); in BPF_PROG()
|
| A D | cpumask_failure.c | 36 int BPF_PROG(test_alloc_no_release, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 49 int BPF_PROG(test_alloc_double_release, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 64 int BPF_PROG(test_acquire_wrong_cpumask, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 69 cpumask = bpf_cpumask_acquire((struct bpf_cpumask *)task->cpus_ptr); in BPF_PROG() 77 int BPF_PROG(test_mutate_cpumask, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 80 bpf_cpumask_set_cpu(0, (struct bpf_cpumask *)task->cpus_ptr); in BPF_PROG() 87 int BPF_PROG(test_insert_remove_no_release, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 111 int BPF_PROG(test_cpumask_null, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 121 int BPF_PROG(test_global_mask_out_of_rcu, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 208 int BPF_PROG(test_invalid_nested_array, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument [all …]
|
| A D | bpf_iter_vma_offset.c | 20 struct task_struct *task = ctx->task; in get_vma_offset() local 22 if (task == NULL || vma == NULL) in get_vma_offset() 25 if (last_tgid != task->tgid) in get_vma_offset() 27 last_tgid = task->tgid; in get_vma_offset() 29 if (task->tgid != pid) in get_vma_offset()
|
| A D | test_task_under_cgroup.c | 11 long bpf_task_under_cgroup(struct task_struct *task, struct cgroup *ancestor) __ksym; 21 int BPF_PROG(tp_btf_run, struct task_struct *task, u64 clone_flags) in BPF_PROG() argument 29 acquired = bpf_task_acquire(task); in BPF_PROG() 55 struct task_struct *task; in BPF_PROG() local 58 task = bpf_get_current_task_btf(); in BPF_PROG() 59 if (local_pid != task->pid) in BPF_PROG() 69 if (!bpf_task_under_cgroup(task, cgrp)) in BPF_PROG()
|
| A D | iters_css_task.c | 27 struct task_struct *task; in BPF_PROG() local 41 bpf_for_each(css_task, task, css, CSS_TASK_ITER_PROCS) in BPF_PROG() 42 if (task->pid == target_pid) in BPF_PROG() 61 struct task_struct *task; in cgroup_id_printer() local 77 bpf_for_each(css_task, task, css, CSS_TASK_ITER_PROCS) { in cgroup_id_printer() 78 if (task->pid == target_pid) in cgroup_id_printer() 91 struct task_struct *task; in BPF_PROG() local 97 bpf_for_each(css_task, task, css, CSS_TASK_ITER_PROCS) { in BPF_PROG()
|
| A D | find_vma_fail2.c | 12 static long write_task(struct task_struct *task, struct vm_area_struct *vma, in write_task() argument 16 task->mm = NULL; in write_task() 24 struct task_struct *task = bpf_get_current_task_btf(); in handle_getpid() local 27 bpf_find_vma(task, 0, write_task, &data, 0); in handle_getpid()
|
| /tools/perf/util/bpf_skel/ |
| A D | kwork_top.bpf.c | 110 .pid = task->pid, in update_task_info() 116 .tgid = task->tgid, in update_task_info() 154 .pid = task->pid, in on_sched_out() 155 .task_p = (__u64)task, in on_sched_out() 212 if (!task) in on_irq_handler_entry() 218 .task_p = (__u64)task, in on_irq_handler_entry() 248 if (!task) in on_irq_handler_exit() 254 .task_p = (__u64)task, in on_irq_handler_exit() 284 if (!task) in on_softirq_entry() 290 .task_p = (__u64)task, in on_softirq_entry() [all …]
|
| /tools/perf/tests/shell/ |
| A D | pipe_test.sh | 41 task="perf" 42 if ! perf record -e task-clock:u -o - ${prog} | perf report -i - --task | grep -q ${task} 49 if ! perf record -g -e task-clock:u -o - ${prog} | perf report -i - --task | grep -q ${task} 56 perf record -g -e task-clock:u -o - ${prog} > ${data} 57 if ! perf report -i ${data} --task | grep -q ${task} 73 …if ! perf record -e task-clock:u -o - ${prog} | perf inject ${inject_opt}| perf report -i - | grep… 80 …if ! perf record -g -e task-clock:u -o - ${prog} | perf inject ${inject_opt} | perf report -i - | … 87 perf record -e task-clock:u -o - ${prog} | perf inject ${inject_opt} -o ${data} 94 perf record -e task-clock:u -o ${data} ${prog} 101 perf record -e task-clock:u -o - ${prog} > ${data} [all …]
|
| A D | record_bpf_filter.sh | 25 if ! perf record -e task-clock --filter 'period > 1' \ 44 if ! perf record -e task-clock -c 10000 --filter 'ip < 0xffffffff00000000' \ 70 if ! perf record -e task-clock --filter 'cpu > 0' \ 78 if ! perf record --sample-cpu -e task-clock --filter 'cpu > 0' \ 92 if ! perf record -e task-clock --filter 'period > 1000, ip > 0' \ 100 if ! perf record -e task-clock --filter 'period > 1000 , cpu > 0 || ip > 0' \ 108 if ! perf record -e task-clock --filter 'period > 0 || code_pgsz > 4096' \ 122 if ! perf record -e task-clock --filter 'period > 100000' \ 131 if ! perf script -i "${perfdata}" -F period,event | grep task-clock | \ 153 if ! perf record -e task-clock --filter 'cgroup == /' \ [all …]
|
| A D | test_task_analyzer.sh | 5 tmpdir=$(mktemp -d /tmp/perf-script-task-analyzer-XXXXX) 75 perf script report task-analyzer > "$out" 82 perf script report task-analyzer --ns --rename-comms-by-tids 0:random > "$out" 97 perf script report task-analyzer --extended-times --time-limit :99999 \ 105 perf script report task-analyzer --summary > "$out" 112 perf script report task-analyzer --summary-extended > "$out" 119 perf script report task-analyzer --summary-only > "$out" 126 perf script report task-analyzer --extended-times --summary --ns > "$out" 133 perf script report task-analyzer --csv csv > /dev/null 139 perf script report task-analyzer --csv csv --extended-times > /dev/null [all …]
|
| /tools/perf/scripts/python/ |
| A D | task-analyzer.py | 256 def feed(self, task): argument 659 if task.pid == task.tid: 677 line_out = fmt.format(c_row_set, task.time_in(), task.time_out(), task.cpu, 678 task.pid, c_tid_set, task.tid, c_tid_reset, c_row_set, task.comm, 682 line_out = fmt.format(c_row_set, task.time_in(), task.time_out(), task.cpu, 683 task.pid, c_tid_set, task.tid, c_tid_reset, c_row_set, task.comm, 701 tid = task.tid 709 cpu = task.cpu 740 task.update_pid(pid) 747 _record_by_tid(task) [all …]
|