diff --git a/lustre/conf/lustre.dtd b/lustre/conf/lustre.dtd index de4d65362fff6cd4affecbc73d17033df12e62dc..96fdc8ec5035e7eeef130249a913afb8409fea37 100644 --- a/lustre/conf/lustre.dtd +++ b/lustre/conf/lustre.dtd @@ -15,7 +15,7 @@ <!ATTLIST lustre version CDATA #REQUIRED> <!ELEMENT node (network | routetbl | profile_ref | timeout | - lustreUpcall | portalsUpcall)*> + lustreUpcall | portalsUpcall | ptldebug | subsystem)*> <!ATTLIST node %object.attr; router CDATA #IMPLIED> @@ -87,6 +87,8 @@ <!-- basic elements --> <!ELEMENT recoveryUpcall %object.content;> <!ELEMENT timeout %object.content;> +<!ELEMENT ptldebug %object.content;> +<!ELEMENT subsystem %object.content;> <!ELEMENT journalsize %object.content;> <!ELEMENT fstype %object.content;> <!ELEMENT nid %object.content;> diff --git a/lustre/conf/lustre2ldif.xsl b/lustre/conf/lustre2ldif.xsl index 5fc6f9c59862b37e7ab76a14301c2e27a8ae0a16..3713ec873d4dac89db607f72a8d895acda6ac8cd 100644 --- a/lustre/conf/lustre2ldif.xsl +++ b/lustre/conf/lustre2ldif.xsl @@ -33,6 +33,12 @@ lustreUpcall: <value-of select="lustreUpcall"/> <if test="portalsUpcall"> portalsUpcall: <value-of select="portalsUpcall"/> </if> +<if test="ptldebug"> +ptldebug: <value-of select="ptldebug"/> +</if> +<if test="subsystem"> +subsystem: <value-of select="subsystem"/> +</if> <text> </text> <for-each select="network"> diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index a7350221edb65a7d1392a9ba0322b24f05c47069..8da53f9ae26a99d4794527fb54ea1fa679f76f22 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -16,6 +16,7 @@ MOUNT2=${MOUNT2:-"/mnt/lustre2"} DIR=${DIR:-$MOUNT} DIR2=${DIR2:-$MOUNT1} PTLDEBUG=${PTLDEBUG:-0x3f0400} +SUBSYSTEM=${SUBSYSTEM:-0} PDSH=${PDSH:-no_dsh} MDSDEV=${MDSDEV:-$ROOT/tmp/mds-`hostname`} diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index f71e39e4c814ef92c0ce1b41ff81d5a804694ca4..4eaeacdeb6d1209e2baada77c8cf3958a252a777 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -212,5 +212,48 @@ test_8() { } run_test 8 "double mount setup" +test_9() { + # backup the old values of PTLDEBUG and SUBSYSTEM + OLDPTLDEBUG=$PTLDEBUG + OLDSUBSYSTEM=$SUBSYSTEM + + # generate new configuration file with lmc --ptldebug and --subsystem + PTLDEBUG="trace" + SUBSYSTEM="mdc" + gen_config + + # check the result of lmc --ptldebug/subsystem + start_ost + start_mds + mount_client $MOUNT + [ "`cat /proc/sys/portals/debug`" = "1" ] && \ + echo "lmc --debug success" || return 1 + [ "`cat /proc/sys/portals/subsystem_debug`" = "16777216" ] && \ + echo "lmc --subsystem success" || return 1 + check_mount || return 41 + cleanup + + # the new PTLDEBUG/SUBSYSTEM used for lconf --ptldebug/subsystem + PTLDEBUG="inode" + SUBSYSTEM="mds" + + # check lconf --ptldebug/subsystem overriding lmc --ptldebug/subsystem + start_ost + start_mds + mount_client $MOUNT + [ "`cat /proc/sys/portals/debug`" = "2" ] && \ + echo "lconf --debug overriding success" || return 1 + [ "`cat /proc/sys/portals/subsystem_debug`" = "33554432" ] && \ + echo "lconf --subsystem overriding success" || return 1 + check_mount || return 41 + cleanup + + # resume the old configuration + PTLDEBUG=$OLDPTLDEBUG + SUBSYSTEM=$OLDSUBSYSTEM + gen_config +} +run_test 9 "test --ptldebug and --subsystem for lmc" + equals_msg "Done" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 4c49e837800124ed8dc7aae0e9222a8bab0799de..1ea2be73a829f9cb5714b937edb193e8dc078702 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -62,14 +62,18 @@ start() { facet=$1 shift active=`facet_active $facet` - do_facet $facet $LCONF --select ${facet}_svc=${active}_facet --node ${active}_facet --ptldebug $PTLDEBUG $@ $XMLCONFIG + do_facet $facet $LCONF --select ${facet}_svc=${active}_facet \ + --node ${active}_facet --ptldebug $PTLDEBUG --subsystem $SUBSYSTEM \ + $@ $XMLCONFIG } stop() { facet=$1 active=`facet_active $facet` shift - do_facet $facet $LCONF --select ${facet}_svc=${active}_facet --node ${active}_facet --ptldebug $PTLDEBUG $@ --cleanup $XMLCONFIG + do_facet $facet $LCONF --select ${facet}_svc=${active}_facet \ + --node ${active}_facet --ptldebug $PTLDEBUG --subsystem $SUBSYSTEM \ + $@ --cleanup $XMLCONFIG } zconf_mount() { @@ -274,7 +278,8 @@ add_mds() { facet=$1 shift rm -f ${facet}active - add_facet $facet --lustre_upcall $UPCALL + add_facet $facet --lustre_upcall $UPCALL --ptldebug $PTLDEBUG \ + --subsystem $SUBSYSTEM do_lmc --add mds --node ${facet}_facet --mds ${facet}_svc $* } diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 55720f489c09fe8e9babaabf5893edd5e12d6ec1..06b20693039975183fc655a5ebd80b7927354d15 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -2171,6 +2171,8 @@ def doHost(lustreDB, hosts): lustre_upcall = node_db.get_val('lustreUpcall', '') portals_upcall = node_db.get_val('portalsUpcall', '') timeout = node_db.get_val_int('timeout', 0) + ptldebug = node_db.get_val('ptldebug', '') + subsystem = node_db.get_val('subsystem', '') find_local_clusters(node_db) if not is_router: @@ -2202,8 +2204,8 @@ def doHost(lustreDB, hosts): return sys_set_timeout(timeout) - sys_set_ptldebug() - sys_set_subsystem() + sys_set_ptldebug(ptldebug) + sys_set_subsystem(subsystem) sys_set_lustre_upcall(lustre_upcall) sys_set_portals_upcall(portals_upcall) @@ -2225,8 +2227,8 @@ def doHost(lustreDB, hosts): for_each_profile(node_db, prof_list, doModules) sys_set_debug_path() - sys_set_ptldebug() - sys_set_subsystem() + sys_set_ptldebug(ptldebug) + sys_set_subsystem(subsystem) script = config.gdb_script run(lctl.lctl, ' modules >', script) if config.gdb: @@ -2335,20 +2337,24 @@ def sys_tweak_socknal (): def sys_optimize_elan (): run ("echo 0 > /proc/elan/config/eventint_punt_loops") -def sys_set_ptldebug(): - if config.ptldebug != None: +def sys_set_ptldebug(ptldebug): + if config.ptldebug: + ptldebug = config.ptldebug + if ptldebug: try: - val = eval(config.ptldebug, ptldebug_names) - val = "0x%x" % (val,) + val = eval(ptldebug, ptldebug_names) + val = "0x%x" % (val) sysctl('portals/debug', val) except NameError, e: panic(str(e)) -def sys_set_subsystem(): - if config.subsystem != None: +def sys_set_subsystem(subsystem): + if config.subsystem: + subsystem = config.subsystem + if subsystem: try: - val = eval(config.subsystem, subsystem_names) - val = "0x%x" % (val,) + val = eval(subsystem, subsystem_names) + val = "0x%x" % (val) sysctl('portals/subsystem_debug', val) except NameError, e: panic(str(e)) diff --git a/lustre/utils/lmc b/lustre/utils/lmc index 62afbbcfd34490201eb709f37f469b3c078f07e9..8e2baf06a18de0fec762eb1f2fee42a9fea792dd 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -55,6 +55,8 @@ Object creation command summary: --upcall path --lustre_upcall path --portals_upcall path + --ptldebug debug_level + --subsystem subsystem_name --add net --node node_name @@ -134,6 +136,8 @@ lmc_options = [ ('upcall', "Set both lustre and portals upcall scripts.", PARAM), ('lustre_upcall', "Set location of lustre upcall script.", PARAM), ('portals_upcall', "Set location of portals upcall script.", PARAM), + ('ptldebug', "Set the portals debug level", PARAM), + ('subsystem', "Specify which Lustre subsystems have debug output recorded in the log", PARAM), # network ('nettype', "Specify the network type. This can be tcp/elan/gm/scimac.", PARAM), @@ -560,6 +564,10 @@ def set_node_options(gen, node, options): gen.addElement(node, 'portalsUpcall', options.portals_upcall) else: gen.addElement(node, 'portalsUpcall', default_upcall) + if options.ptldebug: + gen.addElement(node, "ptldebug", get_option(options, 'ptldebug')) + if options.subsystem: + gen.addElement(node, "subsystem", get_option(options, 'subsystem')) return node def do_add_node(gen, lustre, options, node_name):