drivers/md/dm-vdo/thread-utils.c
22
void (*thread_function)(void *thread_data);
drivers/md/dm-vdo/thread-utils.c
23
void *thread_data;
drivers/md/dm-vdo/thread-utils.c
44
thread->thread_function(thread->thread_data);
drivers/md/dm-vdo/thread-utils.c
50
int vdo_create_thread(void (*thread_function)(void *), void *thread_data,
drivers/md/dm-vdo/thread-utils.c
66
thread->thread_data = thread_data;
drivers/md/dm-vdo/thread-utils.h
16
int __must_check vdo_create_thread(void (*thread_function)(void *), void *thread_data,
kernel/printk/printk_ringbuffer_kunit_test.c
256
struct prbtest_thread_data *thread_data;
kernel/printk/printk_ringbuffer_kunit_test.c
294
thread_data = kunit_kmalloc(test, sizeof(*thread_data), GFP_KERNEL);
kernel/printk/printk_ringbuffer_kunit_test.c
295
KUNIT_ASSERT_NOT_NULL(test, thread_data);
kernel/printk/printk_ringbuffer_kunit_test.c
296
thread_data->test_data = test_data;
kernel/printk/printk_ringbuffer_kunit_test.c
297
thread_data->num = cpu;
kernel/printk/printk_ringbuffer_kunit_test.c
299
thread = kthread_run_on_cpu(prbtest_writer, thread_data, cpu,
lib/test_rhashtable.c
587
static int thread_lookup_test(struct thread_data *tdata)
lib/test_rhashtable.c
620
struct thread_data *tdata = data;
lib/test_rhashtable.c
687
struct thread_data *tdata;
lib/test_rhashtable.c
747
tdata = vzalloc(array_size(tcount, sizeof(struct thread_data)));
tools/perf/bench/futex-wake-parallel.c
101
static void wakeup_threads(struct thread_data *td)
tools/perf/bench/futex-wake-parallel.c
186
static void print_run(struct thread_data *waking_worker, unsigned int run_num)
tools/perf/bench/futex-wake-parallel.c
228
static void do_run_stats(struct thread_data *waking_worker)
tools/perf/bench/futex-wake-parallel.c
251
struct thread_data *waking_worker;
tools/perf/bench/futex-wake-parallel.c
82
struct thread_data *waker = (struct thread_data *) arg;
tools/perf/bench/numa.c
1028
struct thread_data *td;
tools/perf/bench/numa.c
1102
struct thread_data *td = g->threads + t;
tools/perf/bench/numa.c
1208
struct thread_data *td = __tdata;
tools/perf/bench/numa.c
1221
u8 *thread_data;
tools/perf/bench/numa.c
1234
thread_data = setup_private_data(g->p.bytes_thread);
tools/perf/bench/numa.c
1248
process_nr, thread_nr, global_data, process_data, thread_data);
tools/perf/bench/numa.c
1283
val += do_work(thread_data, g->p.bytes_thread, 0, 1, l, val);
tools/perf/bench/numa.c
1391
free_data(thread_data, g->p.bytes_thread);
tools/perf/bench/numa.c
1406
struct thread_data *td;
tools/perf/bench/numa.c
1487
struct thread_data *td = g->threads + t;
tools/perf/bench/numa.c
1510
struct thread_data *td = g->threads + t;
tools/perf/bench/numa.c
153
struct thread_data *threads;
tools/perf/bench/numa.c
1773
struct thread_data *td;
tools/perf/bench/numa.c
591
struct thread_data *td;
tools/perf/bench/numa.c
739
struct thread_data *td;
tools/perf/bench/numa.c
989
struct thread_data *td;
tools/perf/bench/sched-pipe.c
173
static inline int read_pipe(struct thread_data *td)
tools/perf/bench/sched-pipe.c
190
struct thread_data *td = __tdata;
tools/perf/bench/sched-pipe.c
218
struct thread_data threads[2] = {};
tools/perf/bench/sched-pipe.c
219
struct thread_data *td;
tools/perf/builtin-record.c
1006
static void record__thread_data_init_pipes(struct record_thread *thread_data)
tools/perf/builtin-record.c
1008
thread_data->pipes.msg[0] = -1;
tools/perf/builtin-record.c
1009
thread_data->pipes.msg[1] = -1;
tools/perf/builtin-record.c
1010
thread_data->pipes.ack[0] = -1;
tools/perf/builtin-record.c
1011
thread_data->pipes.ack[1] = -1;
tools/perf/builtin-record.c
1014
static int record__thread_data_open_pipes(struct record_thread *thread_data)
tools/perf/builtin-record.c
1016
if (pipe(thread_data->pipes.msg))
tools/perf/builtin-record.c
1019
if (pipe(thread_data->pipes.ack)) {
tools/perf/builtin-record.c
1020
close(thread_data->pipes.msg[0]);
tools/perf/builtin-record.c
1021
thread_data->pipes.msg[0] = -1;
tools/perf/builtin-record.c
1022
close(thread_data->pipes.msg[1]);
tools/perf/builtin-record.c
1023
thread_data->pipes.msg[1] = -1;
tools/perf/builtin-record.c
1027
pr_debug2("thread_data[%p]: msg=[%d,%d], ack=[%d,%d]\n", thread_data,
tools/perf/builtin-record.c
1028
thread_data->pipes.msg[0], thread_data->pipes.msg[1],
tools/perf/builtin-record.c
1029
thread_data->pipes.ack[0], thread_data->pipes.ack[1]);
tools/perf/builtin-record.c
1034
static void record__thread_data_close_pipes(struct record_thread *thread_data)
tools/perf/builtin-record.c
1036
if (thread_data->pipes.msg[0] != -1) {
tools/perf/builtin-record.c
1037
close(thread_data->pipes.msg[0]);
tools/perf/builtin-record.c
1038
thread_data->pipes.msg[0] = -1;
tools/perf/builtin-record.c
1040
if (thread_data->pipes.msg[1] != -1) {
tools/perf/builtin-record.c
1041
close(thread_data->pipes.msg[1]);
tools/perf/builtin-record.c
1042
thread_data->pipes.msg[1] = -1;
tools/perf/builtin-record.c
1044
if (thread_data->pipes.ack[0] != -1) {
tools/perf/builtin-record.c
1045
close(thread_data->pipes.ack[0]);
tools/perf/builtin-record.c
1046
thread_data->pipes.ack[0] = -1;
tools/perf/builtin-record.c
1048
if (thread_data->pipes.ack[1] != -1) {
tools/perf/builtin-record.c
1049
close(thread_data->pipes.ack[1]);
tools/perf/builtin-record.c
1050
thread_data->pipes.ack[1] = -1;
tools/perf/builtin-record.c
1059
static int record__thread_data_init_maps(struct record_thread *thread_data, struct evlist *evlist)
tools/perf/builtin-record.c
1068
thread_data->nr_mmaps = nr_mmaps;
tools/perf/builtin-record.c
1070
thread_data->nr_mmaps = bitmap_weight(thread_data->mask->maps.bits,
tools/perf/builtin-record.c
1071
thread_data->mask->maps.nbits);
tools/perf/builtin-record.c
1073
thread_data->maps = zalloc(thread_data->nr_mmaps * sizeof(struct mmap *));
tools/perf/builtin-record.c
1074
if (!thread_data->maps)
tools/perf/builtin-record.c
1078
thread_data->overwrite_maps = zalloc(thread_data->nr_mmaps * sizeof(struct mmap *));
tools/perf/builtin-record.c
1079
if (!thread_data->overwrite_maps) {
tools/perf/builtin-record.c
1080
zfree(&thread_data->maps);
tools/perf/builtin-record.c
1084
pr_debug2("thread_data[%p]: nr_mmaps=%d, maps=%p, ow_maps=%p\n", thread_data,
tools/perf/builtin-record.c
1085
thread_data->nr_mmaps, thread_data->maps, thread_data->overwrite_maps);
tools/perf/builtin-record.c
1087
for (m = 0, tm = 0; m < nr_mmaps && tm < thread_data->nr_mmaps; m++) {
tools/perf/builtin-record.c
1089
test_bit(perf_cpu_map__cpu(cpus, m).cpu, thread_data->mask->maps.bits)) {
tools/perf/builtin-record.c
1090
if (thread_data->maps) {
tools/perf/builtin-record.c
1091
thread_data->maps[tm] = &mmap[m];
tools/perf/builtin-record.c
1093
thread_data, perf_cpu_map__cpu(cpus, m).cpu, tm, m);
tools/perf/builtin-record.c
1095
if (thread_data->overwrite_maps) {
tools/perf/builtin-record.c
1096
thread_data->overwrite_maps[tm] = &overwrite_mmap[m];
tools/perf/builtin-record.c
1098
thread_data, perf_cpu_map__cpu(cpus, m).cpu, tm, m);
tools/perf/builtin-record.c
1107
static int record__thread_data_init_pollfd(struct record_thread *thread_data, struct evlist *evlist)
tools/perf/builtin-record.c
1112
fdarray__init(&thread_data->pollfd, 64);
tools/perf/builtin-record.c
1114
for (tm = 0; tm < thread_data->nr_mmaps; tm++) {
tools/perf/builtin-record.c
1115
map = thread_data->maps ? thread_data->maps[tm] : NULL;
tools/perf/builtin-record.c
1116
overwrite_map = thread_data->overwrite_maps ?
tools/perf/builtin-record.c
1117
thread_data->overwrite_maps[tm] : NULL;
tools/perf/builtin-record.c
1123
pos = fdarray__dup_entry_from(&thread_data->pollfd, f,
tools/perf/builtin-record.c
1128
thread_data, pos, evlist->core.pollfd.entries[f].fd);
tools/perf/builtin-record.c
1139
struct record_thread *thread_data = rec->thread_data;
tools/perf/builtin-record.c
1141
if (thread_data == NULL)
tools/perf/builtin-record.c
1145
record__thread_data_close_pipes(&thread_data[t]);
tools/perf/builtin-record.c
1146
zfree(&thread_data[t].maps);
tools/perf/builtin-record.c
1147
zfree(&thread_data[t].overwrite_maps);
tools/perf/builtin-record.c
1148
fdarray__exit(&thread_data[t].pollfd);
tools/perf/builtin-record.c
1151
zfree(&rec->thread_data);
tools/perf/builtin-record.c
1170
struct record_thread *thread_data)
tools/perf/builtin-record.c
1173
struct pollfd *t_entries = thread_data->pollfd.entries;
tools/perf/builtin-record.c
1194
struct record_thread *thread_data)
tools/perf/builtin-record.c
1202
ret = fdarray__dup_entry_from(&thread_data->pollfd, i, fda);
tools/perf/builtin-record.c
1208
thread_data, ret, fda->entries[i].fd);
tools/perf/builtin-record.c
1221
struct record_thread *thread_data;
tools/perf/builtin-record.c
1223
rec->thread_data = zalloc(rec->nr_threads * sizeof(*(rec->thread_data)));
tools/perf/builtin-record.c
1224
if (!rec->thread_data) {
tools/perf/builtin-record.c
1228
thread_data = rec->thread_data;
tools/perf/builtin-record.c
1231
record__thread_data_init_pipes(&thread_data[t]);
tools/perf/builtin-record.c
1234
thread_data[t].rec = rec;
tools/perf/builtin-record.c
1235
thread_data[t].mask = &rec->thread_masks[t];
tools/perf/builtin-record.c
1236
ret = record__thread_data_init_maps(&thread_data[t], evlist);
tools/perf/builtin-record.c
1241
ret = record__thread_data_init_pollfd(&thread_data[t], evlist);
tools/perf/builtin-record.c
1247
thread_data[t].tid = -1;
tools/perf/builtin-record.c
1248
ret = record__thread_data_open_pipes(&thread_data[t]);
tools/perf/builtin-record.c
1253
ret = fdarray__add(&thread_data[t].pollfd, thread_data[t].pipes.msg[0],
tools/perf/builtin-record.c
1259
thread_data[t].ctlfd_pos = ret;
tools/perf/builtin-record.c
1261
thread_data, thread_data[t].ctlfd_pos,
tools/perf/builtin-record.c
1262
thread_data[t].pipes.msg[0]);
tools/perf/builtin-record.c
1264
thread_data[t].tid = gettid();
tools/perf/builtin-record.c
1266
ret = record__dup_non_perf_events(rec, evlist, &thread_data[t]);
tools/perf/builtin-record.c
1270
thread_data[t].ctlfd_pos = -1; /* Not used */
tools/perf/builtin-record.c
186
struct record_thread *thread_data;
tools/perf/builtin-record.c
2306
static int record__terminate_thread(struct record_thread *thread_data)
tools/perf/builtin-record.c
2310
pid_t tid = thread_data->tid;
tools/perf/builtin-record.c
2312
close(thread_data->pipes.msg[1]);
tools/perf/builtin-record.c
2313
thread_data->pipes.msg[1] = -1;
tools/perf/builtin-record.c
2314
err = read(thread_data->pipes.ack[0], &ack, sizeof(ack));
tools/perf/builtin-record.c
2327
struct record_thread *thread_data = rec->thread_data;
tools/perf/builtin-record.c
2332
thread = &thread_data[0];
tools/perf/builtin-record.c
2351
MMAP_CPU_MASK_BYTES(&(thread_data[t].mask->affinity)),
tools/perf/builtin-record.c
2352
(cpu_set_t *)(thread_data[t].mask->affinity.bits));
tools/perf/builtin-record.c
2354
if (pthread_create(&handle, &attrs, record__thread, &thread_data[t])) {
tools/perf/builtin-record.c
2356
record__terminate_thread(&thread_data[t]);
tools/perf/builtin-record.c
2362
err = read(thread_data[t].pipes.ack[0], &msg, sizeof(msg));
tools/perf/builtin-record.c
2364
pr_debug2("threads[%d]: sent %s\n", rec->thread_data[t].tid,
tools/perf/builtin-record.c
2368
thread->tid, rec->thread_data[t].tid);
tools/perf/builtin-record.c
2390
struct record_thread *thread_data = rec->thread_data;
tools/perf/builtin-record.c
2393
record__terminate_thread(&thread_data[t]);
tools/perf/builtin-record.c
2396
rec->samples += thread_data[t].samples;
tools/perf/builtin-record.c
2399
rec->session->bytes_transferred += thread_data[t].bytes_transferred;
tools/perf/builtin-record.c
2400
rec->session->bytes_compressed += thread_data[t].bytes_compressed;
tools/perf/builtin-record.c
2401
pr_debug("threads[%d]: samples=%lld, wakes=%ld, ", thread_data[t].tid,
tools/perf/builtin-record.c
2402
thread_data[t].samples, thread_data[t].waking);
tools/perf/builtin-record.c
2403
if (thread_data[t].bytes_transferred && thread_data[t].bytes_compressed)
tools/perf/builtin-record.c
2405
thread_data[t].bytes_transferred, thread_data[t].bytes_compressed);
tools/perf/builtin-record.c
2407
pr_debug("written=%" PRIu64 "\n", thread_data[t].bytes_written);
tools/perf/builtin-record.c
2417
struct record_thread *thread_data = rec->thread_data;
tools/perf/builtin-record.c
2420
waking += thread_data[t].waking;
tools/perf/tests/mmap-thread-lookup.c
102
struct thread_data *td0 = &threads[0];
tools/perf/tests/mmap-thread-lookup.c
119
struct thread_data *td0 = &threads[0];
tools/perf/tests/mmap-thread-lookup.c
189
struct thread_data *td = &threads[i];
tools/perf/tests/mmap-thread-lookup.c
33
static struct thread_data threads[THREADS];
tools/perf/tests/mmap-thread-lookup.c
35
static int thread_init(struct thread_data *td)
tools/perf/tests/mmap-thread-lookup.c
57
struct thread_data *td = arg;
tools/perf/tests/mmap-thread-lookup.c
82
struct thread_data *td = &threads[i];
tools/power/x86/turbostat/turbostat.c
2372
struct thread_data *threads;
tools/power/x86/turbostat/turbostat.c
2444
#define PER_THREAD_PARAMS struct thread_data *t, struct core_data *c, struct pkg_data *p
tools/power/x86/turbostat/turbostat.c
2446
int for_all_cpus(int (func) (struct thread_data *, struct core_data *, struct pkg_data *),
tools/power/x86/turbostat/turbostat.c
2447
struct thread_data *thread_base, struct core_data *core_base, struct pkg_data *pkg_base)
tools/power/x86/turbostat/turbostat.c
2454
struct thread_data *t;
tools/power/x86/turbostat/turbostat.c
2486
int is_cpu_first_thread_in_core(struct thread_data *t, struct core_data *c)
tools/power/x86/turbostat/turbostat.c
2491
int is_cpu_first_core_in_package(struct thread_data *t, struct pkg_data *p)
tools/power/x86/turbostat/turbostat.c
2496
int is_cpu_first_thread_in_package(struct thread_data *t, struct core_data *c, struct pkg_data *p)
tools/power/x86/turbostat/turbostat.c
3912
int delta_thread(struct thread_data *new, struct thread_data *old, struct core_data *core_delta)
tools/power/x86/turbostat/turbostat.c
4027
int delta_cpu(struct thread_data *t, struct core_data *c, struct pkg_data *p, struct thread_data *t2, struct core_data *c2, struct pkg_data *p2)
tools/power/x86/turbostat/turbostat.c
4553
void get_apic_id(struct thread_data *t)
tools/power/x86/turbostat/turbostat.c
5035
int get_smi_aperf_mperf(unsigned int cpu, struct thread_data *t)
tools/power/x86/turbostat/turbostat.c
6222
int for_all_cpus_2(int (func) (struct thread_data *, struct core_data *,
tools/power/x86/turbostat/turbostat.c
6223
struct pkg_data *, struct thread_data *, struct core_data *,
tools/power/x86/turbostat/turbostat.c
6224
struct pkg_data *), struct thread_data *thread_base,
tools/power/x86/turbostat/turbostat.c
6226
struct thread_data *thread_base2, struct core_data *core_base2, struct pkg_data *pkg_base2)
tools/power/x86/turbostat/turbostat.c
6233
struct thread_data *t, *t2;
tools/power/x86/turbostat/turbostat.c
9684
counters->threads = calloc(1, sizeof(struct thread_data));
tools/power/x86/turbostat/turbostat.c
9707
counters->threads = calloc(num_threads, sizeof(struct thread_data));
tools/power/x86/turbostat/turbostat.c
9738
void init_counter(struct thread_data *thread_base, struct core_data *core_base, struct pkg_data *pkg_base, int cpu_id)
tools/power/x86/turbostat/turbostat.c
9743
struct thread_data *t;
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c
72
int thread_data[MAX_THREADS];
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c
79
pthread_join(thread_id[i], (void *)&thread_data[i]);
tools/testing/selftests/arm64/mte/check_gcr_el1_cswitch.c
82
if (thread_data[i] == KSFT_FAIL)
tools/testing/selftests/landlock/audit_test.c
169
const struct thread_data *data = (struct thread_data *)arg;
tools/testing/selftests/landlock/audit_test.c
230
struct thread_data child_data;
tools/testing/selftests/rseq/param_test.c
479
struct spinlock_thread_test_data *thread_data = arg;
tools/testing/selftests/rseq/param_test.c
480
struct spinlock_test_data *data = thread_data->data;
tools/testing/selftests/rseq/param_test.c
483
if (!opt_disable_rseq && thread_data->reg &&
tools/testing/selftests/rseq/param_test.c
486
reps = thread_data->reps;
tools/testing/selftests/rseq/param_test.c
499
if (!opt_disable_rseq && thread_data->reg &&
tools/testing/selftests/rseq/param_test.c
518
struct spinlock_thread_test_data thread_data[num_threads];
tools/testing/selftests/rseq/param_test.c
522
thread_data[i].reps = opt_reps;
tools/testing/selftests/rseq/param_test.c
524
thread_data[i].reg = 1;
tools/testing/selftests/rseq/param_test.c
526
thread_data[i].reg = 0;
tools/testing/selftests/rseq/param_test.c
527
thread_data[i].data = &data;
tools/testing/selftests/rseq/param_test.c
530
&thread_data[i]);
tools/testing/selftests/rseq/param_test.c
556
struct inc_thread_test_data *thread_data = arg;
tools/testing/selftests/rseq/param_test.c
557
struct inc_test_data *data = thread_data->data;
tools/testing/selftests/rseq/param_test.c
560
if (!opt_disable_rseq && thread_data->reg &&
tools/testing/selftests/rseq/param_test.c
563
reps = thread_data->reps;
tools/testing/selftests/rseq/param_test.c
582
if (!opt_disable_rseq && thread_data->reg &&
tools/testing/selftests/rseq/param_test.c
595
struct inc_thread_test_data thread_data[num_threads];
tools/testing/selftests/rseq/param_test.c
599
thread_data[i].reps = opt_reps;
tools/testing/selftests/rseq/param_test.c
601
thread_data[i].reg = 1;
tools/testing/selftests/rseq/param_test.c
603
thread_data[i].reg = 0;
tools/testing/selftests/rseq/param_test.c
604
thread_data[i].data = &data;
tools/testing/selftests/rseq/param_test.c
607
&thread_data[i]);