'Dump tracemalloc snapshot'

def cmd_tracemalloc_dump(self):

    if (not tracemalloc):
        logger.warning('No    tracemalloc    module')
        raise command.CommandError('No    tracemalloc    module')
    if (not tracemalloc.is_tracing()):
        return [False, 'Trace    not    started']
    cache_directory = get_cache_dir()
    malloc_dump = os.path.join(cache_directory, 'qtile_tracemalloc.dump')
    tracemalloc.take_snapshot().dump(malloc_dump)
    return [True, malloc_dump]
