aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-09-11 06:12:54 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-13 04:22:37 -0400
commitec156764d424dd67283c2cd5e9f6f1b8388364ac (patch)
treec7c4e20d64f70cfd2167c73963e2437dee4c3d53 /tools/perf/util
parent0a02ad9331dd4db56c29c60db2e99c4daaad8a48 (diff)
perf sched: Import schedbench.c
Import the schedbench.c tool that i wrote some time ago to simulate scheduler behavior but never finished. It's a good basis for perf sched nevertheless. Most of its guts are not hooked up to the perf event loop yet - that will be done in the patches to come. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/trace-event-parse.c16
-rw-r--r--tools/perf/util/trace-event.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 629e602d9405..16cf2d51c4e1 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1799,7 +1799,7 @@ static int get_common_info(const char *type, int *offset, int *size)
1799 return 0; 1799 return 0;
1800} 1800}
1801 1801
1802static int parse_common_type(void *data) 1802int trace_parse_common_type(void *data)
1803{ 1803{
1804 static int type_offset; 1804 static int type_offset;
1805 static int type_size; 1805 static int type_size;
@@ -1832,7 +1832,7 @@ static int parse_common_pid(void *data)
1832 return read_size(data + pid_offset, pid_size); 1832 return read_size(data + pid_offset, pid_size);
1833} 1833}
1834 1834
1835static struct event *find_event(int id) 1835struct event *trace_find_event(int id)
1836{ 1836{
1837 struct event *event; 1837 struct event *event;
1838 1838
@@ -2420,8 +2420,8 @@ get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func,
2420 int type; 2420 int type;
2421 int pid; 2421 int pid;
2422 2422
2423 type = parse_common_type(next->data); 2423 type = trace_parse_common_type(next->data);
2424 event = find_event(type); 2424 event = trace_find_event(type);
2425 if (!event) 2425 if (!event)
2426 return NULL; 2426 return NULL;
2427 2427
@@ -2502,8 +2502,8 @@ print_graph_entry_leaf(struct event *event, void *data, struct record *ret_rec)
2502 int type; 2502 int type;
2503 int i; 2503 int i;
2504 2504
2505 type = parse_common_type(ret_rec->data); 2505 type = trace_parse_common_type(ret_rec->data);
2506 ret_event = find_event(type); 2506 ret_event = trace_find_event(type);
2507 2507
2508 field = find_field(ret_event, "rettime"); 2508 field = find_field(ret_event, "rettime");
2509 if (!field) 2509 if (!field)
@@ -2696,9 +2696,9 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs,
2696 nsecs -= secs * NSECS_PER_SEC; 2696 nsecs -= secs * NSECS_PER_SEC;
2697 usecs = nsecs / NSECS_PER_USEC; 2697 usecs = nsecs / NSECS_PER_USEC;
2698 2698
2699 type = parse_common_type(data); 2699 type = trace_parse_common_type(data);
2700 2700
2701 event = find_event(type); 2701 event = trace_find_event(type);
2702 if (!event) 2702 if (!event)
2703 die("ug! no event found for type %d", type); 2703 die("ug! no event found for type %d", type);
2704 2704
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index 420294a5773e..bc81612fd244 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -234,6 +234,8 @@ extern int header_page_data_offset;
234extern int header_page_data_size; 234extern int header_page_data_size;
235 235
236int parse_header_page(char *buf, unsigned long size); 236int parse_header_page(char *buf, unsigned long size);
237int trace_parse_common_type(void *data);
238struct event *trace_find_event(int id);
237 239
238void read_tracing_data(struct perf_counter_attr *pattrs, int nb_counters); 240void read_tracing_data(struct perf_counter_attr *pattrs, int nb_counters);
239 241