Commit 5dbd04e
tracing/user_events: Allow events to persist for perfmon_capable users
There are several scenarios that have come up where having a user_event
persist even if the process that registered it exits. The main one is
having a daemon create events on bootup that shouldn't get deleted if
the daemon has to exit or reload. Another is within OpenTelemetry
exporters, they wish to potentially check if a user_event exists on the
system to determine if exporting the data out should occur. The
user_event in this case must exist even in the absence of the owning
process running (such as the above daemon case).
Expose the previously internal flag USER_EVENT_REG_PERSIST to user
processes. Upon register or delete of events with this flag, ensure the
user is perfmon_capable to prevent random user processes with access to
tracefs from creating events that persist after exit.
Link: https://lkml.kernel.org/r/20230912180704.1284-2-beaub@linux.microsoft.com
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent bdf4fb6 commit 5dbd04e
2 files changed
Lines changed: 32 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
| |||
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
36 | | - | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 52 | | |
65 | 53 | | |
66 | 54 | | |
| |||
220 | 208 | | |
221 | 209 | | |
222 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
| |||
1811 | 1810 | | |
1812 | 1811 | | |
1813 | 1812 | | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
1814 | 1816 | | |
1815 | 1817 | | |
1816 | 1818 | | |
| |||
1926 | 1928 | | |
1927 | 1929 | | |
1928 | 1930 | | |
1929 | | - | |
1930 | | - | |
| 1931 | + | |
| 1932 | + | |
1931 | 1933 | | |
1932 | 1934 | | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
1933 | 1938 | | |
1934 | 1939 | | |
1935 | 1940 | | |
| |||
2062 | 2067 | | |
2063 | 2068 | | |
2064 | 2069 | | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
2065 | 2073 | | |
2066 | 2074 | | |
2067 | 2075 | | |
| |||
0 commit comments