Home
last modified time | relevance | path

Searched refs:th (Results 1 – 25 of 45) sorted by relevance

12

/tools/lib/thermal/
Dsampling.c17 struct thermal_handler *th = thp->th; in handle_thermal_sample() local
26 return th->ops->sampling.tz_temp( in handle_thermal_sample()
34 thermal_error_t thermal_sampling_handle(struct thermal_handler *th, void *arg) in thermal_sampling_handle() argument
36 struct thermal_handler_param thp = { .th = th, .arg = arg }; in thermal_sampling_handle()
38 if (!th) in thermal_sampling_handle()
41 if (nl_cb_set(th->cb_sampling, NL_CB_VALID, NL_CB_CUSTOM, in thermal_sampling_handle()
45 return nl_recvmsgs(th->sk_sampling, th->cb_sampling); in thermal_sampling_handle()
48 int thermal_sampling_fd(struct thermal_handler *th) in thermal_sampling_fd() argument
50 if (!th) in thermal_sampling_fd()
53 return nl_socket_get_fd(th->sk_sampling); in thermal_sampling_fd()
[all …]
Dthermal.c9 int for_each_thermal_threshold(struct thermal_threshold *th, cb_th_t cb, void *arg) in for_each_thermal_threshold() argument
13 if (!th) in for_each_thermal_threshold()
16 for (i = 0; th[i].temperature != INT_MAX; i++) in for_each_thermal_threshold()
17 ret |= cb(&th[i], arg); in for_each_thermal_threshold()
92 static int __thermal_zone_discover(struct thermal_zone *tz, void *th) in __thermal_zone_discover() argument
94 if (thermal_cmd_get_trip(th, tz) < 0) in __thermal_zone_discover()
97 if (thermal_cmd_threshold_get(th, tz)) in __thermal_zone_discover()
100 if (thermal_cmd_get_governor(th, tz)) in __thermal_zone_discover()
106 struct thermal_zone *thermal_zone_discover(struct thermal_handler *th) in thermal_zone_discover() argument
110 if (thermal_cmd_get_tz(th, &tz) < 0) in thermal_zone_discover()
[all …]
Devents.c27 struct thermal_events_ops *ops = &thp->th->ops->events; in handle_thermal_event()
148 thermal_error_t thermal_events_handle(struct thermal_handler *th, void *arg) in thermal_events_handle() argument
150 struct thermal_handler_param thp = { .th = th, .arg = arg }; in thermal_events_handle()
152 if (!th) in thermal_events_handle()
155 if (nl_cb_set(th->cb_event, NL_CB_VALID, NL_CB_CUSTOM, in thermal_events_handle()
159 return nl_recvmsgs(th->sk_event, th->cb_event); in thermal_events_handle()
162 int thermal_events_fd(struct thermal_handler *th) in thermal_events_fd() argument
164 if (!th) in thermal_events_fd()
167 return nl_socket_get_fd(th->sk_event); in thermal_events_fd()
170 thermal_error_t thermal_events_exit(struct thermal_handler *th) in thermal_events_exit() argument
[all …]
Dcommands.c374 static thermal_error_t thermal_genl_auto(struct thermal_handler *th, cmd_cb_t cmd_cb, in thermal_genl_auto() argument
394 if (nl_send_msg(th->sk_cmd, th->cb_cmd, msg, genl_handle_msg, arg)) in thermal_genl_auto()
404 thermal_error_t thermal_cmd_get_tz(struct thermal_handler *th, struct thermal_zone **tz) in thermal_cmd_get_tz() argument
406 return thermal_genl_auto(th, NULL, NULL, THERMAL_GENL_CMD_TZ_GET_ID, in thermal_cmd_get_tz()
410 thermal_error_t thermal_cmd_get_cdev(struct thermal_handler *th, struct thermal_cdev **tc) in thermal_cmd_get_cdev() argument
412 return thermal_genl_auto(th, NULL, NULL, THERMAL_GENL_CMD_CDEV_GET, in thermal_cmd_get_cdev()
416 thermal_error_t thermal_cmd_get_trip(struct thermal_handler *th, struct thermal_zone *tz) in thermal_cmd_get_trip() argument
420 return thermal_genl_auto(th, thermal_genl_tz_id_encode, &p, in thermal_cmd_get_trip()
424 thermal_error_t thermal_cmd_get_governor(struct thermal_handler *th, struct thermal_zone *tz) in thermal_cmd_get_governor() argument
428 return thermal_genl_auto(th, thermal_genl_tz_id_encode, &p, in thermal_cmd_get_governor()
[all …]
/tools/lib/thermal/include/
Dthermal.h105 LIBTHERMAL_API int for_each_thermal_threshold(struct thermal_threshold *th, cb_th_t cb, void *arg);
112 LIBTHERMAL_API struct thermal_zone *thermal_zone_discover(struct thermal_handler *th);
116 LIBTHERMAL_API void thermal_exit(struct thermal_handler *th);
121 LIBTHERMAL_API thermal_error_t thermal_events_exit(struct thermal_handler *th);
123 LIBTHERMAL_API thermal_error_t thermal_events_init(struct thermal_handler *th);
125 LIBTHERMAL_API thermal_error_t thermal_events_handle(struct thermal_handler *th, void *arg);
127 LIBTHERMAL_API int thermal_events_fd(struct thermal_handler *th);
132 LIBTHERMAL_API thermal_error_t thermal_cmd_exit(struct thermal_handler *th);
134 LIBTHERMAL_API thermal_error_t thermal_cmd_init(struct thermal_handler *th);
136 LIBTHERMAL_API thermal_error_t thermal_cmd_get_tz(struct thermal_handler *th,
[all …]
/tools/testing/selftests/bpf/progs/
Dtest_btf_skc_cls_ingress.c21 static void test_syncookie_helper(struct ipv6hdr *ip6h, struct tcphdr *th, in test_syncookie_helper() argument
25 if (th->syn) { in test_syncookie_helper()
31 if (th->doff * 4 != 40) { in test_syncookie_helper()
36 if ((void *)th + 40 > data_end) { in test_syncookie_helper()
42 th, 40); in test_syncookie_helper()
52 th, sizeof(*th)); in test_syncookie_helper()
58 recv_cookie = bpf_ntohl(th->ack_seq) - 1; in test_syncookie_helper()
68 struct tcphdr *th; in handle_ip6_tcp() local
73 th = (struct tcphdr *)(ip6h + 1); in handle_ip6_tcp()
74 if (th + 1 > data_end) in handle_ip6_tcp()
[all …]
Dtest_misc_tcp_hdr_options.c36 struct tcphdr th; in __check_active_hdr_in() member
119 if (hdr.th.dest != passive_lport_n || hdr.th.source != active_lport_n) in __check_active_hdr_in()
132 struct tcphdr *th; in check_active_hdr_in() local
137 th = skops->skb_data; in check_active_hdr_in()
138 if (th + 1 > skops->skb_data_end) in check_active_hdr_in()
141 if (tcp_hdrlen(th) < skops->skb_len) in check_active_hdr_in()
144 if (th->fin) in check_active_hdr_in()
147 if (th->ack && !th->fin && tcp_hdrlen(th) == skops->skb_len) in check_active_hdr_in()
175 struct tcphdr *th; in write_active_opt() local
217 th = skops->skb_data; in write_active_opt()
[all …]
Dtest_assign_reuse.c81 maybe_assign_tcp(struct __sk_buff *skb, struct tcphdr *th) in maybe_assign_tcp() argument
83 if (th + 1 > (void *)(long)(skb->data_end)) in maybe_assign_tcp()
86 if (!th->syn || th->ack || th->dest != bpf_htons(dest_port)) in maybe_assign_tcp()
89 __builtin_memcpy(&headers.tcp, th, sizeof(headers.tcp)); in maybe_assign_tcp()
Dtest_select_reuseport_kern.c105 struct tcphdr *th = data; in _select_by_skb_data() local
107 if (th + 1 > data_end) in _select_by_skb_data()
110 data_check.skb_ports[0] = th->source; in _select_by_skb_data()
111 data_check.skb_ports[1] = th->dest; in _select_by_skb_data()
113 if (th->fin) in _select_by_skb_data()
119 if ((th->doff << 2) + sizeof(*cmd) > data_check.len) in _select_by_skb_data()
121 if (bpf_skb_load_bytes(reuse_md, th->doff << 2, &cmd_copy, in _select_by_skb_data()
Dverifier_netfilter_ctx.c96 const struct tcphdr *th; in with_valid_ctx_access_test6() local
114 th = bpf_dynptr_slice(&ptr, ihl, buffer_th, sizeof(buffer_th)); in with_valid_ctx_access_test6()
115 if (!th) in with_valid_ctx_access_test6()
118 return th->dest == bpf_htons(22) ? NF_ACCEPT : NF_DROP; in with_valid_ctx_access_test6()
Dtest_tcp_hdr_options.c377 struct tcphdr *th; in handle_write_hdr_opt() local
388 th = skops->skb_data; in handle_write_hdr_opt()
389 if (th + 1 > skops->skb_data_end) in handle_write_hdr_opt()
392 if (skops->skb_len > tcp_hdrlen(th)) in handle_write_hdr_opt()
468 struct tcphdr *th; in handle_passive_estab() local
489 th = skops->skb_data; in handle_passive_estab()
490 if (th + 1 > skops->skb_data_end) in handle_passive_estab()
493 if (th->syn) { in handle_passive_estab()
534 struct tcphdr *th; in handle_parse_hdr() local
539 th = skops->skb_data; in handle_parse_hdr()
[all …]
Dtest_tc_dtime.c146 struct tcphdr *th; in skb_get_type() local
185 th = trans; in skb_get_type()
186 if (th + 1 > data_end) in skb_get_type()
188 sport = th->source; in skb_get_type()
189 dport = th->dest; in skb_get_type()
Dtest_xdp_loop.c46 struct tcphdr *th; in get_dport() local
51 th = (struct tcphdr *)trans_data; in get_dport()
52 if (th + 1 > data_end) in get_dport()
54 return th->dest; in get_dport()
Dtest_xdp.c50 struct tcphdr *th; in get_dport() local
55 th = (struct tcphdr *)trans_data; in get_dport()
56 if (th + 1 > data_end) in get_dport()
58 return th->dest; in get_dport()
/tools/testing/selftests/drivers/net/mlxsw/
Dsharedbuffer_configuration.py36 def _get_static_size(self, th): argument
39 return th * 8000 * self._cell_size()
49 th = random.randint(3, 16)
51 return th
53 return self._get_static_size(th)
82 th = self._get_th(pool)
84 return (pool_n, th)
89 th = self._get_th(pool)
90 return (th,)
237 def dl_set(self, pool, th): argument
[all …]
/tools/thermal/thermal-engine/
Dthermal-engine.c38 struct thermal_handler *th; member
41 static int show_threshold(struct thermal_threshold *th, __maybe_unused void *arg) in show_threshold() argument
44 th->temperature, th->direction); in show_threshold()
92 struct thermal_handler *th = arg; in set_threshold() local
98 if (thermal_cmd_threshold_flush(th, tz)) { in set_threshold()
104 if (thermal_cmd_threshold_add(th, tz, thresholds[i], in set_threshold()
296 return thermal_events_handle(td->th, td); in thermal_event()
386 td.th = thermal_init(&ops); in main()
387 if (!td.th) { in main()
392 td.tz = thermal_zone_discover(td.th); in main()
[all …]
/tools/perf/util/
Dthreads.c67 struct thread *th, *res = NULL; in __threads_table_entry__get_last_match() local
69 th = table->last_match; in __threads_table_entry__get_last_match()
70 if (th != NULL) { in __threads_table_entry__get_last_match()
71 if (thread__tid(th) == tid) in __threads_table_entry__get_last_match()
72 res = thread__get(th); in __threads_table_entry__get_last_match()
78 struct thread *th) in __threads_table_entry__set_last_match() argument
81 table->last_match = thread__get(th); in __threads_table_entry__set_last_match()
85 struct thread *th) in threads_table_entry__set_last_match() argument
88 __threads_table_entry__set_last_match(table, th); in threads_table_entry__set_last_match()
/tools/perf/tests/workloads/
Dthloop.c35 pthread_t th; in thloop() local
44 pthread_create(&th, NULL, thfunc, test_loop); in thloop()
46 pthread_join(th, NULL); in thloop()
/tools/testing/selftests/net/lib/
Dcsum.c169 static uint16_t checksum(void *th, uint16_t proto, size_t len) in checksum() argument
184 return checksum_fold(th, len, sum); in checksum()
258 struct tcphdr *th = _th; in build_packet_tcp() local
260 th->source = htons(cfg_port_src); in build_packet_tcp()
261 th->dest = htons(cfg_port_dst); in build_packet_tcp()
262 th->doff = 5; in build_packet_tcp()
263 th->check = 0; in build_packet_tcp()
265 th->check = checksum(th, IPPROTO_TCP, sizeof(*th) + cfg_payload_len); in build_packet_tcp()
268 th->check = ~th->check; in build_packet_tcp()
270 fprintf(stderr, "tx: sending checksum: 0x%x\n", th->check); in build_packet_tcp()
[all …]
/tools/perf/tests/shell/coresight/thread_loop/
Dthread_loop.c21 pthread_t th; member
80 args[i].th = new_thr(thrfn, &(args[i])); in main()
83 pthread_join(args[i].th, &(args[i].ret)); in main()
/tools/perf/tests/shell/coresight/memcpy_thread/
Dmemcpy_thread.c12 pthread_t th; member
73 args[i].th = new_thr(thrfn, &(args[i])); in main()
76 pthread_join(args[i].th, &(args[i].ret)); in main()
/tools/perf/tests/shell/coresight/unroll_loop_thread/
Dunroll_loop_thread.c10 pthread_t th; member
68 args[i].th = new_thr(thrfn, &(args[i])); in main()
71 pthread_join(args[i].th, &(args[i].ret)); in main()
/tools/testing/selftests/timens/
Dvfork_exec.c50 pthread_t th; in check_in_thread() local
53 if (pthread_create(&th, NULL, tcheck, &args)) in check_in_thread()
55 if (pthread_join(th, &retval)) in check_in_thread()
/tools/testing/selftests/net/forwarding/
Ddevlink_lib.sh159 local th=$1; shift
161 devlink sb port pool set $port pool $pool th $th
174 devlink sb port pool set $port pool $pool th $orig
243 local th=$1; shift
245 devlink sb tc bind set $port tc $tc type $dir pool $pool th $th
260 pool ${orig[0]} th ${orig[1]}
/tools/testing/selftests/bpf/
Dtest_tcp_hdr_options.h96 static inline unsigned int tcp_hdrlen(const struct tcphdr *th) in tcp_hdrlen() argument
98 return th->doff << 2; in tcp_hdrlen()

12