totemstats.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright (c) 2017 Red Hat, Inc.
  3. *
  4. * Author: Christine Caulfield (ccaulfie@redhat.com)
  5. *
  6. * All rights reserved.
  7. *
  8. * This software licensed under BSD license, the text of which follows:
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions are met:
  12. *
  13. * - Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * - Neither the name of the MontaVista Software, Inc. nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. * THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef TOTEMSTATS_H_DEFINED
  35. #define TOTEMSTATS_H_DEFINED
  36. typedef struct {
  37. int is_dirty;
  38. time_t last_updated;
  39. } totem_stats_header_t;
  40. typedef struct {
  41. totem_stats_header_t hdr;
  42. uint32_t iface_changes;
  43. } totemnet_stats_t;
  44. typedef struct {
  45. uint32_t rx;
  46. uint32_t tx;
  47. int backlog_calc;
  48. } totemsrp_token_stats_t;
  49. typedef struct {
  50. totem_stats_header_t hdr;
  51. uint64_t orf_token_tx;
  52. uint64_t orf_token_rx;
  53. uint64_t memb_merge_detect_tx;
  54. uint64_t memb_merge_detect_rx;
  55. uint64_t memb_join_tx;
  56. uint64_t memb_join_rx;
  57. uint64_t mcast_tx;
  58. uint64_t mcast_retx;
  59. uint64_t mcast_rx;
  60. uint64_t memb_commit_token_tx;
  61. uint64_t memb_commit_token_rx;
  62. uint64_t token_hold_cancel_tx;
  63. uint64_t token_hold_cancel_rx;
  64. uint64_t operational_entered;
  65. uint64_t operational_token_lost;
  66. uint64_t gather_entered;
  67. uint64_t gather_token_lost;
  68. uint64_t commit_entered;
  69. uint64_t commit_token_lost;
  70. uint64_t recovery_entered;
  71. uint64_t recovery_token_lost;
  72. uint64_t consensus_timeouts;
  73. uint64_t rx_msg_dropped;
  74. uint32_t continuous_gather;
  75. uint32_t continuous_sendmsg_failures;
  76. uint64_t time_since_token_last_received; // relative time
  77. uint8_t firewall_enabled_or_nic_failure;
  78. uint32_t mtt_rx_token;
  79. uint32_t avg_token_workload;
  80. uint32_t avg_backlog_calc;
  81. int earliest_token;
  82. int latest_token;
  83. #define TOTEM_TOKEN_STATS_MAX 100
  84. totemsrp_token_stats_t token[TOTEM_TOKEN_STATS_MAX];
  85. } totemsrp_stats_t;
  86. typedef struct {
  87. totem_stats_header_t hdr;
  88. totemsrp_stats_t *srp;
  89. uint32_t msg_reserved;
  90. uint32_t msg_queue_avail;
  91. } totempg_stats_t;
  92. extern int totemknet_link_get_status (
  93. knet_node_id_t node, uint8_t link,
  94. struct knet_link_status *status);
  95. int totemknet_handle_get_stats (
  96. struct knet_handle_stats *stats);
  97. void stats_knet_add_member(knet_node_id_t nodeid, uint8_t link);
  98. void stats_knet_del_member(knet_node_id_t nodeid, uint8_t link);
  99. void stats_knet_add_handle(void);
  100. #define TOTEMPG_STATS_CLEAR_TOTEM 1
  101. #define TOTEMPG_STATS_CLEAR_TRANSPORT 2
  102. extern void totempg_stats_clear (int flags);
  103. #endif /* TOTEMSTATS_H_DEFINED */