aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 53df2839bb93..00daf5f8c50b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2916,6 +2916,8 @@ static int trace_set_options(char *option)
2916 cmp += 2; 2916 cmp += 2;
2917 } 2917 }
2918 2918
2919 mutex_lock(&trace_types_lock);
2920
2919 for (i = 0; trace_options[i]; i++) { 2921 for (i = 0; trace_options[i]; i++) {
2920 if (strcmp(cmp, trace_options[i]) == 0) { 2922 if (strcmp(cmp, trace_options[i]) == 0) {
2921 set_tracer_flags(1 << i, !neg); 2923 set_tracer_flags(1 << i, !neg);
@@ -2924,11 +2926,10 @@ static int trace_set_options(char *option)
2924 } 2926 }
2925 2927
2926 /* If no option could be set, test the specific tracer options */ 2928 /* If no option could be set, test the specific tracer options */
2927 if (!trace_options[i]) { 2929 if (!trace_options[i])
2928 mutex_lock(&trace_types_lock);
2929 ret = set_tracer_option(current_trace, cmp, neg); 2930 ret = set_tracer_option(current_trace, cmp, neg);
2930 mutex_unlock(&trace_types_lock); 2931
2931 } 2932 mutex_unlock(&trace_types_lock);
2932 2933
2933 return ret; 2934 return ret;
2934} 2935}
@@ -4781,7 +4782,10 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
4781 4782
4782 if (val != 0 && val != 1) 4783 if (val != 0 && val != 1)
4783 return -EINVAL; 4784 return -EINVAL;
4785
4786 mutex_lock(&trace_types_lock);
4784 set_tracer_flags(1 << index, val); 4787 set_tracer_flags(1 << index, val);
4788 mutex_unlock(&trace_types_lock);
4785 4789
4786 *ppos += cnt; 4790 *ppos += cnt;
4787 4791