Exemplo n.º 1
0
def plot_trace(trace, execnames=None, pids=None):
    """Creates a kernelshark like plot of the trace file

    :param trace: The path to the trace or a trace object
    :type trace: str, :mod:`trappy.trace.FTrace`, :mod:`trappy.trace.SysTrace`
        or :mod:`trappy.trace.BareTrace`.

    :param execnames: List of execnames to be filtered. If not
        specified all execnames will be plotted
    :type execnames: list, str

    :param pids: List of pids to be filtered. If not specified
        all pids will be plotted
    :type pids: list, str
    """

    if not IPythonConf.check_ipython():
        raise RuntimeError("plot_trace needs ipython environment")

    if not isinstance(trace, trappy.BareTrace):
        if trace.endswith("html"):
            trace = trappy.SysTrace(trace)
        else:
            trace = trappy.FTrace(trace)

    data, procs, domain = Utils.get_trace_event_data(trace, execnames, pids)
    trace_graph = EventPlot.EventPlot(data,
                                      procs,
                                      domain,
                                      lane_prefix="CPU :",
                                      num_lanes=int(trace._cpus))
    trace_graph.view()
Exemplo n.º 2
0
def plot_trace(trace_dir, execnames=None, pids=None):
    """Creates a kernelshark like plot of the trace file

    :param trace_dir: The location of the trace file
    :type trace_dir: str

    :param pids: List of execnames to be filtered. If not
        specified all execnames will be plotted
    :type execnames: list, str

    :param pids: List of pids to be filtered. If not specified
        all pids will be plotted
    :type pids: list, str
    """

    if not IPythonConf.check_ipython():
        raise RuntimeError("plot_trace needs ipython environment")

    run = trappy.Run(trace_dir)
    data, procs, domain = Utils.get_trace_event_data(run, execnames, pids)
    trace_graph = EventPlot.EventPlot(data,
                                      procs,
                                      domain,
                                      lane_prefix="CPU :",
                                      num_lanes=int(run._cpus))
    trace_graph.view()
Exemplo n.º 3
0
def plot_trace(trace,
               execnames=None,
               pids=None):
    """Creates a kernelshark like plot of the trace file

    :param trace: The path to the trace or a run object
    :type trace: str, :mod:`trappy.run.Run`

    :param execnames: List of execnames to be filtered. If not
        specified all execnames will be plotted
    :type execnames: list, str

    :param pids: List of pids to be filtered. If not specified
        all pids will be plotted
    :type pids: list, str
    """

    if not IPythonConf.check_ipython():
        raise RuntimeError("plot_trace needs ipython environment")

    if not isinstance(trace, trappy.Run):
        run = trappy.Run(trace)
    else:
        run = trace

    data, procs, domain = Utils.get_trace_event_data(run, execnames, pids)
    trace_graph = EventPlot.EventPlot(data, procs, domain,
                                      lane_prefix="CPU :",
                                      num_lanes=int(run._cpus))
    trace_graph.view()
Exemplo n.º 4
0
def plot_trace(trace_dir,
               execnames=None,
               pids=None):
    """Creates a kernelshark like plot of the trace file

    :param trace_dir: The location of the trace file
    :type trace_dir: str

    :param pids: List of execnames to be filtered. If not
        specified all execnames will be plotted
    :type execnames: list, str

    :param pids: List of pids to be filtered. If not specified
        all pids will be plotted
    :type pids: list, str
    """

    if not IPythonConf.check_ipython():
        raise RuntimeError("plot_trace needs ipython environment")

    run = trappy.Run(trace_dir)
    data, procs, domain = Utils.get_trace_event_data(run, execnames, pids)
    trace_graph = EventPlot.EventPlot(data, procs, domain,
                                      lane_prefix="CPU :",
                                      num_lanes=int(run._cpus))
    trace_graph.view()