Motr  M0
cnt.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 
22 #pragma once
23 
24 #ifndef __MOTR_DESIM_CNT_H__
25 #define __MOTR_DESIM_CNT_H__
26 
32 #include "lib/tlist.h"
33 
34 typedef unsigned long long cnt_t;
35 
36 struct cnt {
41  double c_sq;
42  char *c_name;
44  struct cnt *c_parent;
45  uint64_t c_magic;
46 };
47 
48 M0_INTERNAL void
49 cnt_init(struct cnt *cnt, struct cnt *parent, const char *name, ...)
50  __attribute__((format(printf, 3, 4)));
51 M0_INTERNAL void cnt_fini(struct cnt *cnt);
52 M0_INTERNAL void cnt_dump(struct cnt *cnt);
53 M0_INTERNAL void cnt_dump_all(void);
54 
55 M0_INTERNAL void cnt_mod(struct cnt *cnt, cnt_t val);
56 
57 M0_INTERNAL void cnt_global_init(void);
58 M0_INTERNAL void cnt_global_fini(void);
59 
60 #endif /* __MOTR_DESIM_CNT_H__ */
61 
64 /*
65  * Local variables:
66  * c-indentation-style: "K&R"
67  * c-basic-offset: 8
68  * tab-width: 8
69  * fill-column: 80
70  * scroll-step: 1
71  * End:
72  */
cnt_t c_min
Definition: cnt.h:38
Definition: idx_mock.c:52
cnt_t c_nr
Definition: cnt.h:40
enum m0_md_lustre_logrec_type __attribute__
Definition: balloc.c:2745
struct m0_tlink c_linkage
Definition: cnt.h:43
M0_INTERNAL void cnt_init(struct cnt *cnt, struct cnt *parent, const char *format,...)
Definition: cnt.c:44
M0_INTERNAL void cnt_global_fini(void)
Definition: cnt.c:110
M0_INTERNAL void cnt_mod(struct cnt *cnt, cnt_t val)
Definition: cnt.c:92
Definition: cnt.h:36
const char * name
Definition: trace.c:110
cnt_t c_max
Definition: cnt.h:39
char * c_name
Definition: cnt.h:42
struct cnt * c_parent
Definition: cnt.h:44
format
Definition: hist.py:128
M0_INTERNAL void cnt_global_init(void)
Definition: cnt.c:105
M0_INTERNAL void cnt_dump_all(void)
Definition: cnt.c:74
M0_INTERNAL void cnt_dump(struct cnt *cnt)
Definition: cnt.c:59
uint64_t c_magic
Definition: cnt.h:45
double c_sq
Definition: cnt.h:41
unsigned long long cnt_t
Definition: cnt.h:34
cnt_t c_sum
Definition: cnt.h:37
M0_INTERNAL void cnt_fini(struct cnt *cnt)
Definition: cnt.c:83