Home
last modified time | relevance | path

Searched refs:counters (Results 1 – 25 of 375) sorted by relevance

12345678910>>...15

/linux/drivers/infiniband/core/
H A Duverbs_std_types_counters.c42 struct ib_counters *counters = uobject->object; in uverbs_free_counters() local
45 if (atomic_read(&counters->usecnt)) in uverbs_free_counters()
48 ret = counters->device->ops.destroy_counters(counters); in uverbs_free_counters()
51 kfree(counters); in uverbs_free_counters()
61 struct ib_counters *counters; in UVERBS_METHOD_COUNTERS_CREATE() local
72 counters = rdma_zalloc_drv_obj(ib_dev, ib_counters); in UVERBS_METHOD_COUNTERS_CREATE()
73 if (!counters) in UVERBS_METHOD_COUNTERS_CREATE()
76 counters->device = ib_dev; in UVERBS_METHOD_COUNTERS_CREATE()
77 counters->uobject = uobj; in UVERBS_METHOD_COUNTERS_CREATE()
78 uobj->object = counters; in UVERBS_METHOD_COUNTERS_CREATE()
[all …]
/linux/lib/
H A Dpercpu_counter.c67 s32 *pcount = per_cpu_ptr(fbc->counters, cpu); in percpu_counter_set()
98 count = this_cpu_read(*fbc->counters); in percpu_counter_add_batch()
106 count = __this_cpu_read(*fbc->counters); in percpu_counter_add_batch()
108 __this_cpu_sub(*fbc->counters, count); in percpu_counter_add_batch()
112 } while (!this_cpu_try_cmpxchg(*fbc->counters, &count, count + amount)); in percpu_counter_add_batch()
126 count = __this_cpu_read(*fbc->counters) + amount; in percpu_counter_add_batch()
130 __this_cpu_sub(*fbc->counters, count - amount); in percpu_counter_add_batch()
133 this_cpu_add(*fbc->counters, amount); in percpu_counter_add_batch()
152 count = __this_cpu_read(*fbc->counters); in percpu_counter_sync()
154 __this_cpu_sub(*fbc->counters, count); in percpu_counter_sync()
[all …]
/linux/net/netfilter/
H A Dxt_connbytes.c30 const struct nf_conn_counter *counters; in connbytes_mt() local
40 counters = acct->counter; in connbytes_mt()
45 what = atomic64_read(&counters[IP_CT_DIR_ORIGINAL].packets); in connbytes_mt()
48 what = atomic64_read(&counters[IP_CT_DIR_REPLY].packets); in connbytes_mt()
51 what = atomic64_read(&counters[IP_CT_DIR_ORIGINAL].packets); in connbytes_mt()
52 what += atomic64_read(&counters[IP_CT_DIR_REPLY].packets); in connbytes_mt()
59 what = atomic64_read(&counters[IP_CT_DIR_ORIGINAL].bytes); in connbytes_mt()
62 what = atomic64_read(&counters[IP_CT_DIR_REPLY].bytes); in connbytes_mt()
65 what = atomic64_read(&counters[IP_CT_DIR_ORIGINAL].bytes); in connbytes_mt()
66 what += atomic64_read(&counters[IP_CT_DIR_REPLY].bytes); in connbytes_mt()
[all …]
/linux/tools/testing/selftests/net/tcp_ao/lib/
H A Dproc.c18 struct netstat_counter *counters; member
52 ret->counters = NULL; in lookup_get()
81 type->counters = reallocarray(type->counters, in netstat_read_type()
84 if (!type->counters) in netstat_read_type()
95 struct netstat_counter *nc = &type->counters[i]; in netstat_read_type()
133 type->counters = reallocarray(type->counters, i + 1, in snmp6_read()
135 if (!type->counters) in snmp6_read()
137 nc = &type->counters[i]; in snmp6_read()
196 free(ns->counters[i].name); in netstat_free()
197 free(ns->counters); in netstat_free()
[all …]
/linux/drivers/net/ethernet/aquantia/atlantic/macsec/
H A Dmacsec_api.c1825 struct aq_mss_egress_sc_counters *counters, in get_egress_sc_counters() argument
1837 counters->sc_protected_pkts[0] = in get_egress_sc_counters()
1839 counters->sc_protected_pkts[1] = in get_egress_sc_counters()
1845 counters->sc_encrypted_pkts[0] = in get_egress_sc_counters()
1847 counters->sc_encrypted_pkts[1] = in get_egress_sc_counters()
1853 counters->sc_protected_octets[0] = in get_egress_sc_counters()
1855 counters->sc_protected_octets[1] = in get_egress_sc_counters()
1861 counters->sc_encrypted_octets[0] = in get_egress_sc_counters()
1863 counters->sc_encrypted_octets[1] = in get_egress_sc_counters()
1870 struct aq_mss_egress_sc_counters *counters, in aq_mss_get_egress_sc_counters() argument
[all …]
/linux/samples/cgroup/
H A Dmemcg_event_listener.c43 struct memcg_counters counters; member
49 static void print_memcg_counters(const struct memcg_counters *counters) in print_memcg_counters() argument
52 printf("\tlow: %ld\n", counters->low); in print_memcg_counters()
53 printf("\thigh: %ld\n", counters->high); in print_memcg_counters()
54 printf("\tmax: %ld\n", counters->max); in print_memcg_counters()
55 printf("\toom: %ld\n", counters->oom); in print_memcg_counters()
56 printf("\toom_kill: %ld\n", counters->oom_kill); in print_memcg_counters()
57 printf("\toom_group_kill: %ld\n", counters->oom_group_kill); in print_memcg_counters()
107 struct memcg_counters *counters = &events->counters; in read_memcg_events() local
116 .old = &counters->low, in read_memcg_events()
[all …]
/linux/Documentation/translations/zh_CN/core-api/
H A Dlocal_ops.rst93 static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0);
105 local_inc(&get_cpu_var(counters));
106 put_cpu_var(counters);
110 local_inc(this_cpu_ptr(&counters));
123 sum += local_read(&per_cpu(counters, cpu));
143 static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0);
152 local_inc(this_cpu_ptr(&counters));
157 * local_inc(&get_cpu_var(counters));
158 * put_cpu_var(counters);
166 /* Increment the counters */
[all …]
/linux/kernel/gcov/
H A Dclang.c75 u64 *counters; member
128 void llvm_gcda_emit_arcs(u32 num_counters, u64 *counters) in llvm_gcda_emit_arcs() argument
134 info->counters = counters; in llvm_gcda_emit_arcs()
230 memset(fn->counters, 0, in gcov_info_reset()
231 sizeof(fn->counters[0]) * fn->num_counters); in gcov_info_reset()
282 dfn_ptr->counters[i] += sfn_ptr->counters[i]; in gcov_info_add()
297 cv_size = fn->num_counters * sizeof(fn->counters[0]); in gcov_fn_info_dup()
298 fn_dup->counters = kvmalloc(cv_size, GFP_KERNEL); in gcov_fn_info_dup()
299 if (!fn_dup->counters) { in gcov_fn_info_dup()
304 memcpy(fn_dup->counters, fn->counters, cv_size); in gcov_fn_info_dup()
[all …]
H A Dgcc_base.c46 void __gcov_merge_add(gcov_type *counters, unsigned int n_counters) in __gcov_merge_add() argument
52 void __gcov_merge_single(gcov_type *counters, unsigned int n_counters) in __gcov_merge_single() argument
58 void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters) in __gcov_merge_delta() argument
64 void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters) in __gcov_merge_ior() argument
70 void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters) in __gcov_merge_time_profile() argument
76 void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters) in __gcov_merge_icall_topn() argument
/linux/fs/smb/server/
H A Dstats.h30 struct percpu_counter counters[KSMBD_COUNTER_MAX]; member
35 percpu_counter_inc(&ksmbd_counters.counters[type]); in ksmbd_counter_inc()
40 percpu_counter_dec(&ksmbd_counters.counters[type]); in ksmbd_counter_dec()
45 percpu_counter_add(&ksmbd_counters.counters[type], value); in ksmbd_counter_add()
50 percpu_counter_sub(&ksmbd_counters.counters[type], value); in ksmbd_counter_sub()
56 percpu_counter_inc(&ksmbd_counters.counters[KSMBD_COUNTER_FIRST_REQ + cmd]); in ksmbd_counter_inc_reqs()
61 return percpu_counter_sum_positive(&ksmbd_counters.counters[type]); in ksmbd_counter_sum()
H A Dproc.c95 for (i = 0; i < ARRAY_SIZE(ksmbd_counters.counters); i++) in ksmbd_proc_cleanup()
96 percpu_counter_destroy(&ksmbd_counters.counters[i]); in ksmbd_proc_cleanup()
105 for (i = 0; i < ARRAY_SIZE(ksmbd_counters.counters); i++) in ksmbd_proc_reset()
106 percpu_counter_set(&ksmbd_counters.counters[i], 0); in ksmbd_proc_reset()
121 for (i = 0; i < ARRAY_SIZE(ksmbd_counters.counters); i++) { in ksmbd_proc_init()
122 retval = percpu_counter_init(&ksmbd_counters.counters[i], 0, GFP_KERNEL); in ksmbd_proc_init()
/linux/drivers/perf/amlogic/
H A Dmeson_ddr_pmu_core.c23 struct dmc_counter counters; /* save counters from hw */ member
96 ddr_cnt_addition(&sum_dc, &pmu->counters, &dc, chann_nr); in meson_ddr_perf_event_update()
147 memset(&pmu->counters, 0, sizeof(pmu->counters)); in meson_ddr_perf_event_start()
351 struct dmc_counter counters, *sum_cnter; in dmc_irq_handler() local
356 if (info->hw_info->irq_handler(info, &counters) != 0) in dmc_irq_handler()
359 sum_cnter = &pmu->counters; in dmc_irq_handler()
360 sum_cnter->all_cnt += counters.all_cnt; in dmc_irq_handler()
361 sum_cnter->all_req += counters.all_req; in dmc_irq_handler()
364 sum_cnter->channel_cnt[i] += counters.channel_cnt[i]; in dmc_irq_handler()
376 counters.all_req, in dmc_irq_handler()
[all …]
/linux/tools/perf/util/
H A Dvalues.c26 values->counters = malloc(values->counters_max * sizeof(*values->counters)); in perf_read_values_init()
27 if (!values->counters) { in perf_read_values_init()
36 zfree(&values->counters); in perf_read_values_init()
56 zfree(&values->counters); in perf_read_values_destroy()
114 struct evsel **new_counters = realloc(values->counters, in perf_read_values__enlarge_counters()
115 counters_max * sizeof(*values->counters)); in perf_read_values__enlarge_counters()
137 values->counters = new_counters; in perf_read_values__enlarge_counters()
152 if (values->counters[i] == evsel) in perf_read_values__findnew_counter()
163 values->counters[i] = evsel; in perf_read_values__findnew_counter()
200 counterwidth[j] = strlen(evsel__name(values->counters[j])); in perf_read_values__display_pretty()
[all …]
/linux/net/ipv4/netfilter/
H A Darp_tables.c230 counter = xt_get_this_cpu_counter(&e->counters); in arpt_do_table()
319 e->counters.pcnt = pos; in mark_source_chains()
345 pos = e->counters.pcnt; in mark_source_chains()
346 e->counters.pcnt = 0; in mark_source_chains()
360 e->counters.pcnt = pos; in mark_source_chains()
379 e->counters.pcnt = pos; in mark_source_chains()
413 if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) in find_check_entry()
432 xt_percpu_counter_free(&e->counters); in find_check_entry()
495 e->counters = ((struct xt_counters) { 0, 0 }); in check_entry_size_and_hooks()
513 xt_percpu_counter_free(&e->counters); in cleanup_entry()
[all …]
H A Dip_tables.c297 counter = xt_get_this_cpu_counter(&e->counters); in ipt_do_table()
383 e->counters.pcnt = pos; in mark_source_chains()
407 pos = e->counters.pcnt; in mark_source_chains()
408 e->counters.pcnt = 0; in mark_source_chains()
422 e->counters.pcnt = pos; in mark_source_chains()
441 e->counters.pcnt = pos; in mark_source_chains()
526 if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) in find_check_entry()
566 xt_percpu_counter_free(&e->counters); in find_check_entry()
630 e->counters = ((struct xt_counters) { 0, 0 }); in check_entry_size_and_hooks()
654 xt_percpu_counter_free(&e->counters); in cleanup_entry()
[all …]
/linux/Documentation/arch/arm64/
H A Damu.rst22 counters intended for system management use. The AMU extension provides a
27 of four fixed and architecturally defined 64-bit event counters.
37 When in WFI or WFE these counters do not increment.
40 event counters. Future versions of the architecture may use this space to
41 implement additional architected event counters.
44 64-bit event counters.
46 On cold reset all counters reset to 0.
59 counters, only the presence of the extension.
66 - Enable the counters. If not enabled these will read as 0.
67 - Save/restore the counters before/after the CPU is being put/brought up
[all …]
/linux/net/ipv6/netfilter/
H A Dip6_tables.c320 counter = xt_get_this_cpu_counter(&e->counters); in ip6t_do_table()
401 e->counters.pcnt = pos; in mark_source_chains()
425 pos = e->counters.pcnt; in mark_source_chains()
426 e->counters.pcnt = 0; in mark_source_chains()
440 e->counters.pcnt = pos; in mark_source_chains()
459 e->counters.pcnt = pos; in mark_source_chains()
545 if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) in find_check_entry()
584 xt_percpu_counter_free(&e->counters); in find_check_entry()
648 e->counters = ((struct xt_counters) { 0, 0 }); in check_entry_size_and_hooks()
671 xt_percpu_counter_free(&e->counters); in cleanup_entry()
[all …]
/linux/drivers/gpu/drm/v3d/
H A Dv3d_perfmon.c200 const struct v3d_perf_counter_desc *counters = NULL; in v3d_perfmon_init() local
204 counters = v3d_v71_performance_counters; in v3d_perfmon_init()
207 counters = v3d_v42_performance_counters; in v3d_perfmon_init()
212 v3d->perfmon_info.counters = counters; in v3d_perfmon_init()
243 u32 channel = V3D_SET_FIELD_VER(perfmon->counters[i], V3D_PCTR_S0, in v3d_perfmon_start()
247 channel |= V3D_SET_FIELD_VER(i < ncounters ? perfmon->counters[i] : 0, in v3d_perfmon_start()
250 channel |= V3D_SET_FIELD_VER(i < ncounters ? perfmon->counters[i] : 0, in v3d_perfmon_start()
253 channel |= V3D_SET_FIELD_VER(i < ncounters ? perfmon->counters[i] : 0, in v3d_perfmon_start()
352 if (req->counters[i] >= v3d->perfmon_info.max_counters) in v3d_perfmon_create_ioctl()
361 perfmon->counters[i] = req->counters[i]; in v3d_perfmon_create_ioctl()
[all …]
/linux/Documentation/ABI/testing/
H A Dsysfs-platform-mellanox-pmc2 MLNXBFD0 mlxbf-pmc Performance counters (BlueField-1)
3 MLNXBFD1 mlxbf-pmc Performance counters (BlueField-2)
4 MLNXBFD2 mlxbf-pmc Performance counters (BlueField-3)
11 List of events supported by the counters in the specific block.
39 Start or stop counters. This is used to start the counters
41 counters after the desired duration. Writing value 1 will
42 start all the counters in the block, and writing 0 will
43 stop all the counters together.
61 any of the counters in the block to counting cycles. Each counter is
/linux/include/linux/
H A Dalloc_tag.h30 struct alloc_tag_counters __percpu *counters; member
103 .counters = &_shared_alloc_tag };
113 .counters = NULL };
122 .counters = &_alloc_tag_cntr };
144 counter = per_cpu_ptr(tag->counters, cpu); in alloc_tag_read()
193 this_cpu_inc(tag->counters->calls); in alloc_tag_ref_set()
200 this_cpu_add(tag->counters->bytes, bytes); in alloc_tag_add()
218 this_cpu_sub(tag->counters->bytes, bytes); in alloc_tag_sub()
219 this_cpu_dec(tag->counters->calls); in alloc_tag_sub()
/linux/Documentation/core-api/
H A Dlocal_ops.rst30 counters. They minimize the performance cost of standard atomic operations by
34 Having fast per CPU atomic counters is interesting in many cases: it does not
36 coherent counters in NMI handlers. It is especially useful for tracing purposes
37 and for various performance monitoring counters.
95 static DEFINE_PER_CPU(local_t, counters) = LOCAL_INIT(0);
107 local_inc(&get_cpu_var(counters));
108 put_cpu_var(counters);
113 local_inc(this_cpu_ptr(&counters));
117 Reading the counters
120 Those local counters can be read from foreign CPUs to sum the count. Note that
[all …]
/linux/drivers/net/wireless/intel/iwlwifi/mld/
H A Dlow_latency.c44 struct iwl_mld_low_latency_packets_counters *counters = in iwl_mld_calc_low_latency() local
47 spin_lock_bh(&counters->lock); in iwl_mld_calc_low_latency()
49 total_vo_vi_pkts += counters->vo_vi[mac_id]; in iwl_mld_calc_low_latency()
52 counters->vo_vi[mac_id] = 0; in iwl_mld_calc_low_latency()
54 spin_unlock_bh(&counters->lock); in iwl_mld_calc_low_latency()
267 struct iwl_mld_low_latency_packets_counters *counters; in iwl_mld_low_latency_update_counters() local
275 if (WARN_ON_ONCE(fw_id >= ARRAY_SIZE(counters->vo_vi) || in iwl_mld_low_latency_update_counters()
285 counters = &mld->low_latency.pkts_counters[queue]; in iwl_mld_low_latency_update_counters()
287 spin_lock_bh(&counters->lock); in iwl_mld_low_latency_update_counters()
288 counters->vo_vi[fw_id]++; in iwl_mld_low_latency_update_counters()
[all …]
/linux/drivers/accessibility/speakup/
H A Dkeyhelp.c51 u_char *kp, counters[MAXFUNCS], ch, ch1; in build_key_data() local
56 memset(counters, 0, sizeof(counters)); in build_key_data()
66 counters[*kp]++; in build_key_data()
70 if (counters[i] == 0) in build_key_data()
73 offset += (counters[i] + 1); in build_key_data()
90 counters[ch1]--; in build_key_data()
94 p_key = key_data + offset + counters[ch1]; in build_key_data()
/linux/drivers/net/wireless/silabs/wfx/
H A Ddebug.c65 struct wfx_hif_mib_extended_count_table counters[3]; in wfx_counters_show() local
67 for (i = 0; i < ARRAY_SIZE(counters); i++) { in wfx_counters_show()
68 ret = wfx_hif_get_counters_table(wdev, i, counters + i); in wfx_counters_show()
79 le32_to_cpu(counters[2].count_##name), \ in wfx_counters_show()
80 le32_to_cpu(counters[0].count_##name), \ in wfx_counters_show()
81 le32_to_cpu(counters[1].count_##name)) in wfx_counters_show()
117 for (i = 0; i < ARRAY_SIZE(counters[0].reserved); i++) in wfx_counters_show()
119 le32_to_cpu(counters[2].reserved[i]), in wfx_counters_show()
120 le32_to_cpu(counters[0].reserved[i]), in wfx_counters_show()
121 le32_to_cpu(counters[1].reserved[i])); in wfx_counters_show()
/linux/drivers/scsi/elx/efct/
H A Defct_xport.c105 struct efct_hw_link_stat_counts *counters, void *arg) in efct_xport_link_stats_cb() argument
110 counters[EFCT_HW_LINK_STAT_LINK_FAILURE_COUNT].counter; in efct_xport_link_stats_cb()
112 counters[EFCT_HW_LINK_STAT_LOSS_OF_SYNC_COUNT].counter; in efct_xport_link_stats_cb()
114 counters[EFCT_HW_LINK_STAT_PRIMITIVE_SEQ_COUNT].counter; in efct_xport_link_stats_cb()
116 counters[EFCT_HW_LINK_STAT_INVALID_XMIT_WORD_COUNT].counter; in efct_xport_link_stats_cb()
118 counters[EFCT_HW_LINK_STAT_CRC_COUNT].counter; in efct_xport_link_stats_cb()
125 struct efct_hw_host_stat_counts *counters, void *arg) in efct_xport_host_stats_cb() argument
130 counters[EFCT_HW_HOST_STAT_TX_KBYTE_COUNT].counter; in efct_xport_host_stats_cb()
132 counters[EFCT_HW_HOST_STAT_RX_KBYTE_COUNT].counter; in efct_xport_host_stats_cb()
134 counters[EFCT_HW_HOST_STAT_TX_FRAME_COUNT].counter; in efct_xport_host_stats_cb()
[all …]

12345678910>>...15