Commit 239e551
committed
trace-cmd: Fix the looping to clear triggers and filters
The resetting of filters and triggers did a loop on each trigger and filter
till it was cleared. The point being, it removed one trigger or filter at a
time. This could cause an infinite loop due to some triggers requiring an
"ordering" of removal. When histograms are used with synthetic events, one
histogram will be attached to another histogram, and the remove of the
first histogram will fail to be removed if the second histogram is still
using it.
As the code would just keep iterating on the same trigger file, and that
file would never be cleared due to the histogram dependency, it went into an
infinite loop.
Instead of a loop that would read the file and try to remove the first
trigger, read the entire file at once, then try removing the each of the
the triggers that was read one at a time. After all have been attempted to
be removed, re-read the file. If the file still has data, take note, and
continue to the other files.
After processing all the files, check to see how many files still had data,
then loop through all the files again, doing the same thing, but only do it
the number of times that there was content in the files, as that should
remove all the triggers no matter what the dependency is.
We could optimize this by only reseting the files that still had data in it,
but that would require making full copy of the event_iter then running on
that. As this doesn't happen much, doing a full scan again shoudn't be too
much of an issue. But if it becomes one, then the optimization can still
happen later.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>1 parent 59b40fd commit 239e551
1 file changed
Lines changed: 115 additions & 84 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
1902 | | - | |
1903 | | - | |
1904 | | - | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
1908 | | - | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
1940 | 1902 | | |
1941 | 1903 | | |
1942 | 1904 | | |
| |||
2056 | 2018 | | |
2057 | 2019 | | |
2058 | 2020 | | |
2059 | | - | |
2060 | | - | |
2061 | | - | |
2062 | | - | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
| 2021 | + | |
2066 | 2022 | | |
2067 | 2023 | | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
2068 | 2027 | | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
2069 | 2035 | | |
2070 | 2036 | | |
2071 | 2037 | | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
2072 | 2053 | | |
2073 | | - | |
2074 | | - | |
| 2054 | + | |
| 2055 | + | |
2075 | 2056 | | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
2081 | 2070 | | |
2082 | 2071 | | |
2083 | 2072 | | |
2084 | 2073 | | |
2085 | | - | |
| 2074 | + | |
2086 | 2075 | | |
| 2076 | + | |
| 2077 | + | |
2087 | 2078 | | |
2088 | 2079 | | |
2089 | 2080 | | |
| |||
2100 | 2091 | | |
2101 | 2092 | | |
2102 | 2093 | | |
2103 | | - | |
2104 | | - | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
2105 | 2102 | | |
2106 | 2103 | | |
2107 | | - | |
2108 | | - | |
| 2104 | + | |
| 2105 | + | |
2109 | 2106 | | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
2116 | | - | |
2117 | | - | |
2118 | | - | |
2119 | | - | |
2120 | | - | |
2121 | | - | |
2122 | | - | |
2123 | | - | |
2124 | | - | |
2125 | | - | |
2126 | | - | |
2127 | | - | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
2128 | 2123 | | |
2129 | | - | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
2130 | 2132 | | |
2131 | 2133 | | |
2132 | 2134 | | |
| |||
4435 | 4437 | | |
4436 | 4438 | | |
4437 | 4439 | | |
4438 | | - | |
4439 | | - | |
| 4440 | + | |
| 4441 | + | |
4440 | 4442 | | |
4441 | 4443 | | |
4442 | 4444 | | |
| |||
4459 | 4461 | | |
4460 | 4462 | | |
4461 | 4463 | | |
4462 | | - | |
| 4464 | + | |
4463 | 4465 | | |
4464 | 4466 | | |
4465 | 4467 | | |
| 4468 | + | |
4466 | 4469 | | |
4467 | 4470 | | |
4468 | 4471 | | |
4469 | 4472 | | |
| 4473 | + | |
4470 | 4474 | | |
4471 | | - | |
4472 | 4475 | | |
4473 | | - | |
4474 | | - | |
| 4476 | + | |
| 4477 | + | |
| 4478 | + | |
4475 | 4479 | | |
4476 | 4480 | | |
4477 | 4481 | | |
4478 | 4482 | | |
4479 | 4483 | | |
4480 | 4484 | | |
4481 | 4485 | | |
4482 | | - | |
4483 | 4486 | | |
4484 | 4487 | | |
4485 | 4488 | | |
| |||
4488 | 4491 | | |
4489 | 4492 | | |
4490 | 4493 | | |
4491 | | - | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
4492 | 4497 | | |
4493 | 4498 | | |
4494 | 4499 | | |
4495 | 4500 | | |
| 4501 | + | |
| 4502 | + | |
| 4503 | + | |
| 4504 | + | |
| 4505 | + | |
| 4506 | + | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
| 4511 | + | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
| 4517 | + | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
4496 | 4527 | | |
4497 | 4528 | | |
4498 | 4529 | | |
| |||
0 commit comments