def split_trace_event_line(line):
    """
    Split a trace-cmd event line into the preamble (containing the task, cpu id
    and timestamp), the event name, and the event body. Each of these is
    delimited by a ': ' (optionally followed by more whitespace), however ': '
    may also appear in the body of the event and in the thread name. This
    attempts to identify the correct split by ensureing the there is a '['
    (used to mark the cpu id and not a valid character for a task name) in the
    peramble.

    """
    parts = line.split(': ')
    if len(parts) <= 3:
        return parts

    preamble = parts.pop(0)
    while '[' not in preamble:
        preamble += ': ' + parts.pop(0)
    event_name = parts.pop(0)
    return (preamble, event_name, ': '.join(parts))