source: libcfa/src/concurrency/stats.hfa @ 68f36f4

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 68f36f4 was 68f36f4, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Added Idle Sleep stats and removed extra call to unsafe_remove

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#pragma once
2
3#include <stdint.h>
4
5#if defined(__CFA_NO_STATISTICS__)
6        struct __stats_t;
7        static inline void __init_stats( struct __stats_t * ) {}
8        static inline void __tally_stats( struct __stats_t *, struct __stats_t * ) {}
9        static inline void __print_stats( struct __stats_t * ) {}
10#else
11        struct __attribute__((aligned(64))) __stats_readQ_t {
12                struct {
13                        // Push statistic
14                        struct {
15                                // number of attemps at pushing something
16                                volatile uint64_t attempt;
17
18                                // number of successes at pushing
19                                volatile uint64_t success;
20                        } push;
21
22                        // Pop statistic
23                        struct {
24                                // number of reads of the mask
25                                // picking an empty __cfa_readyQ_mask_t counts here
26                                // but not as an attempt
27                                volatile uint64_t probe;
28
29                                // number of attemps at poping something
30                                volatile uint64_t attempt;
31
32                                // number of successes at poping
33                                volatile uint64_t success;
34                        } pop;
35                } pick;
36                struct {
37                        volatile uint64_t halts;
38                        volatile uint64_t cancels;
39                        volatile uint64_t wakes;
40                        volatile uint64_t exits;
41                } sleep;
42        };
43
44        #if defined(HAVE_LINUX_IO_URING_H)
45                struct __attribute__((aligned(64))) __stats_io_t{
46                        struct {
47                                struct {
48                                        volatile uint64_t rdy;
49                                        volatile uint64_t csm;
50                                        volatile uint64_t avl;
51                                        volatile uint64_t cnt;
52                                } submit_avg;
53                                struct {
54                                        volatile uint64_t val;
55                                        volatile uint64_t cnt;
56                                        volatile uint64_t block;
57                                } look_avg;
58                                struct {
59                                        volatile uint64_t val;
60                                        volatile uint64_t cnt;
61                                        volatile uint64_t block;
62                                } alloc_avg;
63                        } submit_q;
64                        struct {
65                                struct {
66                                        unsigned long long int val;
67                                        unsigned long long int slow_cnt;
68                                        unsigned long long int fast_cnt;
69                                } completed_avg;
70                        } complete_q;
71                };
72        #endif
73
74        struct __attribute__((aligned(128))) __stats_t {
75                __stats_readQ_t ready;
76                #if defined(HAVE_LINUX_IO_URING_H)
77                        __stats_io_t    io;
78                #endif
79        };
80
81        void __init_stats ( struct __stats_t * );
82        void __tally_stats( struct __stats_t *, struct __stats_t * );
83        void __print_stats( struct __stats_t * );
84#endif
85
Note: See TracBrowser for help on using the repository browser.