diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-16 20:06:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-16 20:06:21 -0400 |
commit | 772c1d06bd402f7ee72c61a18c2db74cd74b6758 (patch) | |
tree | e362fc7e158b3580d810a26189ecf91ec8a4f141 /tools/perf/builtin-sched.c | |
parent | c7eba51cfdf9cd1ca7ed4201b30be8b2bef15ff5 (diff) | |
parent | e336b4027775cb458dc713745e526fa1a1996b2a (diff) |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar:
"Kernel side changes:
- Improved kbprobes robustness
- Intel PEBS support for PT hardware tracing
- Other Intel PT improvements: high order pages memory footprint
reduction and various related cleanups
- Misc cleanups
The perf tooling side has been very busy in this cycle, with over 300
commits. This is an incomplete high-level summary of the many
improvements done by over 30 developers:
- Lots of updates to the following tools:
'perf c2c'
'perf config'
'perf record'
'perf report'
'perf script'
'perf test'
'perf top'
'perf trace'
- Updates to libperf and libtraceevent, and a consolidation of the
proliferation of x86 instruction decoder libraries.
- Vendor event updates for Intel and PowerPC CPUs,
- Updates to hardware tracing tooling for ARM and Intel CPUs,
- ... and lots of other changes and cleanups - see the shortlog and
Git log for details"
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (322 commits)
kprobes: Prohibit probing on BUG() and WARN() address
perf/x86: Make more stuff static
x86, perf: Fix the dependency of the x86 insn decoder selftest
objtool: Ignore intentional differences for the x86 insn decoder
objtool: Update sync-check.sh from perf's check-headers.sh
perf build: Ignore intentional differences for the x86 insn decoder
perf intel-pt: Use shared x86 insn decoder
perf intel-pt: Remove inat.c from build dependency list
perf: Update .gitignore file
objtool: Move x86 insn decoder to a common location
perf metricgroup: Support multiple events for metricgroup
perf metricgroup: Scale the metric result
perf pmu: Change convert_scale from static to global
perf symbols: Move mem_info and branch_info out of symbol.h
perf auxtrace: Uninline functions that touch perf_session
perf tools: Remove needless evlist.h include directives
perf tools: Remove needless evlist.h include directives
perf tools: Remove needless thread_map.h include directives
perf tools: Remove needless thread.h include directives
perf tools: Remove needless map.h include directives
...
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r-- | tools/perf/builtin-sched.c | 101 |
1 files changed, 51 insertions, 50 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 56d1907b1215..ec96d64aec69 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1,9 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "builtin.h" | 2 | #include "builtin.h" |
3 | #include "perf.h" | 3 | #include "perf.h" |
4 | #include "perf-sys.h" | ||
4 | 5 | ||
5 | #include "util/evlist.h" | 6 | #include "util/evlist.h" |
6 | #include "util/cache.h" | ||
7 | #include "util/evsel.h" | 7 | #include "util/evsel.h" |
8 | #include "util/symbol.h" | 8 | #include "util/symbol.h" |
9 | #include "util/thread.h" | 9 | #include "util/thread.h" |
@@ -18,6 +18,7 @@ | |||
18 | #include "util/callchain.h" | 18 | #include "util/callchain.h" |
19 | #include "util/time-utils.h" | 19 | #include "util/time-utils.h" |
20 | 20 | ||
21 | #include <subcmd/pager.h> | ||
21 | #include <subcmd/parse-options.h> | 22 | #include <subcmd/parse-options.h> |
22 | #include "util/trace-event.h" | 23 | #include "util/trace-event.h" |
23 | 24 | ||
@@ -133,13 +134,13 @@ typedef int (*sort_fn_t)(struct work_atoms *, struct work_atoms *); | |||
133 | struct perf_sched; | 134 | struct perf_sched; |
134 | 135 | ||
135 | struct trace_sched_handler { | 136 | struct trace_sched_handler { |
136 | int (*switch_event)(struct perf_sched *sched, struct perf_evsel *evsel, | 137 | int (*switch_event)(struct perf_sched *sched, struct evsel *evsel, |
137 | struct perf_sample *sample, struct machine *machine); | 138 | struct perf_sample *sample, struct machine *machine); |
138 | 139 | ||
139 | int (*runtime_event)(struct perf_sched *sched, struct perf_evsel *evsel, | 140 | int (*runtime_event)(struct perf_sched *sched, struct evsel *evsel, |
140 | struct perf_sample *sample, struct machine *machine); | 141 | struct perf_sample *sample, struct machine *machine); |
141 | 142 | ||
142 | int (*wakeup_event)(struct perf_sched *sched, struct perf_evsel *evsel, | 143 | int (*wakeup_event)(struct perf_sched *sched, struct evsel *evsel, |
143 | struct perf_sample *sample, struct machine *machine); | 144 | struct perf_sample *sample, struct machine *machine); |
144 | 145 | ||
145 | /* PERF_RECORD_FORK event, not sched_process_fork tracepoint */ | 146 | /* PERF_RECORD_FORK event, not sched_process_fork tracepoint */ |
@@ -147,7 +148,7 @@ struct trace_sched_handler { | |||
147 | struct machine *machine); | 148 | struct machine *machine); |
148 | 149 | ||
149 | int (*migrate_task_event)(struct perf_sched *sched, | 150 | int (*migrate_task_event)(struct perf_sched *sched, |
150 | struct perf_evsel *evsel, | 151 | struct evsel *evsel, |
151 | struct perf_sample *sample, | 152 | struct perf_sample *sample, |
152 | struct machine *machine); | 153 | struct machine *machine); |
153 | }; | 154 | }; |
@@ -159,11 +160,11 @@ struct perf_sched_map { | |||
159 | DECLARE_BITMAP(comp_cpus_mask, MAX_CPUS); | 160 | DECLARE_BITMAP(comp_cpus_mask, MAX_CPUS); |
160 | int *comp_cpus; | 161 | int *comp_cpus; |
161 | bool comp; | 162 | bool comp; |
162 | struct thread_map *color_pids; | 163 | struct perf_thread_map *color_pids; |
163 | const char *color_pids_str; | 164 | const char *color_pids_str; |
164 | struct cpu_map *color_cpus; | 165 | struct perf_cpu_map *color_cpus; |
165 | const char *color_cpus_str; | 166 | const char *color_cpus_str; |
166 | struct cpu_map *cpus; | 167 | struct perf_cpu_map *cpus; |
167 | const char *cpus_str; | 168 | const char *cpus_str; |
168 | }; | 169 | }; |
169 | 170 | ||
@@ -799,7 +800,7 @@ static void test_calibrations(struct perf_sched *sched) | |||
799 | 800 | ||
800 | static int | 801 | static int |
801 | replay_wakeup_event(struct perf_sched *sched, | 802 | replay_wakeup_event(struct perf_sched *sched, |
802 | struct perf_evsel *evsel, struct perf_sample *sample, | 803 | struct evsel *evsel, struct perf_sample *sample, |
803 | struct machine *machine __maybe_unused) | 804 | struct machine *machine __maybe_unused) |
804 | { | 805 | { |
805 | const char *comm = perf_evsel__strval(evsel, sample, "comm"); | 806 | const char *comm = perf_evsel__strval(evsel, sample, "comm"); |
@@ -820,7 +821,7 @@ replay_wakeup_event(struct perf_sched *sched, | |||
820 | } | 821 | } |
821 | 822 | ||
822 | static int replay_switch_event(struct perf_sched *sched, | 823 | static int replay_switch_event(struct perf_sched *sched, |
823 | struct perf_evsel *evsel, | 824 | struct evsel *evsel, |
824 | struct perf_sample *sample, | 825 | struct perf_sample *sample, |
825 | struct machine *machine __maybe_unused) | 826 | struct machine *machine __maybe_unused) |
826 | { | 827 | { |
@@ -1093,7 +1094,7 @@ add_sched_in_event(struct work_atoms *atoms, u64 timestamp) | |||
1093 | } | 1094 | } |
1094 | 1095 | ||
1095 | static int latency_switch_event(struct perf_sched *sched, | 1096 | static int latency_switch_event(struct perf_sched *sched, |
1096 | struct perf_evsel *evsel, | 1097 | struct evsel *evsel, |
1097 | struct perf_sample *sample, | 1098 | struct perf_sample *sample, |
1098 | struct machine *machine) | 1099 | struct machine *machine) |
1099 | { | 1100 | { |
@@ -1163,7 +1164,7 @@ out_put: | |||
1163 | } | 1164 | } |
1164 | 1165 | ||
1165 | static int latency_runtime_event(struct perf_sched *sched, | 1166 | static int latency_runtime_event(struct perf_sched *sched, |
1166 | struct perf_evsel *evsel, | 1167 | struct evsel *evsel, |
1167 | struct perf_sample *sample, | 1168 | struct perf_sample *sample, |
1168 | struct machine *machine) | 1169 | struct machine *machine) |
1169 | { | 1170 | { |
@@ -1198,7 +1199,7 @@ out_put: | |||
1198 | } | 1199 | } |
1199 | 1200 | ||
1200 | static int latency_wakeup_event(struct perf_sched *sched, | 1201 | static int latency_wakeup_event(struct perf_sched *sched, |
1201 | struct perf_evsel *evsel, | 1202 | struct evsel *evsel, |
1202 | struct perf_sample *sample, | 1203 | struct perf_sample *sample, |
1203 | struct machine *machine) | 1204 | struct machine *machine) |
1204 | { | 1205 | { |
@@ -1259,7 +1260,7 @@ out_put: | |||
1259 | } | 1260 | } |
1260 | 1261 | ||
1261 | static int latency_migrate_task_event(struct perf_sched *sched, | 1262 | static int latency_migrate_task_event(struct perf_sched *sched, |
1262 | struct perf_evsel *evsel, | 1263 | struct evsel *evsel, |
1263 | struct perf_sample *sample, | 1264 | struct perf_sample *sample, |
1264 | struct machine *machine) | 1265 | struct machine *machine) |
1265 | { | 1266 | { |
@@ -1470,7 +1471,7 @@ again: | |||
1470 | } | 1471 | } |
1471 | 1472 | ||
1472 | static int process_sched_wakeup_event(struct perf_tool *tool, | 1473 | static int process_sched_wakeup_event(struct perf_tool *tool, |
1473 | struct perf_evsel *evsel, | 1474 | struct evsel *evsel, |
1474 | struct perf_sample *sample, | 1475 | struct perf_sample *sample, |
1475 | struct machine *machine) | 1476 | struct machine *machine) |
1476 | { | 1477 | { |
@@ -1514,7 +1515,7 @@ map__findnew_thread(struct perf_sched *sched, struct machine *machine, pid_t pid | |||
1514 | return thread; | 1515 | return thread; |
1515 | } | 1516 | } |
1516 | 1517 | ||
1517 | static int map_switch_event(struct perf_sched *sched, struct perf_evsel *evsel, | 1518 | static int map_switch_event(struct perf_sched *sched, struct evsel *evsel, |
1518 | struct perf_sample *sample, struct machine *machine) | 1519 | struct perf_sample *sample, struct machine *machine) |
1519 | { | 1520 | { |
1520 | const u32 next_pid = perf_evsel__intval(evsel, sample, "next_pid"); | 1521 | const u32 next_pid = perf_evsel__intval(evsel, sample, "next_pid"); |
@@ -1655,7 +1656,7 @@ out: | |||
1655 | } | 1656 | } |
1656 | 1657 | ||
1657 | static int process_sched_switch_event(struct perf_tool *tool, | 1658 | static int process_sched_switch_event(struct perf_tool *tool, |
1658 | struct perf_evsel *evsel, | 1659 | struct evsel *evsel, |
1659 | struct perf_sample *sample, | 1660 | struct perf_sample *sample, |
1660 | struct machine *machine) | 1661 | struct machine *machine) |
1661 | { | 1662 | { |
@@ -1681,7 +1682,7 @@ static int process_sched_switch_event(struct perf_tool *tool, | |||
1681 | } | 1682 | } |
1682 | 1683 | ||
1683 | static int process_sched_runtime_event(struct perf_tool *tool, | 1684 | static int process_sched_runtime_event(struct perf_tool *tool, |
1684 | struct perf_evsel *evsel, | 1685 | struct evsel *evsel, |
1685 | struct perf_sample *sample, | 1686 | struct perf_sample *sample, |
1686 | struct machine *machine) | 1687 | struct machine *machine) |
1687 | { | 1688 | { |
@@ -1711,7 +1712,7 @@ static int perf_sched__process_fork_event(struct perf_tool *tool, | |||
1711 | } | 1712 | } |
1712 | 1713 | ||
1713 | static int process_sched_migrate_task_event(struct perf_tool *tool, | 1714 | static int process_sched_migrate_task_event(struct perf_tool *tool, |
1714 | struct perf_evsel *evsel, | 1715 | struct evsel *evsel, |
1715 | struct perf_sample *sample, | 1716 | struct perf_sample *sample, |
1716 | struct machine *machine) | 1717 | struct machine *machine) |
1717 | { | 1718 | { |
@@ -1724,14 +1725,14 @@ static int process_sched_migrate_task_event(struct perf_tool *tool, | |||
1724 | } | 1725 | } |
1725 | 1726 | ||
1726 | typedef int (*tracepoint_handler)(struct perf_tool *tool, | 1727 | typedef int (*tracepoint_handler)(struct perf_tool *tool, |
1727 | struct perf_evsel *evsel, | 1728 | struct evsel *evsel, |
1728 | struct perf_sample *sample, | 1729 | struct perf_sample *sample, |
1729 | struct machine *machine); | 1730 | struct machine *machine); |
1730 | 1731 | ||
1731 | static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_unused, | 1732 | static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_unused, |
1732 | union perf_event *event __maybe_unused, | 1733 | union perf_event *event __maybe_unused, |
1733 | struct perf_sample *sample, | 1734 | struct perf_sample *sample, |
1734 | struct perf_evsel *evsel, | 1735 | struct evsel *evsel, |
1735 | struct machine *machine) | 1736 | struct machine *machine) |
1736 | { | 1737 | { |
1737 | int err = 0; | 1738 | int err = 0; |
@@ -1777,7 +1778,7 @@ static int perf_sched__process_comm(struct perf_tool *tool __maybe_unused, | |||
1777 | 1778 | ||
1778 | static int perf_sched__read_events(struct perf_sched *sched) | 1779 | static int perf_sched__read_events(struct perf_sched *sched) |
1779 | { | 1780 | { |
1780 | const struct perf_evsel_str_handler handlers[] = { | 1781 | const struct evsel_str_handler handlers[] = { |
1781 | { "sched:sched_switch", process_sched_switch_event, }, | 1782 | { "sched:sched_switch", process_sched_switch_event, }, |
1782 | { "sched:sched_stat_runtime", process_sched_runtime_event, }, | 1783 | { "sched:sched_stat_runtime", process_sched_runtime_event, }, |
1783 | { "sched:sched_wakeup", process_sched_wakeup_event, }, | 1784 | { "sched:sched_wakeup", process_sched_wakeup_event, }, |
@@ -1839,7 +1840,7 @@ static inline void print_sched_time(unsigned long long nsecs, int width) | |||
1839 | * returns runtime data for event, allocating memory for it the | 1840 | * returns runtime data for event, allocating memory for it the |
1840 | * first time it is used. | 1841 | * first time it is used. |
1841 | */ | 1842 | */ |
1842 | static struct evsel_runtime *perf_evsel__get_runtime(struct perf_evsel *evsel) | 1843 | static struct evsel_runtime *perf_evsel__get_runtime(struct evsel *evsel) |
1843 | { | 1844 | { |
1844 | struct evsel_runtime *r = evsel->priv; | 1845 | struct evsel_runtime *r = evsel->priv; |
1845 | 1846 | ||
@@ -1854,7 +1855,7 @@ static struct evsel_runtime *perf_evsel__get_runtime(struct perf_evsel *evsel) | |||
1854 | /* | 1855 | /* |
1855 | * save last time event was seen per cpu | 1856 | * save last time event was seen per cpu |
1856 | */ | 1857 | */ |
1857 | static void perf_evsel__save_time(struct perf_evsel *evsel, | 1858 | static void perf_evsel__save_time(struct evsel *evsel, |
1858 | u64 timestamp, u32 cpu) | 1859 | u64 timestamp, u32 cpu) |
1859 | { | 1860 | { |
1860 | struct evsel_runtime *r = perf_evsel__get_runtime(evsel); | 1861 | struct evsel_runtime *r = perf_evsel__get_runtime(evsel); |
@@ -1881,7 +1882,7 @@ static void perf_evsel__save_time(struct perf_evsel *evsel, | |||
1881 | } | 1882 | } |
1882 | 1883 | ||
1883 | /* returns last time this event was seen on the given cpu */ | 1884 | /* returns last time this event was seen on the given cpu */ |
1884 | static u64 perf_evsel__get_time(struct perf_evsel *evsel, u32 cpu) | 1885 | static u64 perf_evsel__get_time(struct evsel *evsel, u32 cpu) |
1885 | { | 1886 | { |
1886 | struct evsel_runtime *r = perf_evsel__get_runtime(evsel); | 1887 | struct evsel_runtime *r = perf_evsel__get_runtime(evsel); |
1887 | 1888 | ||
@@ -1988,7 +1989,7 @@ static char task_state_char(struct thread *thread, int state) | |||
1988 | } | 1989 | } |
1989 | 1990 | ||
1990 | static void timehist_print_sample(struct perf_sched *sched, | 1991 | static void timehist_print_sample(struct perf_sched *sched, |
1991 | struct perf_evsel *evsel, | 1992 | struct evsel *evsel, |
1992 | struct perf_sample *sample, | 1993 | struct perf_sample *sample, |
1993 | struct addr_location *al, | 1994 | struct addr_location *al, |
1994 | struct thread *thread, | 1995 | struct thread *thread, |
@@ -2121,7 +2122,7 @@ static void timehist_update_runtime_stats(struct thread_runtime *r, | |||
2121 | } | 2122 | } |
2122 | 2123 | ||
2123 | static bool is_idle_sample(struct perf_sample *sample, | 2124 | static bool is_idle_sample(struct perf_sample *sample, |
2124 | struct perf_evsel *evsel) | 2125 | struct evsel *evsel) |
2125 | { | 2126 | { |
2126 | /* pid 0 == swapper == idle task */ | 2127 | /* pid 0 == swapper == idle task */ |
2127 | if (strcmp(perf_evsel__name(evsel), "sched:sched_switch") == 0) | 2128 | if (strcmp(perf_evsel__name(evsel), "sched:sched_switch") == 0) |
@@ -2132,7 +2133,7 @@ static bool is_idle_sample(struct perf_sample *sample, | |||
2132 | 2133 | ||
2133 | static void save_task_callchain(struct perf_sched *sched, | 2134 | static void save_task_callchain(struct perf_sched *sched, |
2134 | struct perf_sample *sample, | 2135 | struct perf_sample *sample, |
2135 | struct perf_evsel *evsel, | 2136 | struct evsel *evsel, |
2136 | struct machine *machine) | 2137 | struct machine *machine) |
2137 | { | 2138 | { |
2138 | struct callchain_cursor *cursor = &callchain_cursor; | 2139 | struct callchain_cursor *cursor = &callchain_cursor; |
@@ -2286,7 +2287,7 @@ static void save_idle_callchain(struct perf_sched *sched, | |||
2286 | static struct thread *timehist_get_thread(struct perf_sched *sched, | 2287 | static struct thread *timehist_get_thread(struct perf_sched *sched, |
2287 | struct perf_sample *sample, | 2288 | struct perf_sample *sample, |
2288 | struct machine *machine, | 2289 | struct machine *machine, |
2289 | struct perf_evsel *evsel) | 2290 | struct evsel *evsel) |
2290 | { | 2291 | { |
2291 | struct thread *thread; | 2292 | struct thread *thread; |
2292 | 2293 | ||
@@ -2332,7 +2333,7 @@ static struct thread *timehist_get_thread(struct perf_sched *sched, | |||
2332 | 2333 | ||
2333 | static bool timehist_skip_sample(struct perf_sched *sched, | 2334 | static bool timehist_skip_sample(struct perf_sched *sched, |
2334 | struct thread *thread, | 2335 | struct thread *thread, |
2335 | struct perf_evsel *evsel, | 2336 | struct evsel *evsel, |
2336 | struct perf_sample *sample) | 2337 | struct perf_sample *sample) |
2337 | { | 2338 | { |
2338 | bool rc = false; | 2339 | bool rc = false; |
@@ -2354,7 +2355,7 @@ static bool timehist_skip_sample(struct perf_sched *sched, | |||
2354 | } | 2355 | } |
2355 | 2356 | ||
2356 | static void timehist_print_wakeup_event(struct perf_sched *sched, | 2357 | static void timehist_print_wakeup_event(struct perf_sched *sched, |
2357 | struct perf_evsel *evsel, | 2358 | struct evsel *evsel, |
2358 | struct perf_sample *sample, | 2359 | struct perf_sample *sample, |
2359 | struct machine *machine, | 2360 | struct machine *machine, |
2360 | struct thread *awakened) | 2361 | struct thread *awakened) |
@@ -2389,7 +2390,7 @@ static void timehist_print_wakeup_event(struct perf_sched *sched, | |||
2389 | 2390 | ||
2390 | static int timehist_sched_wakeup_event(struct perf_tool *tool, | 2391 | static int timehist_sched_wakeup_event(struct perf_tool *tool, |
2391 | union perf_event *event __maybe_unused, | 2392 | union perf_event *event __maybe_unused, |
2392 | struct perf_evsel *evsel, | 2393 | struct evsel *evsel, |
2393 | struct perf_sample *sample, | 2394 | struct perf_sample *sample, |
2394 | struct machine *machine) | 2395 | struct machine *machine) |
2395 | { | 2396 | { |
@@ -2419,7 +2420,7 @@ static int timehist_sched_wakeup_event(struct perf_tool *tool, | |||
2419 | } | 2420 | } |
2420 | 2421 | ||
2421 | static void timehist_print_migration_event(struct perf_sched *sched, | 2422 | static void timehist_print_migration_event(struct perf_sched *sched, |
2422 | struct perf_evsel *evsel, | 2423 | struct evsel *evsel, |
2423 | struct perf_sample *sample, | 2424 | struct perf_sample *sample, |
2424 | struct machine *machine, | 2425 | struct machine *machine, |
2425 | struct thread *migrated) | 2426 | struct thread *migrated) |
@@ -2473,7 +2474,7 @@ static void timehist_print_migration_event(struct perf_sched *sched, | |||
2473 | 2474 | ||
2474 | static int timehist_migrate_task_event(struct perf_tool *tool, | 2475 | static int timehist_migrate_task_event(struct perf_tool *tool, |
2475 | union perf_event *event __maybe_unused, | 2476 | union perf_event *event __maybe_unused, |
2476 | struct perf_evsel *evsel, | 2477 | struct evsel *evsel, |
2477 | struct perf_sample *sample, | 2478 | struct perf_sample *sample, |
2478 | struct machine *machine) | 2479 | struct machine *machine) |
2479 | { | 2480 | { |
@@ -2501,7 +2502,7 @@ static int timehist_migrate_task_event(struct perf_tool *tool, | |||
2501 | 2502 | ||
2502 | static int timehist_sched_change_event(struct perf_tool *tool, | 2503 | static int timehist_sched_change_event(struct perf_tool *tool, |
2503 | union perf_event *event, | 2504 | union perf_event *event, |
2504 | struct perf_evsel *evsel, | 2505 | struct evsel *evsel, |
2505 | struct perf_sample *sample, | 2506 | struct perf_sample *sample, |
2506 | struct machine *machine) | 2507 | struct machine *machine) |
2507 | { | 2508 | { |
@@ -2627,7 +2628,7 @@ out: | |||
2627 | 2628 | ||
2628 | static int timehist_sched_switch_event(struct perf_tool *tool, | 2629 | static int timehist_sched_switch_event(struct perf_tool *tool, |
2629 | union perf_event *event, | 2630 | union perf_event *event, |
2630 | struct perf_evsel *evsel, | 2631 | struct evsel *evsel, |
2631 | struct perf_sample *sample, | 2632 | struct perf_sample *sample, |
2632 | struct machine *machine __maybe_unused) | 2633 | struct machine *machine __maybe_unused) |
2633 | { | 2634 | { |
@@ -2643,7 +2644,7 @@ static int process_lost(struct perf_tool *tool __maybe_unused, | |||
2643 | 2644 | ||
2644 | timestamp__scnprintf_usec(sample->time, tstr, sizeof(tstr)); | 2645 | timestamp__scnprintf_usec(sample->time, tstr, sizeof(tstr)); |
2645 | printf("%15s ", tstr); | 2646 | printf("%15s ", tstr); |
2646 | printf("lost %" PRIu64 " events on cpu %d\n", event->lost.lost, sample->cpu); | 2647 | printf("lost %" PRI_lu64 " events on cpu %d\n", event->lost.lost, sample->cpu); |
2647 | 2648 | ||
2648 | return 0; | 2649 | return 0; |
2649 | } | 2650 | } |
@@ -2897,14 +2898,14 @@ static void timehist_print_summary(struct perf_sched *sched, | |||
2897 | 2898 | ||
2898 | typedef int (*sched_handler)(struct perf_tool *tool, | 2899 | typedef int (*sched_handler)(struct perf_tool *tool, |
2899 | union perf_event *event, | 2900 | union perf_event *event, |
2900 | struct perf_evsel *evsel, | 2901 | struct evsel *evsel, |
2901 | struct perf_sample *sample, | 2902 | struct perf_sample *sample, |
2902 | struct machine *machine); | 2903 | struct machine *machine); |
2903 | 2904 | ||
2904 | static int perf_timehist__process_sample(struct perf_tool *tool, | 2905 | static int perf_timehist__process_sample(struct perf_tool *tool, |
2905 | union perf_event *event, | 2906 | union perf_event *event, |
2906 | struct perf_sample *sample, | 2907 | struct perf_sample *sample, |
2907 | struct perf_evsel *evsel, | 2908 | struct evsel *evsel, |
2908 | struct machine *machine) | 2909 | struct machine *machine) |
2909 | { | 2910 | { |
2910 | struct perf_sched *sched = container_of(tool, struct perf_sched, tool); | 2911 | struct perf_sched *sched = container_of(tool, struct perf_sched, tool); |
@@ -2924,12 +2925,12 @@ static int perf_timehist__process_sample(struct perf_tool *tool, | |||
2924 | } | 2925 | } |
2925 | 2926 | ||
2926 | static int timehist_check_attr(struct perf_sched *sched, | 2927 | static int timehist_check_attr(struct perf_sched *sched, |
2927 | struct perf_evlist *evlist) | 2928 | struct evlist *evlist) |
2928 | { | 2929 | { |
2929 | struct perf_evsel *evsel; | 2930 | struct evsel *evsel; |
2930 | struct evsel_runtime *er; | 2931 | struct evsel_runtime *er; |
2931 | 2932 | ||
2932 | list_for_each_entry(evsel, &evlist->entries, node) { | 2933 | list_for_each_entry(evsel, &evlist->core.entries, core.node) { |
2933 | er = perf_evsel__get_runtime(evsel); | 2934 | er = perf_evsel__get_runtime(evsel); |
2934 | if (er == NULL) { | 2935 | if (er == NULL) { |
2935 | pr_err("Failed to allocate memory for evsel runtime data\n"); | 2936 | pr_err("Failed to allocate memory for evsel runtime data\n"); |
@@ -2948,12 +2949,12 @@ static int timehist_check_attr(struct perf_sched *sched, | |||
2948 | 2949 | ||
2949 | static int perf_sched__timehist(struct perf_sched *sched) | 2950 | static int perf_sched__timehist(struct perf_sched *sched) |
2950 | { | 2951 | { |
2951 | const struct perf_evsel_str_handler handlers[] = { | 2952 | const struct evsel_str_handler handlers[] = { |
2952 | { "sched:sched_switch", timehist_sched_switch_event, }, | 2953 | { "sched:sched_switch", timehist_sched_switch_event, }, |
2953 | { "sched:sched_wakeup", timehist_sched_wakeup_event, }, | 2954 | { "sched:sched_wakeup", timehist_sched_wakeup_event, }, |
2954 | { "sched:sched_wakeup_new", timehist_sched_wakeup_event, }, | 2955 | { "sched:sched_wakeup_new", timehist_sched_wakeup_event, }, |
2955 | }; | 2956 | }; |
2956 | const struct perf_evsel_str_handler migrate_handlers[] = { | 2957 | const struct evsel_str_handler migrate_handlers[] = { |
2957 | { "sched:sched_migrate_task", timehist_migrate_task_event, }, | 2958 | { "sched:sched_migrate_task", timehist_migrate_task_event, }, |
2958 | }; | 2959 | }; |
2959 | struct perf_data data = { | 2960 | struct perf_data data = { |
@@ -2963,7 +2964,7 @@ static int perf_sched__timehist(struct perf_sched *sched) | |||
2963 | }; | 2964 | }; |
2964 | 2965 | ||
2965 | struct perf_session *session; | 2966 | struct perf_session *session; |
2966 | struct perf_evlist *evlist; | 2967 | struct evlist *evlist; |
2967 | int err = -1; | 2968 | int err = -1; |
2968 | 2969 | ||
2969 | /* | 2970 | /* |
@@ -3170,7 +3171,7 @@ static int perf_sched__lat(struct perf_sched *sched) | |||
3170 | 3171 | ||
3171 | static int setup_map_cpus(struct perf_sched *sched) | 3172 | static int setup_map_cpus(struct perf_sched *sched) |
3172 | { | 3173 | { |
3173 | struct cpu_map *map; | 3174 | struct perf_cpu_map *map; |
3174 | 3175 | ||
3175 | sched->max_cpu = sysconf(_SC_NPROCESSORS_CONF); | 3176 | sched->max_cpu = sysconf(_SC_NPROCESSORS_CONF); |
3176 | 3177 | ||
@@ -3183,7 +3184,7 @@ static int setup_map_cpus(struct perf_sched *sched) | |||
3183 | if (!sched->map.cpus_str) | 3184 | if (!sched->map.cpus_str) |
3184 | return 0; | 3185 | return 0; |
3185 | 3186 | ||
3186 | map = cpu_map__new(sched->map.cpus_str); | 3187 | map = perf_cpu_map__new(sched->map.cpus_str); |
3187 | if (!map) { | 3188 | if (!map) { |
3188 | pr_err("failed to get cpus map from %s\n", sched->map.cpus_str); | 3189 | pr_err("failed to get cpus map from %s\n", sched->map.cpus_str); |
3189 | return -1; | 3190 | return -1; |
@@ -3195,7 +3196,7 @@ static int setup_map_cpus(struct perf_sched *sched) | |||
3195 | 3196 | ||
3196 | static int setup_color_pids(struct perf_sched *sched) | 3197 | static int setup_color_pids(struct perf_sched *sched) |
3197 | { | 3198 | { |
3198 | struct thread_map *map; | 3199 | struct perf_thread_map *map; |
3199 | 3200 | ||
3200 | if (!sched->map.color_pids_str) | 3201 | if (!sched->map.color_pids_str) |
3201 | return 0; | 3202 | return 0; |
@@ -3212,12 +3213,12 @@ static int setup_color_pids(struct perf_sched *sched) | |||
3212 | 3213 | ||
3213 | static int setup_color_cpus(struct perf_sched *sched) | 3214 | static int setup_color_cpus(struct perf_sched *sched) |
3214 | { | 3215 | { |
3215 | struct cpu_map *map; | 3216 | struct perf_cpu_map *map; |
3216 | 3217 | ||
3217 | if (!sched->map.color_cpus_str) | 3218 | if (!sched->map.color_cpus_str) |
3218 | return 0; | 3219 | return 0; |
3219 | 3220 | ||
3220 | map = cpu_map__new(sched->map.color_cpus_str); | 3221 | map = perf_cpu_map__new(sched->map.color_cpus_str); |
3221 | if (!map) { | 3222 | if (!map) { |
3222 | pr_err("failed to get thread map from %s\n", sched->map.color_cpus_str); | 3223 | pr_err("failed to get thread map from %s\n", sched->map.color_cpus_str); |
3223 | return -1; | 3224 | return -1; |