diff options
Diffstat (limited to 'Documentation/trace')
-rw-r--r-- | Documentation/trace/events-power.txt | 27 | ||||
-rw-r--r-- | Documentation/trace/ftrace.txt | 83 |
2 files changed, 84 insertions, 26 deletions
diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt index cf794af22855..e1498ff8cf94 100644 --- a/Documentation/trace/events-power.txt +++ b/Documentation/trace/events-power.txt | |||
@@ -17,7 +17,7 @@ Cf. include/trace/events/power.h for the events definitions. | |||
17 | 1. Power state switch events | 17 | 1. Power state switch events |
18 | ============================ | 18 | ============================ |
19 | 19 | ||
20 | 1.1 New trace API | 20 | 1.1 Trace API |
21 | ----------------- | 21 | ----------------- |
22 | 22 | ||
23 | A 'cpu' event class gathers the CPU-related events: cpuidle and | 23 | A 'cpu' event class gathers the CPU-related events: cpuidle and |
@@ -41,31 +41,6 @@ The event which has 'state=4294967295' in the trace is very important to the use | |||
41 | space tools which are using it to detect the end of the current state, and so to | 41 | space tools which are using it to detect the end of the current state, and so to |
42 | correctly draw the states diagrams and to calculate accurate statistics etc. | 42 | correctly draw the states diagrams and to calculate accurate statistics etc. |
43 | 43 | ||
44 | 1.2 DEPRECATED trace API | ||
45 | ------------------------ | ||
46 | |||
47 | A new Kconfig option CONFIG_EVENT_POWER_TRACING_DEPRECATED with the default value of | ||
48 | 'y' has been created. This allows the legacy trace power API to be used conjointly | ||
49 | with the new trace API. | ||
50 | The Kconfig option, the old trace API (in include/trace/events/power.h) and the | ||
51 | old trace points will disappear in a future release (namely 2.6.41). | ||
52 | |||
53 | power_start "type=%lu state=%lu cpu_id=%lu" | ||
54 | power_frequency "type=%lu state=%lu cpu_id=%lu" | ||
55 | power_end "cpu_id=%lu" | ||
56 | |||
57 | The 'type' parameter takes one of those macros: | ||
58 | . POWER_NONE = 0, | ||
59 | . POWER_CSTATE = 1, /* C-State */ | ||
60 | . POWER_PSTATE = 2, /* Frequency change or DVFS */ | ||
61 | |||
62 | The 'state' parameter is set depending on the type: | ||
63 | . Target C-state for type=POWER_CSTATE, | ||
64 | . Target frequency for type=POWER_PSTATE, | ||
65 | |||
66 | power_end is used to indicate the exit of a state, corresponding to the latest | ||
67 | power_start event. | ||
68 | |||
69 | 2. Clocks events | 44 | 2. Clocks events |
70 | ================ | 45 | ================ |
71 | The clock events are used for clock enable/disable and for | 46 | The clock events are used for clock enable/disable and for |
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 6f51fed45f2d..53d6a3c51d87 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -1842,6 +1842,89 @@ an error. | |||
1842 | # cat buffer_size_kb | 1842 | # cat buffer_size_kb |
1843 | 85 | 1843 | 85 |
1844 | 1844 | ||
1845 | Snapshot | ||
1846 | -------- | ||
1847 | CONFIG_TRACER_SNAPSHOT makes a generic snapshot feature | ||
1848 | available to all non latency tracers. (Latency tracers which | ||
1849 | record max latency, such as "irqsoff" or "wakeup", can't use | ||
1850 | this feature, since those are already using the snapshot | ||
1851 | mechanism internally.) | ||
1852 | |||
1853 | Snapshot preserves a current trace buffer at a particular point | ||
1854 | in time without stopping tracing. Ftrace swaps the current | ||
1855 | buffer with a spare buffer, and tracing continues in the new | ||
1856 | current (=previous spare) buffer. | ||
1857 | |||
1858 | The following debugfs files in "tracing" are related to this | ||
1859 | feature: | ||
1860 | |||
1861 | snapshot: | ||
1862 | |||
1863 | This is used to take a snapshot and to read the output | ||
1864 | of the snapshot. Echo 1 into this file to allocate a | ||
1865 | spare buffer and to take a snapshot (swap), then read | ||
1866 | the snapshot from this file in the same format as | ||
1867 | "trace" (described above in the section "The File | ||
1868 | System"). Both reads snapshot and tracing are executable | ||
1869 | in parallel. When the spare buffer is allocated, echoing | ||
1870 | 0 frees it, and echoing else (positive) values clear the | ||
1871 | snapshot contents. | ||
1872 | More details are shown in the table below. | ||
1873 | |||
1874 | status\input | 0 | 1 | else | | ||
1875 | --------------+------------+------------+------------+ | ||
1876 | not allocated |(do nothing)| alloc+swap | EINVAL | | ||
1877 | --------------+------------+------------+------------+ | ||
1878 | allocated | free | swap | clear | | ||
1879 | --------------+------------+------------+------------+ | ||
1880 | |||
1881 | Here is an example of using the snapshot feature. | ||
1882 | |||
1883 | # echo 1 > events/sched/enable | ||
1884 | # echo 1 > snapshot | ||
1885 | # cat snapshot | ||
1886 | # tracer: nop | ||
1887 | # | ||
1888 | # entries-in-buffer/entries-written: 71/71 #P:8 | ||
1889 | # | ||
1890 | # _-----=> irqs-off | ||
1891 | # / _----=> need-resched | ||
1892 | # | / _---=> hardirq/softirq | ||
1893 | # || / _--=> preempt-depth | ||
1894 | # ||| / delay | ||
1895 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
1896 | # | | | |||| | | | ||
1897 | <idle>-0 [005] d... 2440.603828: sched_switch: prev_comm=swapper/5 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=snapshot-test-2 next_pid=2242 next_prio=120 | ||
1898 | sleep-2242 [005] d... 2440.603846: sched_switch: prev_comm=snapshot-test-2 prev_pid=2242 prev_prio=120 prev_state=R ==> next_comm=kworker/5:1 next_pid=60 next_prio=120 | ||
1899 | [...] | ||
1900 | <idle>-0 [002] d... 2440.707230: sched_switch: prev_comm=swapper/2 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=snapshot-test-2 next_pid=2229 next_prio=120 | ||
1901 | |||
1902 | # cat trace | ||
1903 | # tracer: nop | ||
1904 | # | ||
1905 | # entries-in-buffer/entries-written: 77/77 #P:8 | ||
1906 | # | ||
1907 | # _-----=> irqs-off | ||
1908 | # / _----=> need-resched | ||
1909 | # | / _---=> hardirq/softirq | ||
1910 | # || / _--=> preempt-depth | ||
1911 | # ||| / delay | ||
1912 | # TASK-PID CPU# |||| TIMESTAMP FUNCTION | ||
1913 | # | | | |||| | | | ||
1914 | <idle>-0 [007] d... 2440.707395: sched_switch: prev_comm=swapper/7 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=snapshot-test-2 next_pid=2243 next_prio=120 | ||
1915 | snapshot-test-2-2229 [002] d... 2440.707438: sched_switch: prev_comm=snapshot-test-2 prev_pid=2229 prev_prio=120 prev_state=S ==> next_comm=swapper/2 next_pid=0 next_prio=120 | ||
1916 | [...] | ||
1917 | |||
1918 | |||
1919 | If you try to use this snapshot feature when current tracer is | ||
1920 | one of the latency tracers, you will get the following results. | ||
1921 | |||
1922 | # echo wakeup > current_tracer | ||
1923 | # echo 1 > snapshot | ||
1924 | bash: echo: write error: Device or resource busy | ||
1925 | # cat snapshot | ||
1926 | cat: snapshot: Device or resource busy | ||
1927 | |||
1845 | ----------- | 1928 | ----------- |
1846 | 1929 | ||
1847 | More details can be found in the source code, in the | 1930 | More details can be found in the source code, in the |