import re


def parse_kernel_monitor(output):
    """Parse the thread monitor output and return the parsed data as a
    dictionary with thread names as keys.

    """

    re_thread = re.compile(r'(.*)\s+([\d\.]+)')

    threads = {}

    for line in output.splitlines():
        mo = re_thread.match(line)

        if mo:
            name = mo.group(1).strip()
            threads[name] = float(mo.group(2))

    return threads