aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ftrace.c5
-rw-r--r--kernel/trace/trace.c72
2 files changed, 39 insertions, 38 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5e9389faaf75..97c40865a93e 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -756,9 +756,11 @@ ftrace_avail_open(struct inode *inode, struct file *file)
756 ret = seq_open(file, &show_ftrace_seq_ops); 756 ret = seq_open(file, &show_ftrace_seq_ops);
757 if (!ret) { 757 if (!ret) {
758 struct seq_file *m = file->private_data; 758 struct seq_file *m = file->private_data;
759
759 m->private = iter; 760 m->private = iter;
760 } else 761 } else {
761 kfree(iter); 762 kfree(iter);
763 }
762 764
763 return ret; 765 return ret;
764} 766}
@@ -770,6 +772,7 @@ int ftrace_avail_release(struct inode *inode, struct file *file)
770 772
771 seq_release(inode, file); 773 seq_release(inode, file);
772 kfree(iter); 774 kfree(iter);
775
773 return 0; 776 return 0;
774} 777}
775 778
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b3811ca74071..4550afda9607 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1245,10 +1245,10 @@ static int s_show(struct seq_file *m, void *v)
1245} 1245}
1246 1246
1247static struct seq_operations tracer_seq_ops = { 1247static struct seq_operations tracer_seq_ops = {
1248 .start = s_start, 1248 .start = s_start,
1249 .next = s_next, 1249 .next = s_next,
1250 .stop = s_stop, 1250 .stop = s_stop,
1251 .show = s_show, 1251 .show = s_show,
1252}; 1252};
1253 1253
1254static struct trace_iterator notrace * 1254static struct trace_iterator notrace *
@@ -1397,10 +1397,10 @@ static int t_show(struct seq_file *m, void *v)
1397} 1397}
1398 1398
1399static struct seq_operations show_traces_seq_ops = { 1399static struct seq_operations show_traces_seq_ops = {
1400 .start = t_start, 1400 .start = t_start,
1401 .next = t_next, 1401 .next = t_next,
1402 .stop = t_stop, 1402 .stop = t_stop,
1403 .show = t_show, 1403 .show = t_show,
1404}; 1404};
1405 1405
1406static int show_traces_open(struct inode *inode, struct file *file) 1406static int show_traces_open(struct inode *inode, struct file *file)
@@ -1420,17 +1420,17 @@ static int show_traces_open(struct inode *inode, struct file *file)
1420} 1420}
1421 1421
1422static struct file_operations tracing_fops = { 1422static struct file_operations tracing_fops = {
1423 .open = tracing_open, 1423 .open = tracing_open,
1424 .read = seq_read, 1424 .read = seq_read,
1425 .llseek = seq_lseek, 1425 .llseek = seq_lseek,
1426 .release = tracing_release, 1426 .release = tracing_release,
1427}; 1427};
1428 1428
1429static struct file_operations tracing_lt_fops = { 1429static struct file_operations tracing_lt_fops = {
1430 .open = tracing_lt_open, 1430 .open = tracing_lt_open,
1431 .read = seq_read, 1431 .read = seq_read,
1432 .llseek = seq_lseek, 1432 .llseek = seq_lseek,
1433 .release = tracing_release, 1433 .release = tracing_release,
1434}; 1434};
1435 1435
1436static struct file_operations show_traces_fops = { 1436static struct file_operations show_traces_fops = {
@@ -1620,8 +1620,7 @@ tracing_set_trace_read(struct file *filp, char __user *ubuf,
1620 r = sprintf(buf, "\n"); 1620 r = sprintf(buf, "\n");
1621 mutex_unlock(&trace_types_lock); 1621 mutex_unlock(&trace_types_lock);
1622 1622
1623 return simple_read_from_buffer(ubuf, cnt, ppos, 1623 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
1624 buf, r);
1625} 1624}
1626 1625
1627static ssize_t 1626static ssize_t
@@ -1680,8 +1679,7 @@ tracing_max_lat_read(struct file *filp, char __user *ubuf,
1680 *ptr == (unsigned long)-1 ? -1 : nsecs_to_usecs(*ptr)); 1679 *ptr == (unsigned long)-1 ? -1 : nsecs_to_usecs(*ptr));
1681 if (r > 64) 1680 if (r > 64)
1682 r = 64; 1681 r = 64;
1683 return simple_read_from_buffer(ubuf, cnt, ppos, 1682 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
1684 buf, r);
1685} 1683}
1686 1684
1687static ssize_t 1685static ssize_t
@@ -1891,27 +1889,27 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
1891} 1889}
1892 1890
1893static struct file_operations tracing_max_lat_fops = { 1891static struct file_operations tracing_max_lat_fops = {
1894 .open = tracing_open_generic, 1892 .open = tracing_open_generic,
1895 .read = tracing_max_lat_read, 1893 .read = tracing_max_lat_read,
1896 .write = tracing_max_lat_write, 1894 .write = tracing_max_lat_write,
1897}; 1895};
1898 1896
1899static struct file_operations tracing_ctrl_fops = { 1897static struct file_operations tracing_ctrl_fops = {
1900 .open = tracing_open_generic, 1898 .open = tracing_open_generic,
1901 .read = tracing_ctrl_read, 1899 .read = tracing_ctrl_read,
1902 .write = tracing_ctrl_write, 1900 .write = tracing_ctrl_write,
1903}; 1901};
1904 1902
1905static struct file_operations set_tracer_fops = { 1903static struct file_operations set_tracer_fops = {
1906 .open = tracing_open_generic, 1904 .open = tracing_open_generic,
1907 .read = tracing_set_trace_read, 1905 .read = tracing_set_trace_read,
1908 .write = tracing_set_trace_write, 1906 .write = tracing_set_trace_write,
1909}; 1907};
1910 1908
1911static struct file_operations tracing_pipe_fops = { 1909static struct file_operations tracing_pipe_fops = {
1912 .open = tracing_open_pipe, 1910 .open = tracing_open_pipe,
1913 .read = tracing_read_pipe, 1911 .read = tracing_read_pipe,
1914 .release = tracing_release_pipe, 1912 .release = tracing_release_pipe,
1915}; 1913};
1916 1914
1917#ifdef CONFIG_DYNAMIC_FTRACE 1915#ifdef CONFIG_DYNAMIC_FTRACE
@@ -1925,13 +1923,13 @@ tracing_read_long(struct file *filp, char __user *ubuf,
1925 int r; 1923 int r;
1926 1924
1927 r = sprintf(buf, "%ld\n", *p); 1925 r = sprintf(buf, "%ld\n", *p);
1928 return simple_read_from_buffer(ubuf, cnt, ppos, 1926
1929 buf, r); 1927 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
1930} 1928}
1931 1929
1932static struct file_operations tracing_read_long_fops = { 1930static struct file_operations tracing_read_long_fops = {
1933 .open = tracing_open_generic, 1931 .open = tracing_open_generic,
1934 .read = tracing_read_long, 1932 .read = tracing_read_long,
1935}; 1933};
1936#endif 1934#endif
1937 1935
@@ -2033,7 +2031,7 @@ static __init void tracer_init_debugfs(void)
2033/* dummy trace to disable tracing */ 2031/* dummy trace to disable tracing */
2034static struct tracer no_tracer __read_mostly = 2032static struct tracer no_tracer __read_mostly =
2035{ 2033{
2036 .name = "none", 2034 .name = "none",
2037}; 2035};
2038 2036
2039static int trace_alloc_page(void) 2037static int trace_alloc_page(void)