| /linux/drivers/infiniband/core/ |
| H A D | uverbs_std_types_counters.c | 42 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_HANDLER() local 72 counters = rdma_zalloc_drv_obj(ib_dev, ib_counters); in UVERBS_HANDLER() 73 if (!counters) in UVERBS_HANDLER() 76 counters->device = ib_dev; in UVERBS_HANDLER() 77 counters->uobject = uobj; in UVERBS_HANDLER() 78 uobj->object = counters; in UVERBS_HANDLER() [all …]
|
| H A D | uverbs_flow.c | 16 resources->counters = in flow_resources_alloc() 17 kzalloc_objs(*resources->counters, num_specs); in flow_resources_alloc() 21 if (!resources->counters || !resources->collection) in flow_resources_alloc() 30 kfree(resources->counters); in flow_resources_alloc() 48 atomic_dec(&uflow_res->counters[i]->usecnt); in ib_uverbs_flow_resources_free() 51 kfree(uflow_res->counters); in ib_uverbs_flow_resources_free() 70 uflow_res->counters[uflow_res->counters_num++] = in flow_resources_add()
|
| /linux/lib/ |
| H A D | percpu_counter.c | 3 * Fast batching percpu counters. 67 s32 *pcount = per_cpu_ptr(fbc->counters, cpu); in percpu_counter_set() 83 * the this_cpu_add(), and the interrupt updates this_cpu(*fbc->counters), 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, amoun in percpu_counter_add_batch() 194 s32 __percpu *counters; __percpu_counter_init_many() local [all...] |
| /linux/tools/testing/selftests/net/tcp_ao/lib/ |
| H A D | proc.c | 18 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 D | macsec_api.c | 1825 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 …]
|
| H A D | macsec_api.h | 271 struct aq_mss_egress_sc_counters *counters, 280 struct aq_mss_egress_sa_counters *counters, 288 struct aq_mss_egress_common_counters *counters); 299 struct aq_mss_ingress_sa_counters *counters, 307 struct aq_mss_ingress_common_counters *counters);
|
| /linux/tools/testing/selftests/drivers/net/hw/ |
| H A D | ethtool_std_stats.sh | 30 local -a counters=("$@") 92 local -a counters 94 counters=("$h1 eth-ctrl MACControlFramesTransmitted $num_pkts 0") 98 counters=("$h1 eth-ctrl MACControlFramesReceived $num_pkts 0") 112 local -a counters error_cnt collision_cnt 115 counters=("$h1 eth-mac FrameCheckSequenceErrors 0 1" 128 counters=("$h1 eth-mac SingleCollisionFrames 0 1" 136 counters=("$h1 eth-mac BroadcastFramesXmittedOK $num_pkts 0" 141 counters=("$h1 eth-mac BroadcastFramesReceivedOK $num_pkts 0" 146 counters=("$h1 eth-mac FramesTransmittedOK $num_pkts 0" [all …]
|
| /linux/samples/cgroup/ |
| H A D | memcg_event_listener.c | 43 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/fs/smb/server/ |
| H A D | stats.h | 43 struct percpu_counter counters[KSMBD_COUNTER_MAX]; member 48 percpu_counter_inc(&ksmbd_counters.counters[type]); in ksmbd_counter_inc() 53 percpu_counter_dec(&ksmbd_counters.counters[type]); in ksmbd_counter_dec() 58 percpu_counter_add(&ksmbd_counters.counters[type], value); in ksmbd_counter_add() 63 percpu_counter_sub(&ksmbd_counters.counters[type], value); in ksmbd_counter_sub() 85 percpu_counter_inc(&ksmbd_counters.counters[type]); in ksmbd_counter_inc_reqs() 102 percpu_counter_inc(&ksmbd_counters.counters[type]); in ksmbd_counter_inc_reqs() 106 percpu_counter_inc(&ksmbd_counters.counters[KSMBD_COUNTER_REQUESTS]); in ksmbd_counter_inc_reqs() 107 percpu_counter_inc(&ksmbd_counters.counters[KSMBD_COUNTER_FIRST_REQ + cmd]); in ksmbd_counter_inc_reqs() 113 return percpu_counter_sum_positive(&ksmbd_counters.counters[type]); in ksmbd_counter_sum()
|
| H A D | proc.c | 232 for (i = 0; i < ARRAY_SIZE(ksmbd_counters.counters); i++) in ksmbd_proc_cleanup() 233 percpu_counter_destroy(&ksmbd_counters.counters[i]); in ksmbd_proc_cleanup() 242 for (i = 0; i < ARRAY_SIZE(ksmbd_counters.counters); i++) in ksmbd_proc_reset() 243 percpu_counter_set(&ksmbd_counters.counters[i], 0); 258 for (i = 0; i < ARRAY_SIZE(ksmbd_counters.counters); i++) { in ksmbd_proc_init() 259 retval = percpu_counter_init(&ksmbd_counters.counters[i], 0, GFP_KERNEL); in ksmbd_proc_init()
|
| /linux/Documentation/translations/zh_CN/core-api/ |
| H A D | local_ops.rst | 93 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 D | clang.c | 75 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 D | gcc_base.c | 46 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/net/ipv4/netfilter/ |
| H A D | arp_tables.c | 241 counter = xt_get_this_cpu_counter(&e->counters); in arpt_do_table() 330 e->counters.pcnt = pos; in mark_source_chains() 356 pos = e->counters.pcnt; in mark_source_chains() 357 e->counters.pcnt = 0; in mark_source_chains() 371 e->counters.pcnt = pos; in mark_source_chains() 391 e->counters.pcnt = pos; in mark_source_chains() 425 if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) in find_check_entry() 444 xt_percpu_counter_free(&e->counters); in find_check_entry() 506 /* Clear counters and comefrom */ in check_entry_size_and_hooks() 507 e->counters in check_entry_size_and_hooks() 612 get_counters(const struct xt_table_info * t,struct xt_counters counters[]) get_counters() argument 642 get_old_counters(const struct xt_table_info * t,struct xt_counters counters[]) get_old_counters() argument 663 struct xt_counters *counters; alloc_counters() local 687 struct xt_counters *counters; copy_entries_to_user() local 809 struct xt_counters *counters; __do_replace() local [all...] |
| /linux/drivers/perf/amlogic/ |
| H A D | meson_ddr_pmu_core.c | 23 struct dmc_counter counters; /* save counters from hw */ member 93 /* get the remain counters in register. */ in meson_ddr_perf_event_update() 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 in dmc_irq_handler() [all...] |
| /linux/net/ipv6/netfilter/ |
| H A D | ip6_tables.c | 320 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() 460 e->counters.pcnt = pos; in mark_source_chains() 546 if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) in find_check_entry() 585 xt_percpu_counter_free(&e->counters); in find_check_entry() 648 /* Clear counters and comefrom */ in check_entry_size_and_hooks() 649 e->counters in check_entry_size_and_hooks() 762 get_counters(const struct xt_table_info * t,struct xt_counters counters[]) get_counters() argument 792 get_old_counters(const struct xt_table_info * t,struct xt_counters counters[]) get_old_counters() argument 813 struct xt_counters *counters; alloc_counters() local 837 struct xt_counters *counters; copy_entries_to_user() local 1063 struct xt_counters *counters; __do_replace() local 1232 compat_uptr_t counters; /* struct xt_counters * */ global() member 1238 compat_copy_entry_to_user(struct ip6t_entry * e,void __user ** dstptr,unsigned int * size,struct xt_counters * counters,unsigned int i) compat_copy_entry_to_user() argument 1564 struct xt_counters *counters; compat_copy_entries_to_user() local [all...] |
| /linux/include/linux/ |
| H A D | alloc_tag.h | 30 struct alloc_tag_counters __percpu *counters; member 103 .counters = &_shared_alloc_tag }; 113 .counters = NULL }; 122 .counters = &_alloc_tag_cntr }; 146 counter = per_cpu_ptr(tag->counters, cpu); in alloc_tag_read() 197 this_cpu_inc(tag->counters->calls); in alloc_tag_ref_set() 204 this_cpu_add(tag->counters->bytes, bytes); in alloc_tag_add() 222 this_cpu_sub(tag->counters->bytes, bytes); in alloc_tag_sub() 223 this_cpu_dec(tag->counters->calls); in alloc_tag_sub()
|
| /linux/Documentation/core-api/ |
| H A D | local_ops.rst | 30 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/silabs/wfx/ |
| H A D | debug.c | 65 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 D | efct_xport.c | 105 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 …]
|
| /linux/mm/ |
| H A D | alloc_tag.c | 214 /* Fetch the per-CPU counters */ 222 * profiling counters extracted from the given kernel codetag. 226 struct alloc_tag_counters *counters) in allocinfo_to_params() argument 235 data->counter.bytes = counters->bytes; in allocinfo_to_params() 236 data->counter.calls = counters->calls; in allocinfo_to_params() 262 struct alloc_tag_counters *counters, in matches_filter() argument 300 *counters = allocinfo_prefetch_counters(ct); in matches_filter() 304 counters->bytes < filter->min_size) in matches_filter() 307 counters->bytes > filter->max_size) in matches_filter() 324 struct alloc_tag_counters counters; in allocinfo_ioctl_get_at() local 399 struct alloc_tag_counters counters; allocinfo_ioctl_get_next() local [all...] |
| /linux/tools/perf/ |
| H A D | design.txt | 5 Performance counters are special hardware registers available on most modern 13 hardware capabilities. It provides per task and per CPU counters, counter 15 provides "virtual" 64-bit counters, regardless of the width of the 16 underlying hardware counters. 18 Performance counters are accessed via special file descriptors. 32 Multiple counters can be kept open at a time, and the counters 130 * Special "software" counters provided by the kernel, even if the hardware 131 * does not support performance counters. These counters measure various 152 Counters come in two flavours: counting counters and sampling 153 counters. A "counting" counter is one that is used for counting the [all …]
|
| /linux/Documentation/admin-guide/perf/ |
| H A D | thunderx2-pmu.rst | 13 The DMC and L3C support up to 4 counters, while the CCPI2 supports up to 8 14 counters. Counters are independently programmable to different events and 15 can be started and stopped individually. None of the counters support an 16 overflow interrupt. DMC and L3C counters are 32-bit and read every 2 seconds. 17 The CCPI2 counters are 64-bit and assumed not to overflow in normal operation.
|
| /linux/Documentation/arch/powerpc/ |
| H A D | imc.rst | 17 IMC (In-Memory collection counters) is a hardware monitoring facility that 21 The Nest PMU counters are handled by a Nest IMC microcode which runs in the OCC 25 The Core and Thread IMC PMU counters are handled in the core. Core level PMU 26 counters give us the IMC counters' data per core and thread level PMU counters 27 give us the IMC counters' data per CPU thread. 51 The kernel discovers the IMC counters information in the device tree at the 52 `imc-counters` device node which has a compatible field 53 `ibm,opal-in-memory-counters`. From the device tree, the kernel parses the PMUs
|
| /linux/tools/perf/tests/shell/ |
| H A D | stat_bpf_counters_cgrp.sh | 2 # perf stat --bpf-counters --for-each-cgroup test (no_mlock) 12 # skip if --bpf-counters --for-each-cgroup is not supported 15 if ! perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1; then 17 echo "Skipping: --bpf-counters --for-each-cgroup not supported" 18 perf --no-pager stat -a --bpf-counters --for-each-cgroup / true || true 51 check_system_wide_counted_output=$(perf stat -a --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, sleep 1 2>&1) 66 expand_output=$(perf stat -a -x, --bpf-counters --for-each-cgroup / true 2>&1 | wc -l)
|