source: libcfa/src/concurrency/stats.hfa@ 31bb2e1

ADT arm-eh ast-experimental enum forall-pointer-decay jacob/cs343-translation new-ast new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 31bb2e1 was 69fbc61, checked in by Thierry Delisle <tdelisle@…>, 5 years ago

Clusters/Processors can now select which stats to print.
Instead of all or nothing.

  • Property mode set to 100644
File size: 2.5 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 *, int, bool, const char *, void * ) {}
10#else
11 enum {
12 CFA_STATS_READY_Q = 0x01,
13 #if defined(HAVE_LINUX_IO_URING_H)
14 CFA_STATS_IO = 0x02,
15 #endif
16 };
17
18 struct __attribute__((aligned(64))) __stats_readQ_t {
19 struct {
20 // Push statistic
21 struct {
22 // number of attemps at pushing something
23 volatile uint64_t attempt;
24
25 // number of successes at pushing
26 volatile uint64_t success;
27
28 // number of attemps at pushing something to preferred queues
29 volatile uint64_t local;
30
31 // number of successes at pushing to preferred queues
32 volatile uint64_t lsuccess;
33 } push;
34
35 // Pop statistic
36 struct {
37 // number of reads of the mask
38 // picking an empty __cfa_readyQ_mask_t counts here
39 // but not as an attempt
40 volatile uint64_t probe;
41
42 // number of attemps at poping something
43 volatile uint64_t attempt;
44
45 // number of successes at poping
46 volatile uint64_t success;
47
48 // number of attemps at poping something to preferred queues
49 volatile uint64_t local;
50
51 // number of successes at poping to preferred queues
52 volatile uint64_t lsuccess;
53 } pop;
54 } pick;
55 struct {
56 volatile uint64_t migration;
57 } threads;
58 struct {
59 volatile uint64_t halts;
60 volatile uint64_t cancels;
61 volatile uint64_t wakes;
62 volatile uint64_t exits;
63 } sleep;
64 };
65
66 #if defined(HAVE_LINUX_IO_URING_H)
67 struct __attribute__((aligned(64))) __stats_io_t{
68 struct {
69 struct {
70 volatile uint64_t rdy;
71 volatile uint64_t csm;
72 volatile uint64_t avl;
73 volatile uint64_t cnt;
74 } submit_avg;
75 struct {
76 volatile uint64_t val;
77 volatile uint64_t cnt;
78 volatile uint64_t block;
79 } look_avg;
80 struct {
81 volatile uint64_t val;
82 volatile uint64_t cnt;
83 volatile uint64_t block;
84 } alloc_avg;
85 } submit_q;
86 struct {
87 struct {
88 volatile uint64_t val;
89 volatile uint64_t slow_cnt;
90 volatile uint64_t fast_cnt;
91 } completed_avg;
92 } complete_q;
93 };
94 #endif
95
96 struct __attribute__((aligned(128))) __stats_t {
97 __stats_readQ_t ready;
98 #if defined(HAVE_LINUX_IO_URING_H)
99 __stats_io_t io;
100 #endif
101 };
102
103 void __init_stats ( struct __stats_t * );
104 void __tally_stats( struct __stats_t *, struct __stats_t * );
105 void __print_stats( struct __stats_t *, int, bool, const char *, void * );
106#endif
107
Note: See TracBrowser for help on using the repository browser.