aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-sched.c')
-rw-r--r--tools/perf/builtin-sched.c102
1 files changed, 48 insertions, 54 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 782f66d3610..82e8ec2c43b 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -299,7 +299,7 @@ add_sched_event_wakeup(struct task_desc *task, u64 timestamp,
299 299
300static void 300static void
301add_sched_event_sleep(struct task_desc *task, u64 timestamp, 301add_sched_event_sleep(struct task_desc *task, u64 timestamp,
302 u64 task_state __used) 302 u64 task_state __maybe_unused)
303{ 303{
304 struct sched_atom *event = get_new_event(task, timestamp); 304 struct sched_atom *event = get_new_event(task, timestamp);
305 305
@@ -369,8 +369,8 @@ static void add_cross_task_wakeups(void)
369 } 369 }
370} 370}
371 371
372static void 372static void process_sched_event(struct task_desc *this_task __maybe_unused,
373process_sched_event(struct task_desc *this_task __used, struct sched_atom *atom) 373 struct sched_atom *atom)
374{ 374{
375 int ret = 0; 375 int ret = 0;
376 376
@@ -752,7 +752,7 @@ struct trace_sched_handler {
752 752
753static int 753static int
754replay_wakeup_event(struct trace_wakeup_event *wakeup_event, 754replay_wakeup_event(struct trace_wakeup_event *wakeup_event,
755 struct machine *machine __used, 755 struct machine *machine __maybe_unused,
756 struct event_format *event, struct perf_sample *sample) 756 struct event_format *event, struct perf_sample *sample)
757{ 757{
758 struct task_desc *waker, *wakee; 758 struct task_desc *waker, *wakee;
@@ -777,11 +777,11 @@ static u64 cpu_last_switched[MAX_CPUS];
777 777
778static int 778static int
779replay_switch_event(struct trace_switch_event *switch_event, 779replay_switch_event(struct trace_switch_event *switch_event,
780 struct machine *machine __used, 780 struct machine *machine __maybe_unused,
781 struct event_format *event, 781 struct event_format *event,
782 struct perf_sample *sample) 782 struct perf_sample *sample)
783{ 783{
784 struct task_desc *prev, __used *next; 784 struct task_desc *prev, __maybe_unused *next;
785 u64 timestamp0, timestamp = sample->time; 785 u64 timestamp0, timestamp = sample->time;
786 int cpu = sample->cpu; 786 int cpu = sample->cpu;
787 s64 delta; 787 s64 delta;
@@ -932,15 +932,13 @@ static int thread_atoms_insert(struct thread *thread)
932 return 0; 932 return 0;
933} 933}
934 934
935static int 935static int latency_fork_event(struct trace_fork_event *fork_event __maybe_unused,
936latency_fork_event(struct trace_fork_event *fork_event __used, 936 struct event_format *event __maybe_unused)
937 struct event_format *event __used)
938{ 937{
939 /* should insert the newcomer */ 938 /* should insert the newcomer */
940 return 0; 939 return 0;
941} 940}
942 941
943__used
944static char sched_out_state(struct trace_switch_event *switch_event) 942static char sched_out_state(struct trace_switch_event *switch_event)
945{ 943{
946 const char *str = TASK_STATE_TO_CHAR_STR; 944 const char *str = TASK_STATE_TO_CHAR_STR;
@@ -971,7 +969,8 @@ add_sched_out_event(struct work_atoms *atoms,
971} 969}
972 970
973static void 971static void
974add_runtime_event(struct work_atoms *atoms, u64 delta, u64 timestamp __used) 972add_runtime_event(struct work_atoms *atoms, u64 delta,
973 u64 timestamp __maybe_unused)
975{ 974{
976 struct work_atom *atom; 975 struct work_atom *atom;
977 976
@@ -1017,7 +1016,7 @@ add_sched_in_event(struct work_atoms *atoms, u64 timestamp)
1017static int 1016static int
1018latency_switch_event(struct trace_switch_event *switch_event, 1017latency_switch_event(struct trace_switch_event *switch_event,
1019 struct machine *machine, 1018 struct machine *machine,
1020 struct event_format *event __used, 1019 struct event_format *event __maybe_unused,
1021 struct perf_sample *sample) 1020 struct perf_sample *sample)
1022{ 1021{
1023 struct work_atoms *out_events, *in_events; 1022 struct work_atoms *out_events, *in_events;
@@ -1105,7 +1104,8 @@ latency_runtime_event(struct trace_runtime_event *runtime_event,
1105 1104
1106static int 1105static int
1107latency_wakeup_event(struct trace_wakeup_event *wakeup_event, 1106latency_wakeup_event(struct trace_wakeup_event *wakeup_event,
1108 struct machine *machine, struct event_format *event __used, 1107 struct machine *machine,
1108 struct event_format *event __maybe_unused,
1109 struct perf_sample *sample) 1109 struct perf_sample *sample)
1110{ 1110{
1111 struct work_atoms *atoms; 1111 struct work_atoms *atoms;
@@ -1369,12 +1369,11 @@ static void sort_lat(void)
1369 1369
1370static struct trace_sched_handler *trace_handler; 1370static struct trace_sched_handler *trace_handler;
1371 1371
1372static int 1372static int process_sched_wakeup_event(struct perf_tool *tool __maybe_unused,
1373process_sched_wakeup_event(struct perf_tool *tool __used, 1373 struct event_format *event,
1374 struct event_format *event, 1374 struct perf_sample *sample,
1375 struct perf_sample *sample, 1375 struct machine *machine,
1376 struct machine *machine, 1376 struct thread *thread __maybe_unused)
1377 struct thread *thread __used)
1378{ 1377{
1379 void *data = sample->raw_data; 1378 void *data = sample->raw_data;
1380 struct trace_wakeup_event wakeup_event; 1379 struct trace_wakeup_event wakeup_event;
@@ -1410,10 +1409,10 @@ static char next_shortname2 = '0';
1410static int 1409static int
1411map_switch_event(struct trace_switch_event *switch_event, 1410map_switch_event(struct trace_switch_event *switch_event,
1412 struct machine *machine, 1411 struct machine *machine,
1413 struct event_format *event __used, 1412 struct event_format *event __maybe_unused,
1414 struct perf_sample *sample) 1413 struct perf_sample *sample)
1415{ 1414{
1416 struct thread *sched_out __used, *sched_in; 1415 struct thread *sched_out __maybe_unused, *sched_in;
1417 int new_shortname; 1416 int new_shortname;
1418 u64 timestamp0, timestamp = sample->time; 1417 u64 timestamp0, timestamp = sample->time;
1419 s64 delta; 1418 s64 delta;
@@ -1487,12 +1486,11 @@ map_switch_event(struct trace_switch_event *switch_event,
1487 return 0; 1486 return 0;
1488} 1487}
1489 1488
1490static int 1489static int process_sched_switch_event(struct perf_tool *tool __maybe_unused,
1491process_sched_switch_event(struct perf_tool *tool __used, 1490 struct event_format *event,
1492 struct event_format *event, 1491 struct perf_sample *sample,
1493 struct perf_sample *sample, 1492 struct machine *machine,
1494 struct machine *machine, 1493 struct thread *thread __maybe_unused)
1495 struct thread *thread __used)
1496{ 1494{
1497 int this_cpu = sample->cpu, err = 0; 1495 int this_cpu = sample->cpu, err = 0;
1498 void *data = sample->raw_data; 1496 void *data = sample->raw_data;
@@ -1523,12 +1521,11 @@ process_sched_switch_event(struct perf_tool *tool __used,
1523 return err; 1521 return err;
1524} 1522}
1525 1523
1526static int 1524static int process_sched_runtime_event(struct perf_tool *tool __maybe_unused,
1527process_sched_runtime_event(struct perf_tool *tool __used, 1525 struct event_format *event,
1528 struct event_format *event, 1526 struct perf_sample *sample,
1529 struct perf_sample *sample, 1527 struct machine *machine,
1530 struct machine *machine, 1528 struct thread *thread __maybe_unused)
1531 struct thread *thread __used)
1532{ 1529{
1533 void *data = sample->raw_data; 1530 void *data = sample->raw_data;
1534 struct trace_runtime_event runtime_event; 1531 struct trace_runtime_event runtime_event;
@@ -1545,12 +1542,11 @@ process_sched_runtime_event(struct perf_tool *tool __used,
1545 return err; 1542 return err;
1546} 1543}
1547 1544
1548static int 1545static int process_sched_fork_event(struct perf_tool *tool __maybe_unused,
1549process_sched_fork_event(struct perf_tool *tool __used, 1546 struct event_format *event,
1550 struct event_format *event, 1547 struct perf_sample *sample,
1551 struct perf_sample *sample, 1548 struct machine *machine __maybe_unused,
1552 struct machine *machine __used, 1549 struct thread *thread __maybe_unused)
1553 struct thread *thread __used)
1554{ 1550{
1555 void *data = sample->raw_data; 1551 void *data = sample->raw_data;
1556 struct trace_fork_event fork_event; 1552 struct trace_fork_event fork_event;
@@ -1569,12 +1565,11 @@ process_sched_fork_event(struct perf_tool *tool __used,
1569 return err; 1565 return err;
1570} 1566}
1571 1567
1572static int 1568static int process_sched_exit_event(struct perf_tool *tool __maybe_unused,
1573process_sched_exit_event(struct perf_tool *tool __used, 1569 struct event_format *event,
1574 struct event_format *event, 1570 struct perf_sample *sample __maybe_unused,
1575 struct perf_sample *sample __used, 1571 struct machine *machine __maybe_unused,
1576 struct machine *machine __used, 1572 struct thread *thread __maybe_unused)
1577 struct thread *thread __used)
1578{ 1573{
1579 if (verbose) 1574 if (verbose)
1580 printf("sched_exit event %p\n", event); 1575 printf("sched_exit event %p\n", event);
@@ -1582,12 +1577,11 @@ process_sched_exit_event(struct perf_tool *tool __used,
1582 return 0; 1577 return 0;
1583} 1578}
1584 1579
1585static int 1580static int process_sched_migrate_task_event(struct perf_tool *tool __maybe_unused,
1586process_sched_migrate_task_event(struct perf_tool *tool __used, 1581 struct event_format *event,
1587 struct event_format *event, 1582 struct perf_sample *sample,
1588 struct perf_sample *sample, 1583 struct machine *machine,
1589 struct machine *machine, 1584 struct thread *thread __maybe_unused)
1590 struct thread *thread __used)
1591{ 1585{
1592 void *data = sample->raw_data; 1586 void *data = sample->raw_data;
1593 struct trace_migrate_task_event migrate_task_event; 1587 struct trace_migrate_task_event migrate_task_event;
@@ -1612,8 +1606,8 @@ typedef int (*tracepoint_handler)(struct perf_tool *tool,
1612 struct machine *machine, 1606 struct machine *machine,
1613 struct thread *thread); 1607 struct thread *thread);
1614 1608
1615static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __used, 1609static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_unused,
1616 union perf_event *event __used, 1610 union perf_event *event __maybe_unused,
1617 struct perf_sample *sample, 1611 struct perf_sample *sample,
1618 struct perf_evsel *evsel, 1612 struct perf_evsel *evsel,
1619 struct machine *machine) 1613 struct machine *machine)
@@ -1918,7 +1912,7 @@ static int __cmd_record(int argc, const char **argv)
1918 return cmd_record(i, rec_argv, NULL); 1912 return cmd_record(i, rec_argv, NULL);
1919} 1913}
1920 1914
1921int cmd_sched(int argc, const char **argv, const char *prefix __used) 1915int cmd_sched(int argc, const char **argv, const char *prefix __maybe_unused)
1922{ 1916{
1923 argc = parse_options(argc, argv, sched_options, sched_usage, 1917 argc = parse_options(argc, argv, sched_options, sched_usage,
1924 PARSE_OPT_STOP_AT_NON_OPTION); 1918 PARSE_OPT_STOP_AT_NON_OPTION);