@@ -1845,7 +1845,6 @@ __synth_event_trace_start(struct trace_event_file *file,
1845
1845
if (!(file -> flags & EVENT_FILE_FL_ENABLED ) ||
1846
1846
trace_trigger_soft_disabled (file )) {
1847
1847
trace_state -> disabled = true;
1848
- ret = - ENOENT ;
1849
1848
goto out ;
1850
1849
}
1851
1850
@@ -1907,11 +1906,8 @@ int synth_event_trace(struct trace_event_file *file, unsigned int n_vals, ...)
1907
1906
int ret ;
1908
1907
1909
1908
ret = __synth_event_trace_start (file , & state );
1910
- if (ret ) {
1911
- if (ret == - ENOENT )
1912
- ret = 0 ; /* just disabled, not really an error */
1909
+ if (ret || state .disabled )
1913
1910
return ret ;
1914
- }
1915
1911
1916
1912
if (n_vals != state .event -> n_fields ) {
1917
1913
ret = - EINVAL ;
@@ -1987,11 +1983,8 @@ int synth_event_trace_array(struct trace_event_file *file, u64 *vals,
1987
1983
int ret ;
1988
1984
1989
1985
ret = __synth_event_trace_start (file , & state );
1990
- if (ret ) {
1991
- if (ret == - ENOENT )
1992
- ret = 0 ; /* just disabled, not really an error */
1986
+ if (ret || state .disabled )
1993
1987
return ret ;
1994
- }
1995
1988
1996
1989
if (n_vals != state .event -> n_fields ) {
1997
1990
ret = - EINVAL ;
@@ -2067,16 +2060,10 @@ EXPORT_SYMBOL_GPL(synth_event_trace_array);
2067
2060
int synth_event_trace_start (struct trace_event_file * file ,
2068
2061
struct synth_event_trace_state * trace_state )
2069
2062
{
2070
- int ret ;
2071
-
2072
2063
if (!trace_state )
2073
2064
return - EINVAL ;
2074
2065
2075
- ret = __synth_event_trace_start (file , trace_state );
2076
- if (ret == - ENOENT )
2077
- ret = 0 ; /* just disabled, not really an error */
2078
-
2079
- return ret ;
2066
+ return __synth_event_trace_start (file , trace_state );
2080
2067
}
2081
2068
EXPORT_SYMBOL_GPL (synth_event_trace_start );
2082
2069
0 commit comments