Skip to contentSkip to conversation

libtracefs: Have trace_get_options() use trace_get_lock() helper

PATCH New Steven Rostedt 1 participant 1 message Apr 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Have trace_get_options() use trace_get_lock() helper

From: "Steven Rostedt (VMware)" <[email protected]>

Instead of having trace_get_options() figure out what lock it needs to use, have it use the trace_get_lock() helper instead.

---
 src/tracefs-tools.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/tracefs-tools.c +1 -1
index fa09da5..6ef17f6 100644
@@ -211,7 +211,7 @@ enum tracefs_option_id tracefs_option_id(const char *name)
 const static struct tracefs_options_mask *
 trace_get_options(struct tracefs_instance *instance, bool enabled)
 {
-	pthread_mutex_t *lock = instance ? &instance->lock : &toplevel_lock;
+	pthread_mutex_t *lock = trace_get_lock(instance);
 	struct tracefs_options_mask *bitmask;
 	enum tracefs_option_id id;
 	unsigned long long set;
Signature · 1 line
2.29.2