@@ -1421,6 +1421,7 @@ int tracing_snapshot_cond_disable(struct trace_array *tr)
1421
1421
return false;
1422
1422
}
1423
1423
EXPORT_SYMBOL_GPL (tracing_snapshot_cond_disable );
1424
+ #define free_snapshot (tr ) do { } while (0)
1424
1425
#endif /* CONFIG_TRACER_SNAPSHOT */
1425
1426
1426
1427
void tracer_tracing_off (struct trace_array * tr )
@@ -1692,6 +1693,8 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
1692
1693
}
1693
1694
1694
1695
unsigned long __read_mostly tracing_thresh ;
1696
+
1697
+ #ifdef CONFIG_TRACER_MAX_TRACE
1695
1698
static const struct file_operations tracing_max_lat_fops ;
1696
1699
1697
1700
#ifdef LATENCY_FS_NOTIFY
@@ -1748,18 +1751,14 @@ void latency_fsnotify(struct trace_array *tr)
1748
1751
irq_work_queue (& tr -> fsnotify_irqwork );
1749
1752
}
1750
1753
1751
- #elif defined(CONFIG_TRACER_MAX_TRACE ) || defined(CONFIG_HWLAT_TRACER ) \
1752
- || defined(CONFIG_OSNOISE_TRACER )
1754
+ #else /* !LATENCY_FS_NOTIFY */
1753
1755
1754
1756
#define trace_create_maxlat_file (tr , d_tracer ) \
1755
1757
trace_create_file("tracing_max_latency", TRACE_MODE_WRITE, \
1756
1758
d_tracer, &tr->max_latency, &tracing_max_lat_fops)
1757
1759
1758
- #else
1759
- #define trace_create_maxlat_file (tr , d_tracer ) do { } while (0)
1760
1760
#endif
1761
1761
1762
- #ifdef CONFIG_TRACER_MAX_TRACE
1763
1762
/*
1764
1763
* Copy the new maximum trace into the separate maximum-trace
1765
1764
* structure. (this way the maximum trace is permanently saved,
@@ -1834,14 +1833,15 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu,
1834
1833
ring_buffer_record_off (tr -> max_buffer .buffer );
1835
1834
1836
1835
#ifdef CONFIG_TRACER_SNAPSHOT
1837
- if (tr -> cond_snapshot && !tr -> cond_snapshot -> update (tr , cond_data ))
1838
- goto out_unlock ;
1836
+ if (tr -> cond_snapshot && !tr -> cond_snapshot -> update (tr , cond_data )) {
1837
+ arch_spin_unlock (& tr -> max_lock );
1838
+ return ;
1839
+ }
1839
1840
#endif
1840
1841
swap (tr -> array_buffer .buffer , tr -> max_buffer .buffer );
1841
1842
1842
1843
__update_max_tr (tr , tsk , cpu );
1843
1844
1844
- out_unlock :
1845
1845
arch_spin_unlock (& tr -> max_lock );
1846
1846
}
1847
1847
@@ -1888,6 +1888,7 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu)
1888
1888
__update_max_tr (tr , tsk , cpu );
1889
1889
arch_spin_unlock (& tr -> max_lock );
1890
1890
}
1891
+
1891
1892
#endif /* CONFIG_TRACER_MAX_TRACE */
1892
1893
1893
1894
static int wait_on_pipe (struct trace_iterator * iter , int full )
@@ -6577,7 +6578,7 @@ tracing_thresh_write(struct file *filp, const char __user *ubuf,
6577
6578
return ret ;
6578
6579
}
6579
6580
6580
- #if defined( CONFIG_TRACER_MAX_TRACE ) || defined( CONFIG_HWLAT_TRACER )
6581
+ #ifdef CONFIG_TRACER_MAX_TRACE
6581
6582
6582
6583
static ssize_t
6583
6584
tracing_max_lat_read (struct file * filp , char __user * ubuf ,
@@ -7592,7 +7593,7 @@ static const struct file_operations tracing_thresh_fops = {
7592
7593
.llseek = generic_file_llseek ,
7593
7594
};
7594
7595
7595
- #if defined( CONFIG_TRACER_MAX_TRACE ) || defined( CONFIG_HWLAT_TRACER )
7596
+ #ifdef CONFIG_TRACER_MAX_TRACE
7596
7597
static const struct file_operations tracing_max_lat_fops = {
7597
7598
.open = tracing_open_generic ,
7598
7599
.read = tracing_max_lat_read ,
@@ -9606,7 +9607,9 @@ init_tracer_tracefs(struct trace_array *tr, struct dentry *d_tracer)
9606
9607
9607
9608
create_trace_options_dir (tr );
9608
9609
9610
+ #ifdef CONFIG_TRACER_MAX_TRACE
9609
9611
trace_create_maxlat_file (tr , d_tracer );
9612
+ #endif
9610
9613
9611
9614
if (ftrace_create_function_files (tr , d_tracer ))
9612
9615
MEM_FAIL (1 , "Could not allocate function filter files" );
0 commit comments