Commit ec156764 authored by Ingo Molnar's avatar Ingo Molnar

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: default avatarIngo Molnar <mingo@elte.hu>
parent 0a02ad93
This diff is collapsed.
...@@ -1799,7 +1799,7 @@ static int get_common_info(const char *type, int *offset, int *size) ...@@ -1799,7 +1799,7 @@ static int get_common_info(const char *type, int *offset, int *size)
return 0; return 0;
} }
static int parse_common_type(void *data) int trace_parse_common_type(void *data)
{ {
static int type_offset; static int type_offset;
static int type_size; static int type_size;
...@@ -1832,7 +1832,7 @@ static int parse_common_pid(void *data) ...@@ -1832,7 +1832,7 @@ static int parse_common_pid(void *data)
return read_size(data + pid_offset, pid_size); return read_size(data + pid_offset, pid_size);
} }
static struct event *find_event(int id) struct event *trace_find_event(int id)
{ {
struct event *event; struct event *event;
...@@ -2420,8 +2420,8 @@ get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func, ...@@ -2420,8 +2420,8 @@ get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func,
int type; int type;
int pid; int pid;
type = parse_common_type(next->data); type = trace_parse_common_type(next->data);
event = find_event(type); event = trace_find_event(type);
if (!event) if (!event)
return NULL; return NULL;
...@@ -2502,8 +2502,8 @@ print_graph_entry_leaf(struct event *event, void *data, struct record *ret_rec) ...@@ -2502,8 +2502,8 @@ print_graph_entry_leaf(struct event *event, void *data, struct record *ret_rec)
int type; int type;
int i; int i;
type = parse_common_type(ret_rec->data); type = trace_parse_common_type(ret_rec->data);
ret_event = find_event(type); ret_event = trace_find_event(type);
field = find_field(ret_event, "rettime"); field = find_field(ret_event, "rettime");
if (!field) if (!field)
...@@ -2696,9 +2696,9 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs, ...@@ -2696,9 +2696,9 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs,
nsecs -= secs * NSECS_PER_SEC; nsecs -= secs * NSECS_PER_SEC;
usecs = nsecs / NSECS_PER_USEC; usecs = nsecs / NSECS_PER_USEC;
type = parse_common_type(data); type = trace_parse_common_type(data);
event = find_event(type); event = trace_find_event(type);
if (!event) if (!event)
die("ug! no event found for type %d", type); die("ug! no event found for type %d", type);
......
...@@ -234,6 +234,8 @@ extern int header_page_data_offset; ...@@ -234,6 +234,8 @@ extern int header_page_data_offset;
extern int header_page_data_size; extern int header_page_data_size;
int parse_header_page(char *buf, unsigned long size); int parse_header_page(char *buf, unsigned long size);
int trace_parse_common_type(void *data);
struct event *trace_find_event(int id);
void read_tracing_data(struct perf_counter_attr *pattrs, int nb_counters); void read_tracing_data(struct perf_counter_attr *pattrs, int nb_counters);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment