diff options
author | Steven Rostedt <srostedt@redhat.com> | 2012-04-05 18:47:56 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2012-04-25 07:28:48 -0400 |
commit | aaf045f72335653b24784d6042be8e4aee114403 (patch) | |
tree | 55c11335e23759e56e0a5ae2daf1c31bb9769662 /tools/perf/builtin-sched.c | |
parent | 668fe01f1cea2154da479dd12946eeb53413396e (diff) |
perf: Have perf use the new libtraceevent.a library
The event parsing code in perf was originally copied from trace-cmd
but never was kept up-to-date with the changes that was done there.
The trace-cmd libtraceevent.a code is much more mature than what is
currently in perf.
This updates the code to use wrappers to handle the calls to the
new event parsing code. The new code requires a handle to be pass
around, which removes the global event variables and allows
more than one event structure to be read from different files
(and different machines).
But perf still has the old global events and the code throughout
perf does not yet have a nice way to pass around a handle.
A global 'pevent' has been made for perf and the old calls have
been created as wrappers to the new event parsing code that uses
the global pevent.
With this change, perf can later incorporate the pevent handle into
the perf structures and allow more than one file to be read and
compared, that contains different events.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r-- | tools/perf/builtin-sched.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 1cad3af4bf4c..b125e07eb399 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -728,34 +728,34 @@ struct trace_migrate_task_event { | |||
728 | struct trace_sched_handler { | 728 | struct trace_sched_handler { |
729 | void (*switch_event)(struct trace_switch_event *, | 729 | void (*switch_event)(struct trace_switch_event *, |
730 | struct machine *, | 730 | struct machine *, |
731 | struct event *, | 731 | struct event_format *, |
732 | int cpu, | 732 | int cpu, |
733 | u64 timestamp, | 733 | u64 timestamp, |
734 | struct thread *thread); | 734 | struct thread *thread); |
735 | 735 | ||
736 | void (*runtime_event)(struct trace_runtime_event *, | 736 | void (*runtime_event)(struct trace_runtime_event *, |
737 | struct machine *, | 737 | struct machine *, |
738 | struct event *, | 738 | struct event_format *, |
739 | int cpu, | 739 | int cpu, |
740 | u64 timestamp, | 740 | u64 timestamp, |
741 | struct thread *thread); | 741 | struct thread *thread); |
742 | 742 | ||
743 | void (*wakeup_event)(struct trace_wakeup_event *, | 743 | void (*wakeup_event)(struct trace_wakeup_event *, |
744 | struct machine *, | 744 | struct machine *, |
745 | struct event *, | 745 | struct event_format *, |
746 | int cpu, | 746 | int cpu, |
747 | u64 timestamp, | 747 | u64 timestamp, |
748 | struct thread *thread); | 748 | struct thread *thread); |
749 | 749 | ||
750 | void (*fork_event)(struct trace_fork_event *, | 750 | void (*fork_event)(struct trace_fork_event *, |
751 | struct event *, | 751 | struct event_format *, |
752 | int cpu, | 752 | int cpu, |
753 | u64 timestamp, | 753 | u64 timestamp, |
754 | struct thread *thread); | 754 | struct thread *thread); |
755 | 755 | ||
756 | void (*migrate_task_event)(struct trace_migrate_task_event *, | 756 | void (*migrate_task_event)(struct trace_migrate_task_event *, |
757 | struct machine *machine, | 757 | struct machine *machine, |
758 | struct event *, | 758 | struct event_format *, |
759 | int cpu, | 759 | int cpu, |
760 | u64 timestamp, | 760 | u64 timestamp, |
761 | struct thread *thread); | 761 | struct thread *thread); |
@@ -765,7 +765,7 @@ struct trace_sched_handler { | |||
765 | static void | 765 | static void |
766 | replay_wakeup_event(struct trace_wakeup_event *wakeup_event, | 766 | replay_wakeup_event(struct trace_wakeup_event *wakeup_event, |
767 | struct machine *machine __used, | 767 | struct machine *machine __used, |
768 | struct event *event, | 768 | struct event_format *event, |
769 | int cpu __used, | 769 | int cpu __used, |
770 | u64 timestamp __used, | 770 | u64 timestamp __used, |
771 | struct thread *thread __used) | 771 | struct thread *thread __used) |
@@ -792,7 +792,7 @@ static u64 cpu_last_switched[MAX_CPUS]; | |||
792 | static void | 792 | static void |
793 | replay_switch_event(struct trace_switch_event *switch_event, | 793 | replay_switch_event(struct trace_switch_event *switch_event, |
794 | struct machine *machine __used, | 794 | struct machine *machine __used, |
795 | struct event *event, | 795 | struct event_format *event, |
796 | int cpu, | 796 | int cpu, |
797 | u64 timestamp, | 797 | u64 timestamp, |
798 | struct thread *thread __used) | 798 | struct thread *thread __used) |
@@ -835,7 +835,7 @@ replay_switch_event(struct trace_switch_event *switch_event, | |||
835 | 835 | ||
836 | static void | 836 | static void |
837 | replay_fork_event(struct trace_fork_event *fork_event, | 837 | replay_fork_event(struct trace_fork_event *fork_event, |
838 | struct event *event, | 838 | struct event_format *event, |
839 | int cpu __used, | 839 | int cpu __used, |
840 | u64 timestamp __used, | 840 | u64 timestamp __used, |
841 | struct thread *thread __used) | 841 | struct thread *thread __used) |
@@ -944,7 +944,7 @@ static void thread_atoms_insert(struct thread *thread) | |||
944 | 944 | ||
945 | static void | 945 | static void |
946 | latency_fork_event(struct trace_fork_event *fork_event __used, | 946 | latency_fork_event(struct trace_fork_event *fork_event __used, |
947 | struct event *event __used, | 947 | struct event_format *event __used, |
948 | int cpu __used, | 948 | int cpu __used, |
949 | u64 timestamp __used, | 949 | u64 timestamp __used, |
950 | struct thread *thread __used) | 950 | struct thread *thread __used) |
@@ -1026,7 +1026,7 @@ add_sched_in_event(struct work_atoms *atoms, u64 timestamp) | |||
1026 | static void | 1026 | static void |
1027 | latency_switch_event(struct trace_switch_event *switch_event, | 1027 | latency_switch_event(struct trace_switch_event *switch_event, |
1028 | struct machine *machine, | 1028 | struct machine *machine, |
1029 | struct event *event __used, | 1029 | struct event_format *event __used, |
1030 | int cpu, | 1030 | int cpu, |
1031 | u64 timestamp, | 1031 | u64 timestamp, |
1032 | struct thread *thread __used) | 1032 | struct thread *thread __used) |
@@ -1079,7 +1079,7 @@ latency_switch_event(struct trace_switch_event *switch_event, | |||
1079 | static void | 1079 | static void |
1080 | latency_runtime_event(struct trace_runtime_event *runtime_event, | 1080 | latency_runtime_event(struct trace_runtime_event *runtime_event, |
1081 | struct machine *machine, | 1081 | struct machine *machine, |
1082 | struct event *event __used, | 1082 | struct event_format *event __used, |
1083 | int cpu, | 1083 | int cpu, |
1084 | u64 timestamp, | 1084 | u64 timestamp, |
1085 | struct thread *this_thread __used) | 1085 | struct thread *this_thread __used) |
@@ -1102,7 +1102,7 @@ latency_runtime_event(struct trace_runtime_event *runtime_event, | |||
1102 | static void | 1102 | static void |
1103 | latency_wakeup_event(struct trace_wakeup_event *wakeup_event, | 1103 | latency_wakeup_event(struct trace_wakeup_event *wakeup_event, |
1104 | struct machine *machine, | 1104 | struct machine *machine, |
1105 | struct event *__event __used, | 1105 | struct event_format *__event __used, |
1106 | int cpu __used, | 1106 | int cpu __used, |
1107 | u64 timestamp, | 1107 | u64 timestamp, |
1108 | struct thread *thread __used) | 1108 | struct thread *thread __used) |
@@ -1150,7 +1150,7 @@ latency_wakeup_event(struct trace_wakeup_event *wakeup_event, | |||
1150 | static void | 1150 | static void |
1151 | latency_migrate_task_event(struct trace_migrate_task_event *migrate_task_event, | 1151 | latency_migrate_task_event(struct trace_migrate_task_event *migrate_task_event, |
1152 | struct machine *machine, | 1152 | struct machine *machine, |
1153 | struct event *__event __used, | 1153 | struct event_format *__event __used, |
1154 | int cpu __used, | 1154 | int cpu __used, |
1155 | u64 timestamp, | 1155 | u64 timestamp, |
1156 | struct thread *thread __used) | 1156 | struct thread *thread __used) |
@@ -1361,7 +1361,7 @@ static struct trace_sched_handler *trace_handler; | |||
1361 | 1361 | ||
1362 | static void | 1362 | static void |
1363 | process_sched_wakeup_event(struct perf_tool *tool __used, | 1363 | process_sched_wakeup_event(struct perf_tool *tool __used, |
1364 | struct event *event, | 1364 | struct event_format *event, |
1365 | struct perf_sample *sample, | 1365 | struct perf_sample *sample, |
1366 | struct machine *machine, | 1366 | struct machine *machine, |
1367 | struct thread *thread) | 1367 | struct thread *thread) |
@@ -1398,7 +1398,7 @@ static char next_shortname2 = '0'; | |||
1398 | static void | 1398 | static void |
1399 | map_switch_event(struct trace_switch_event *switch_event, | 1399 | map_switch_event(struct trace_switch_event *switch_event, |
1400 | struct machine *machine, | 1400 | struct machine *machine, |
1401 | struct event *event __used, | 1401 | struct event_format *event __used, |
1402 | int this_cpu, | 1402 | int this_cpu, |
1403 | u64 timestamp, | 1403 | u64 timestamp, |
1404 | struct thread *thread __used) | 1404 | struct thread *thread __used) |
@@ -1476,7 +1476,7 @@ map_switch_event(struct trace_switch_event *switch_event, | |||
1476 | 1476 | ||
1477 | static void | 1477 | static void |
1478 | process_sched_switch_event(struct perf_tool *tool __used, | 1478 | process_sched_switch_event(struct perf_tool *tool __used, |
1479 | struct event *event, | 1479 | struct event_format *event, |
1480 | struct perf_sample *sample, | 1480 | struct perf_sample *sample, |
1481 | struct machine *machine, | 1481 | struct machine *machine, |
1482 | struct thread *thread) | 1482 | struct thread *thread) |
@@ -1512,7 +1512,7 @@ process_sched_switch_event(struct perf_tool *tool __used, | |||
1512 | 1512 | ||
1513 | static void | 1513 | static void |
1514 | process_sched_runtime_event(struct perf_tool *tool __used, | 1514 | process_sched_runtime_event(struct perf_tool *tool __used, |
1515 | struct event *event, | 1515 | struct event_format *event, |
1516 | struct perf_sample *sample, | 1516 | struct perf_sample *sample, |
1517 | struct machine *machine, | 1517 | struct machine *machine, |
1518 | struct thread *thread) | 1518 | struct thread *thread) |
@@ -1532,7 +1532,7 @@ process_sched_runtime_event(struct perf_tool *tool __used, | |||
1532 | 1532 | ||
1533 | static void | 1533 | static void |
1534 | process_sched_fork_event(struct perf_tool *tool __used, | 1534 | process_sched_fork_event(struct perf_tool *tool __used, |
1535 | struct event *event, | 1535 | struct event_format *event, |
1536 | struct perf_sample *sample, | 1536 | struct perf_sample *sample, |
1537 | struct machine *machine __used, | 1537 | struct machine *machine __used, |
1538 | struct thread *thread) | 1538 | struct thread *thread) |
@@ -1554,7 +1554,7 @@ process_sched_fork_event(struct perf_tool *tool __used, | |||
1554 | 1554 | ||
1555 | static void | 1555 | static void |
1556 | process_sched_exit_event(struct perf_tool *tool __used, | 1556 | process_sched_exit_event(struct perf_tool *tool __used, |
1557 | struct event *event, | 1557 | struct event_format *event, |
1558 | struct perf_sample *sample __used, | 1558 | struct perf_sample *sample __used, |
1559 | struct machine *machine __used, | 1559 | struct machine *machine __used, |
1560 | struct thread *thread __used) | 1560 | struct thread *thread __used) |
@@ -1565,7 +1565,7 @@ process_sched_exit_event(struct perf_tool *tool __used, | |||
1565 | 1565 | ||
1566 | static void | 1566 | static void |
1567 | process_sched_migrate_task_event(struct perf_tool *tool __used, | 1567 | process_sched_migrate_task_event(struct perf_tool *tool __used, |
1568 | struct event *event, | 1568 | struct event_format *event, |
1569 | struct perf_sample *sample, | 1569 | struct perf_sample *sample, |
1570 | struct machine *machine, | 1570 | struct machine *machine, |
1571 | struct thread *thread) | 1571 | struct thread *thread) |
@@ -1586,7 +1586,7 @@ process_sched_migrate_task_event(struct perf_tool *tool __used, | |||
1586 | sample->time, thread); | 1586 | sample->time, thread); |
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | typedef void (*tracepoint_handler)(struct perf_tool *tool, struct event *event, | 1589 | typedef void (*tracepoint_handler)(struct perf_tool *tool, struct event_format *event, |
1590 | struct perf_sample *sample, | 1590 | struct perf_sample *sample, |
1591 | struct machine *machine, | 1591 | struct machine *machine, |
1592 | struct thread *thread); | 1592 | struct thread *thread); |