source: libcfa/src/concurrency/stats.hfa@ 8291293

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 8291293 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
RevLine 
[8834751]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 * ) {}
[69fbc61]9 static inline void __print_stats( struct __stats_t *, int, bool, const char *, void * ) {}
[8834751]10#else
[69fbc61]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
[8834751]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;
[52769ba]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;
[8834751]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;
[52769ba]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;
[8834751]53 } pop;
54 } pick;
[29cb302]55 struct {
56 volatile uint64_t migration;
57 } threads;
[68f36f4]58 struct {
59 volatile uint64_t halts;
60 volatile uint64_t cancels;
61 volatile uint64_t wakes;
62 volatile uint64_t exits;
63 } sleep;
[8834751]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 {
[13c5e19]88 volatile uint64_t val;
89 volatile uint64_t slow_cnt;
90 volatile uint64_t fast_cnt;
[8834751]91 } completed_avg;
92 } complete_q;
93 };
94 #endif
95
[37ba662]96 struct __attribute__((aligned(128))) __stats_t {
[8834751]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 * );
[69fbc61]105 void __print_stats( struct __stats_t *, int, bool, const char *, void * );
[8834751]106#endif
107
Note: See TracBrowser for help on using the repository browser.