| .. | .. |
|---|
| 23 | 23 | return 0; |
|---|
| 24 | 24 | } |
|---|
| 25 | 25 | |
|---|
| 26 | | -static int trace_test_buffer_cpu(struct trace_buffer *buf, int cpu) |
|---|
| 26 | +static int trace_test_buffer_cpu(struct array_buffer *buf, int cpu) |
|---|
| 27 | 27 | { |
|---|
| 28 | 28 | struct ring_buffer_event *event; |
|---|
| 29 | 29 | struct trace_entry *entry; |
|---|
| .. | .. |
|---|
| 60 | 60 | * Test the trace buffer to see if all the elements |
|---|
| 61 | 61 | * are still sane. |
|---|
| 62 | 62 | */ |
|---|
| 63 | | -static int __maybe_unused trace_test_buffer(struct trace_buffer *buf, unsigned long *count) |
|---|
| 63 | +static int __maybe_unused trace_test_buffer(struct array_buffer *buf, unsigned long *count) |
|---|
| 64 | 64 | { |
|---|
| 65 | 65 | unsigned long flags, cnt = 0; |
|---|
| 66 | 66 | int cpu, ret = 0; |
|---|
| .. | .. |
|---|
| 362 | 362 | msleep(100); |
|---|
| 363 | 363 | |
|---|
| 364 | 364 | /* we should have nothing in the buffer */ |
|---|
| 365 | | - ret = trace_test_buffer(&tr->trace_buffer, &count); |
|---|
| 365 | + ret = trace_test_buffer(&tr->array_buffer, &count); |
|---|
| 366 | 366 | if (ret) |
|---|
| 367 | 367 | goto out; |
|---|
| 368 | 368 | |
|---|
| .. | .. |
|---|
| 383 | 383 | ftrace_enabled = 0; |
|---|
| 384 | 384 | |
|---|
| 385 | 385 | /* check the trace buffer */ |
|---|
| 386 | | - ret = trace_test_buffer(&tr->trace_buffer, &count); |
|---|
| 386 | + ret = trace_test_buffer(&tr->array_buffer, &count); |
|---|
| 387 | 387 | |
|---|
| 388 | 388 | ftrace_enabled = 1; |
|---|
| 389 | 389 | tracing_start(); |
|---|
| .. | .. |
|---|
| 687 | 687 | ftrace_enabled = 0; |
|---|
| 688 | 688 | |
|---|
| 689 | 689 | /* check the trace buffer */ |
|---|
| 690 | | - ret = trace_test_buffer(&tr->trace_buffer, &count); |
|---|
| 690 | + ret = trace_test_buffer(&tr->array_buffer, &count); |
|---|
| 691 | 691 | |
|---|
| 692 | 692 | ftrace_enabled = 1; |
|---|
| 693 | 693 | trace->reset(tr); |
|---|
| .. | .. |
|---|
| 746 | 746 | return trace_graph_entry(trace); |
|---|
| 747 | 747 | } |
|---|
| 748 | 748 | |
|---|
| 749 | +static struct fgraph_ops fgraph_ops __initdata = { |
|---|
| 750 | + .entryfunc = &trace_graph_entry_watchdog, |
|---|
| 751 | + .retfunc = &trace_graph_return, |
|---|
| 752 | +}; |
|---|
| 753 | + |
|---|
| 749 | 754 | /* |
|---|
| 750 | 755 | * Pretty much the same than for the function tracer from which the selftest |
|---|
| 751 | 756 | * has been borrowed. |
|---|
| .. | .. |
|---|
| 768 | 773 | * Simulate the init() callback but we attach a watchdog callback |
|---|
| 769 | 774 | * to detect and recover from possible hangs |
|---|
| 770 | 775 | */ |
|---|
| 771 | | - tracing_reset_online_cpus(&tr->trace_buffer); |
|---|
| 776 | + tracing_reset_online_cpus(&tr->array_buffer); |
|---|
| 772 | 777 | set_graph_array(tr); |
|---|
| 773 | | - ret = register_ftrace_graph(&trace_graph_return, |
|---|
| 774 | | - &trace_graph_entry_watchdog); |
|---|
| 778 | + ret = register_ftrace_graph(&fgraph_ops); |
|---|
| 775 | 779 | if (ret) { |
|---|
| 776 | 780 | warn_failed_init_tracer(trace, ret); |
|---|
| 777 | 781 | goto out; |
|---|
| .. | .. |
|---|
| 783 | 787 | |
|---|
| 784 | 788 | /* Have we just recovered from a hang? */ |
|---|
| 785 | 789 | if (graph_hang_thresh > GRAPH_MAX_FUNC_TEST) { |
|---|
| 786 | | - tracing_selftest_disabled = true; |
|---|
| 790 | + disable_tracing_selftest("recovering from a hang"); |
|---|
| 787 | 791 | ret = -1; |
|---|
| 788 | 792 | goto out; |
|---|
| 789 | 793 | } |
|---|
| .. | .. |
|---|
| 791 | 795 | tracing_stop(); |
|---|
| 792 | 796 | |
|---|
| 793 | 797 | /* check the trace buffer */ |
|---|
| 794 | | - ret = trace_test_buffer(&tr->trace_buffer, &count); |
|---|
| 798 | + ret = trace_test_buffer(&tr->array_buffer, &count); |
|---|
| 795 | 799 | |
|---|
| 796 | | - trace->reset(tr); |
|---|
| 800 | + /* Need to also simulate the tr->reset to remove this fgraph_ops */ |
|---|
| 801 | + tracing_stop_cmdline_record(); |
|---|
| 802 | + unregister_ftrace_graph(&fgraph_ops); |
|---|
| 803 | + |
|---|
| 797 | 804 | tracing_start(); |
|---|
| 798 | 805 | |
|---|
| 799 | 806 | if (!ret && !count) { |
|---|
| .. | .. |
|---|
| 846 | 853 | /* stop the tracing. */ |
|---|
| 847 | 854 | tracing_stop(); |
|---|
| 848 | 855 | /* check both trace buffers */ |
|---|
| 849 | | - ret = trace_test_buffer(&tr->trace_buffer, NULL); |
|---|
| 856 | + ret = trace_test_buffer(&tr->array_buffer, NULL); |
|---|
| 850 | 857 | if (!ret) |
|---|
| 851 | 858 | ret = trace_test_buffer(&tr->max_buffer, &count); |
|---|
| 852 | 859 | trace->reset(tr); |
|---|
| .. | .. |
|---|
| 908 | 915 | /* stop the tracing. */ |
|---|
| 909 | 916 | tracing_stop(); |
|---|
| 910 | 917 | /* check both trace buffers */ |
|---|
| 911 | | - ret = trace_test_buffer(&tr->trace_buffer, NULL); |
|---|
| 918 | + ret = trace_test_buffer(&tr->array_buffer, NULL); |
|---|
| 912 | 919 | if (!ret) |
|---|
| 913 | 920 | ret = trace_test_buffer(&tr->max_buffer, &count); |
|---|
| 914 | 921 | trace->reset(tr); |
|---|
| .. | .. |
|---|
| 974 | 981 | /* stop the tracing. */ |
|---|
| 975 | 982 | tracing_stop(); |
|---|
| 976 | 983 | /* check both trace buffers */ |
|---|
| 977 | | - ret = trace_test_buffer(&tr->trace_buffer, NULL); |
|---|
| 984 | + ret = trace_test_buffer(&tr->array_buffer, NULL); |
|---|
| 978 | 985 | if (ret) |
|---|
| 979 | 986 | goto out; |
|---|
| 980 | 987 | |
|---|
| .. | .. |
|---|
| 1004 | 1011 | /* stop the tracing. */ |
|---|
| 1005 | 1012 | tracing_stop(); |
|---|
| 1006 | 1013 | /* check both trace buffers */ |
|---|
| 1007 | | - ret = trace_test_buffer(&tr->trace_buffer, NULL); |
|---|
| 1014 | + ret = trace_test_buffer(&tr->array_buffer, NULL); |
|---|
| 1008 | 1015 | if (ret) |
|---|
| 1009 | 1016 | goto out; |
|---|
| 1010 | 1017 | |
|---|
| .. | .. |
|---|
| 1134 | 1141 | /* stop the tracing. */ |
|---|
| 1135 | 1142 | tracing_stop(); |
|---|
| 1136 | 1143 | /* check both trace buffers */ |
|---|
| 1137 | | - ret = trace_test_buffer(&tr->trace_buffer, NULL); |
|---|
| 1144 | + ret = trace_test_buffer(&tr->array_buffer, NULL); |
|---|
| 1138 | 1145 | if (!ret) |
|---|
| 1139 | 1146 | ret = trace_test_buffer(&tr->max_buffer, &count); |
|---|
| 1140 | 1147 | |
|---|
| .. | .. |
|---|
| 1175 | 1182 | /* stop the tracing. */ |
|---|
| 1176 | 1183 | tracing_stop(); |
|---|
| 1177 | 1184 | /* check the trace buffer */ |
|---|
| 1178 | | - ret = trace_test_buffer(&tr->trace_buffer, &count); |
|---|
| 1185 | + ret = trace_test_buffer(&tr->array_buffer, &count); |
|---|
| 1179 | 1186 | trace->reset(tr); |
|---|
| 1180 | 1187 | tracing_start(); |
|---|
| 1181 | 1188 | |
|---|