summaryrefslogtreecommitdiff
path: root/scripts/sorttable.h
diff options
context:
space:
mode:
authorJohn Keeping <john@metanate.com>2021-12-07 14:25:58 +0000
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-12-07 22:05:49 -0500
commit2972e3050e3517a85ca1813b227d4c302e804343 (patch)
treea193be75d817fbb94984bf6f6eb3785d49b0d276 /scripts/sorttable.h
parenta6ed2aee54644cfa2d04ca86308767f5c3a087e8 (diff)
tracing: Make trace_marker{,_raw} stream-like
The tracing marker files are write-only streams with no meaningful concept of file position. Using stream_open() to mark them as stream-link indicates this and has the added advantage that a single file descriptor can now be used from multiple threads without contention thanks to clearing FMODE_ATOMIC_POS. Note that this has the potential to break existing userspace by since both lseek(2) and pwrite(2) will now return ESPIPE when previously lseek would have updated the stored offset and pwrite would have appended to the trace. A survey of libtracefs and several other projects found to use trace_marker(_raw) [1][2][3] suggests that everyone limits themselves to calling write(2) and close(2) on these file descriptors so there is a good chance this will go unnoticed and the benefits of reduced overhead and lock contention seem worth the risk. [1] https://github.com/google/perfetto [2] https://github.com/intel/media-driver/ [3] https://w1.fi/cgit/hostap/ Link: https://lkml.kernel.org/r/20211207142558.347029-1-john@metanate.com Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'scripts/sorttable.h')
0 files changed, 0 insertions, 0 deletions