aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/check-perf-trace.py
Commit message (Collapse)AuthorAge
* perf script: Finish the rename from trace to scriptArnaldo Carvalho de Melo2010-12-25
| | | | | | | | | | | | | | | | | | The scripts have calls to 'perf trace' that need to be converted to 'perf script', do it. This problem was introduced in 133dc4c. Reported-by: Torok Edwin <edwintorok@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Torok Edwin <edwintorok@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf scripts python: Give field dict to unhandled callbackPierre Tardy2010-06-01
| | | | | | | | | | | | | | | | | | | trace_unhandled() callback does not allow to access event fields, this patch resolves the problem. It can also been used as a more pythonic and flexible way for script writters to demux event types This will for example greatly simplify pytimechart event demux. Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Tom Zanussi <tzanussi@gmail.com> Cc: Ingo Molnar <mingo@elte.hu>, Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <1275340329-2397-1-git-send-email-tardyp@gmail.com> Signed-off-by: Pierre Tardy <tardyp@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf/scripts: Add syscall tracing scriptsTom Zanussi2010-02-24
Adds a set of scripts that aggregate system call totals and system call errors. Most are Python scripts that also test basic functionality of the new Python engine, but there's also one Perl script added for comparison and for reference in some new Documentation contained in a later patch. Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Keiichi KII <k-keiichi@bx.jp.nec.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <1264580883-15324-8-git-send-email-tzanussi@gmail.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
pan class="hl opt">() for t in tasks] by_util.sort(reverse=True) by_cost = [t.cost for t in tasks] by_cost.sort(reverse=True) Lambda = int(ceil(U)) - 1 emin = by_cost[-1] reduced_capacity = no_cpus - sum(by_util[0:Lambda - 1]) if reduced_capacity <= 0: # bad: tardiness is not bounded return None reduced_cost = max(0, sum(by_cost[0:Lambda]) - emin) return int(ceil(reduced_cost / reduced_capacity)) def np_tardiness_x(no_cpus, tasks): """This function computes the X part of Uma Devi's G-EDF tardiness bound, as given in Corollary 4.3 in Uma's thesis, page 110. """ if not tasks: return 0 U = tasks.utilization() # by_util is mu in Uma's theorem by_util = [t.utilization() for t in tasks] by_util.sort(reverse=True) # by_cost is epsilon in Uma's theorem by_cost = [t.cost for t in tasks] by_cost.sort(reverse=True) Lambda = int(ceil(U)) - 1 emin = by_cost[-1] reduced_capacity = no_cpus - sum(by_util[0:Lambda - 1]) if reduced_capacity <= 0: # bad: tardiness is not bounded return None block_idx = no_cpus - Lambda - 1 reduced_cost = sum(by_cost[0:Lambda]) + sum(by_cost[0:block_idx]) - emin return int(ceil(reduced_cost / reduced_capacity)) def task_tardiness_bound(no_cpus, tasks, preemptive=True): x = 0 # first check if the bound formulas are valid if not has_bounded_tardiness(no_cpus, tasks): return None if no_cpus > 1: if preemptive: x = tardiness_x(no_cpus, tasks) else: x = np_tardiness_x(no_cpus, tasks) else: x = 0 return x def has_bounded_tardiness(no_cpus, tasks): return tasks.utilization() <= no_cpus and \ forall(tasks)(lambda t: t.period >= t.cost) def bound_response_times(no_cpus, tasks, preemptive=True): # DA's work applies to implicit-deadline tasks assert forall(tasks)(lambda t: t.implicit_deadline()) x = task_tardiness_bound(no_cpus, tasks, preemptive) if x is None: return False else: for t in tasks: t.response_time = t.deadline + t.cost + x return True