def run_alloc_analysis(trace, threshold):
    """
    Plot the runtime of buffer allocator.

    :param trace: input Trace object
    :type trace: :mod:`libs.utils.Trace`

    :param threshold: plot allocations took less than threshold
    :type threshold: int
    """
    df = trace.data_frame.alloc_df()
    trace.analysis.binder_transaction.plot_samples(df, "delta_t",
                                                   "transaction samples",
                                                   "alloc time (microseconds)",
                                                   ymax=threshold)
    return df