| 72 | |
| 73 | template <unsigned SubV, int LvlV> |
| 74 | bool should_gather() const { |
| 75 | static_assert(SubV < get_num(), "wrong subsystem ID"); |
| 76 | static_assert(LvlV >= -1 && LvlV <= 200); |
| 77 | |
| 78 | if constexpr (LvlV <= 0) { |
| 79 | // handle the -1 and 0 levels entirely at compile-time. |
| 80 | // Such debugs are intended to be gathered regardless even |
| 81 | // of the user configuration. |
| 82 | return true; |
| 83 | } else { |
| 84 | // we expect that setting level different than the default |
| 85 | // is rather unusual. |
| 86 | return expect(LvlV <= static_cast<int>(m_gather_levels[SubV]), |
| 87 | LvlV <= ceph_subsys_get_max_default_level(SubV)); |
| 88 | } |
| 89 | } |
| 90 | bool should_gather(const unsigned sub, int level) const { |
| 91 | ceph_assert(sub < m_subsys.size()); |
| 92 | return level <= static_cast<int>(m_gather_levels[sub]); |