diff options
-rw-r--r-- | Documentation/trace/histogram.txt | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Documentation/trace/histogram.txt b/Documentation/trace/histogram.txt index e73bcf9cb5f3..7ffea6aa22e3 100644 --- a/Documentation/trace/histogram.txt +++ b/Documentation/trace/histogram.txt | |||
@@ -1729,35 +1729,35 @@ If a variable isn't a key variable or prefixed with 'vals=', the | |||
1729 | associated event field will be saved in a variable but won't be summed | 1729 | associated event field will be saved in a variable but won't be summed |
1730 | as a value: | 1730 | as a value: |
1731 | 1731 | ||
1732 | # echo 'hist:keys=next_pid:ts1=common_timestamp ... >> event/trigger | 1732 | # echo 'hist:keys=next_pid:ts1=common_timestamp ...' >> event/trigger |
1733 | 1733 | ||
1734 | Multiple variables can be assigned at the same time. The below would | 1734 | Multiple variables can be assigned at the same time. The below would |
1735 | result in both ts0 and b being created as variables, with both | 1735 | result in both ts0 and b being created as variables, with both |
1736 | common_timestamp and field1 additionally being summed as values: | 1736 | common_timestamp and field1 additionally being summed as values: |
1737 | 1737 | ||
1738 | # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ... >> \ | 1738 | # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ...' >> \ |
1739 | event/trigger | 1739 | event/trigger |
1740 | 1740 | ||
1741 | Note that variable assignments can appear either preceding or | 1741 | Note that variable assignments can appear either preceding or |
1742 | following their use. The command below behaves identically to the | 1742 | following their use. The command below behaves identically to the |
1743 | command above: | 1743 | command above: |
1744 | 1744 | ||
1745 | # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ... >> \ | 1745 | # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ...' >> \ |
1746 | event/trigger | 1746 | event/trigger |
1747 | 1747 | ||
1748 | Any number of variables not bound to a 'vals=' prefix can also be | 1748 | Any number of variables not bound to a 'vals=' prefix can also be |
1749 | assigned by simply separating them with colons. Below is the same | 1749 | assigned by simply separating them with colons. Below is the same |
1750 | thing but without the values being summed in the histogram: | 1750 | thing but without the values being summed in the histogram: |
1751 | 1751 | ||
1752 | # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ... >> event/trigger | 1752 | # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ...' >> event/trigger |
1753 | 1753 | ||
1754 | Variables set as above can be referenced and used in expressions on | 1754 | Variables set as above can be referenced and used in expressions on |
1755 | another event. | 1755 | another event. |
1756 | 1756 | ||
1757 | For example, here's how a latency can be calculated: | 1757 | For example, here's how a latency can be calculated: |
1758 | 1758 | ||
1759 | # echo 'hist:keys=pid,prio:ts0=common_timestamp ... >> event1/trigger | 1759 | # echo 'hist:keys=pid,prio:ts0=common_timestamp ...' >> event1/trigger |
1760 | # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... >> event2/trigger | 1760 | # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ...' >> event2/trigger |
1761 | 1761 | ||
1762 | In the first line above, the event's timetamp is saved into the | 1762 | In the first line above, the event's timetamp is saved into the |
1763 | variable ts0. In the next line, ts0 is subtracted from the second | 1763 | variable ts0. In the next line, ts0 is subtracted from the second |
@@ -1766,7 +1766,7 @@ yet another variable, 'wakeup_lat'. The hist trigger below in turn | |||
1766 | makes use of the wakeup_lat variable to compute a combined latency | 1766 | makes use of the wakeup_lat variable to compute a combined latency |
1767 | using the same key and variable from yet another event: | 1767 | using the same key and variable from yet another event: |
1768 | 1768 | ||
1769 | # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ... >> event3/trigger | 1769 | # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger |
1770 | 1770 | ||
1771 | 2.2.2 Synthetic Events | 1771 | 2.2.2 Synthetic Events |
1772 | ---------------------- | 1772 | ---------------------- |
@@ -1807,10 +1807,11 @@ the command that defined it with a '!': | |||
1807 | At this point, there isn't yet an actual 'wakeup_latency' event | 1807 | At this point, there isn't yet an actual 'wakeup_latency' event |
1808 | instantiated in the event subsytem - for this to happen, a 'hist | 1808 | instantiated in the event subsytem - for this to happen, a 'hist |
1809 | trigger action' needs to be instantiated and bound to actual fields | 1809 | trigger action' needs to be instantiated and bound to actual fields |
1810 | and variables defined on other events (see Section 6.3.3 below). | 1810 | and variables defined on other events (see Section 2.2.3 below on |
1811 | how that is done using hist trigger 'onmatch' action). Once that is | ||
1812 | done, the 'wakeup_latency' synthetic event instance is created. | ||
1811 | 1813 | ||
1812 | Once that is done, an event instance is created, and a histogram can | 1814 | A histogram can now be defined for the new synthetic event: |
1813 | be defined using it: | ||
1814 | 1815 | ||
1815 | # echo 'hist:keys=pid,prio,lat.log2:sort=pid,lat' >> \ | 1816 | # echo 'hist:keys=pid,prio,lat.log2:sort=pid,lat' >> \ |
1816 | /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger | 1817 | /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger |
@@ -1960,7 +1961,7 @@ hist trigger specification. | |||
1960 | back to that pid, the timestamp difference is calculated. If the | 1961 | back to that pid, the timestamp difference is calculated. If the |
1961 | resulting latency, stored in wakeup_lat, exceeds the current | 1962 | resulting latency, stored in wakeup_lat, exceeds the current |
1962 | maximum latency, the values specified in the save() fields are | 1963 | maximum latency, the values specified in the save() fields are |
1963 | recoreded: | 1964 | recorded: |
1964 | 1965 | ||
1965 | # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ | 1966 | # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ |
1966 | if comm=="cyclictest"' >> \ | 1967 | if comm=="cyclictest"' >> \ |