aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2021-04-08 09:34:31 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-04-08 11:16:40 -0400
commit64a17a837a314556e2e0457f29ce16023b2acc47 (patch)
tree54d165b78f8fd0a81a377c6cca6b6e3302c0d869 /include
parent7c9565e6ba2d7c362c76aa69f152b9bff290e7b3 (diff)
downloadlibtracefs-64a17a837a314556e2e0457f29ce16023b2acc47.tar.gz
libtracefs: Add a pthread_mutex per instance
Add a pthread_mutex per instance such that modifications being done on specific instances do not interfere with each other. This also includes a new "toplevel_lock" that is to be used when modifying the toplevel instance. Convert the filter_mutex over to the toplevel/instance locking. Link: https://lore.kernel.org/linux-trace-devel/20210408133431.2023697-6-rostedt@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r--include/tracefs-local.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/tracefs-local.h b/include/tracefs-local.h
index 060de7e..6865611 100644
--- a/include/tracefs-local.h
+++ b/include/tracefs-local.h
@@ -15,13 +15,16 @@
do { if (!(1/!(cond))) { } } while (0)
struct tracefs_instance {
- char *trace_dir;
- char *name;
- int flags;
- int ftrace_filter_fd;
- int ftrace_notrace_fd;
+ char *trace_dir;
+ char *name;
+ pthread_mutex_t lock;
+ int flags;
+ int ftrace_filter_fd;
+ int ftrace_notrace_fd;
};
+extern pthread_mutex_t toplevel_lock;
+
/* Can be overridden */
void warning(const char *fmt, ...);