mirror of
https://github.com/ceph/ceph
synced 2025-04-04 15:36:24 +00:00
tasks/kclient: add 'debug' option
Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
parent
dedcc6483a
commit
9c55b81cc2
@ -4,6 +4,7 @@ Mount/unmount a ``kernel`` client.
|
|||||||
import contextlib
|
import contextlib
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from teuthology.misc import deep_merge
|
||||||
from teuthology import misc
|
from teuthology import misc
|
||||||
from cephfs.kernel_mount import KernelMount
|
from cephfs.kernel_mount import KernelMount
|
||||||
|
|
||||||
@ -34,17 +35,38 @@ def task(ctx, config):
|
|||||||
- kclient: [client.1]
|
- kclient: [client.1]
|
||||||
- interactive:
|
- interactive:
|
||||||
|
|
||||||
|
|
||||||
|
Pass a dictionary instead of lists to specify per-client config:
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
-kclient:
|
||||||
|
client.0:
|
||||||
|
debug: true
|
||||||
|
|
||||||
:param ctx: Context
|
:param ctx: Context
|
||||||
:param config: Configuration
|
:param config: Configuration
|
||||||
"""
|
"""
|
||||||
log.info('Mounting kernel clients...')
|
log.info('Mounting kernel clients...')
|
||||||
assert config is None or isinstance(config, list), \
|
assert config is None or isinstance(config, list) or isinstance(config, dict), \
|
||||||
"task kclient got invalid config"
|
"task kclient got invalid config"
|
||||||
|
|
||||||
if config is None:
|
if config is None:
|
||||||
config = ['client.{id}'.format(id=id_)
|
config = ['client.{id}'.format(id=id_)
|
||||||
for id_ in misc.all_roles_of_type(ctx.cluster, 'client')]
|
for id_ in misc.all_roles_of_type(ctx.cluster, 'client')]
|
||||||
clients = list(misc.get_clients(ctx=ctx, roles=config))
|
|
||||||
|
if isinstance(config, list):
|
||||||
|
client_roles = config
|
||||||
|
config = dict([r, dict()] for r in client_roles)
|
||||||
|
elif isinstance(config, dict):
|
||||||
|
client_roles = config.keys()
|
||||||
|
else:
|
||||||
|
raise ValueError("Invalid config object: {0} ({1})".format(config, config.__class__))
|
||||||
|
|
||||||
|
# config has been converted to a dict by this point
|
||||||
|
overrides = ctx.config.get('overrides', {})
|
||||||
|
deep_merge(config, overrides.get('kclient', {}))
|
||||||
|
|
||||||
|
clients = list(misc.get_clients(ctx=ctx, roles=client_roles))
|
||||||
|
|
||||||
test_dir = misc.get_testdir(ctx)
|
test_dir = misc.get_testdir(ctx)
|
||||||
|
|
||||||
@ -69,6 +91,11 @@ def task(ctx, config):
|
|||||||
|
|
||||||
mounts[id_] = kernel_mount
|
mounts[id_] = kernel_mount
|
||||||
|
|
||||||
|
client_config = config["client.{0}".format(id_)]
|
||||||
|
if client_config.get('debug', False):
|
||||||
|
remote.run(args=["sudo", "bash", "-c", "echo 'module ceph +p' > /sys/kernel/debug/dynamic_debug/control"])
|
||||||
|
remote.run(args=["sudo", "bash", "-c", "echo 'module libceph +p' > /sys/kernel/debug/dynamic_debug/control"])
|
||||||
|
|
||||||
kernel_mount.mount()
|
kernel_mount.mount()
|
||||||
|
|
||||||
ctx.mounts = mounts
|
ctx.mounts = mounts
|
||||||
|
Loading…
Reference in New Issue
Block a user