client_keyring_path=client_keyring_path, hostfs_mntpt=hostfs_mntpt,
cephfs_name=cephfs_name, cephfs_mntpt=cephfs_mntpt, brxnet=brxnet)
+ self.dynamic_debug = config.get('dynamic_debug', False)
self.rbytes = config.get('rbytes', False)
self.inst = None
self.addr = None
self._set_filemode_on_mntpt()
+ if self.dynamic_debug:
+ kmount_count = self.ctx.get(f'kmount_count.{self.client_remote.hostname}', 0)
+ if kmount_count == 0:
+ self.enable_dynamic_debug()
+ self.ctx[f'kmount_count.{self.client_remote.hostname}'] = kmount_count + 1
+
self.mounted = True
def _run_mount_cmd(self, mntopts, check_status):
timeout=(15*60), omit_sudo=False)
raise e
+ if self.dynamic_debug:
+ kmount_count = self.ctx.get(f'kmount_count.{self.client_remote.hostname}')
+ assert kmount_count
+ if kmount_count == 1:
+ self.disable_dynamic_debug()
+ self.ctx[f'kmount_count.{self.client_remote.hostname}'] = kmount_count - 1
+
self.mounted = False
self.cleanup()
))
raise
+ def _dynamic_debug_control(self, enable):
+ """
+ Write to dynamic debug control file.
+ """
+ if enable:
+ fdata = "module ceph +p"
+ else:
+ fdata = "module ceph -p"
+
+ self.run_shell_payload(f"""
+sudo modprobe ceph
+echo '{fdata}' | sudo tee /sys/kernel/debug/dynamic_debug/control
+""")
+
+ def enable_dynamic_debug(self):
+ """
+ Enable the dynamic debug.
+ """
+ self._dynamic_debug_control(True)
+
+ def disable_dynamic_debug(self):
+ """
+ Disable the dynamic debug.
+ """
+ self._dynamic_debug_control(False)
+
def get_global_id(self):
"""
Look up the CephFS client ID for this mount, using debugfs.