diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-07-23 11:26:13 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2013-07-24 11:22:53 -0400 |
commit | 9c01fe4593db123c5a72dc36f0400f776e92c954 (patch) | |
tree | 717207fb5fbd5b12c2aa7bba5457f79af18219a5 /kernel/trace/trace.c | |
parent | 6484c71cbc170634fa131b6d022d86d61686b88b (diff) |
tracing: Kill trace_cpu struct/members
After the previous changes trace_array_cpu->trace_cpu and
trace_array->trace_cpu becomes write-only. Remove these members
and kill "struct trace_cpu" as well.
As a side effect this also removes memset(per_cpu_memory, 0).
It was not needed, alloc_percpu() returns zero-filled memory.
Link: http://lkml.kernel.org/r/20130723152613.GA23741@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index dd7780ddde08..69cba470ea96 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -5865,17 +5865,6 @@ struct dentry *trace_instance_dir; | |||
5865 | static void | 5865 | static void |
5866 | init_tracer_debugfs(struct trace_array *tr, struct dentry *d_tracer); | 5866 | init_tracer_debugfs(struct trace_array *tr, struct dentry *d_tracer); |
5867 | 5867 | ||
5868 | static void init_trace_buffers(struct trace_array *tr, struct trace_buffer *buf) | ||
5869 | { | ||
5870 | int cpu; | ||
5871 | |||
5872 | for_each_tracing_cpu(cpu) { | ||
5873 | memset(per_cpu_ptr(buf->data, cpu), 0, sizeof(struct trace_array_cpu)); | ||
5874 | per_cpu_ptr(buf->data, cpu)->trace_cpu.cpu = cpu; | ||
5875 | per_cpu_ptr(buf->data, cpu)->trace_cpu.tr = tr; | ||
5876 | } | ||
5877 | } | ||
5878 | |||
5879 | static int | 5868 | static int |
5880 | allocate_trace_buffer(struct trace_array *tr, struct trace_buffer *buf, int size) | 5869 | allocate_trace_buffer(struct trace_array *tr, struct trace_buffer *buf, int size) |
5881 | { | 5870 | { |
@@ -5893,8 +5882,6 @@ allocate_trace_buffer(struct trace_array *tr, struct trace_buffer *buf, int size | |||
5893 | return -ENOMEM; | 5882 | return -ENOMEM; |
5894 | } | 5883 | } |
5895 | 5884 | ||
5896 | init_trace_buffers(tr, buf); | ||
5897 | |||
5898 | /* Allocate the first page for all buffers */ | 5885 | /* Allocate the first page for all buffers */ |
5899 | set_buffer_entries(&tr->trace_buffer, | 5886 | set_buffer_entries(&tr->trace_buffer, |
5900 | ring_buffer_size(tr->trace_buffer.buffer, 0)); | 5887 | ring_buffer_size(tr->trace_buffer.buffer, 0)); |
@@ -5961,10 +5948,6 @@ static int new_instance_create(const char *name) | |||
5961 | if (allocate_trace_buffers(tr, trace_buf_size) < 0) | 5948 | if (allocate_trace_buffers(tr, trace_buf_size) < 0) |
5962 | goto out_free_tr; | 5949 | goto out_free_tr; |
5963 | 5950 | ||
5964 | /* Holder for file callbacks */ | ||
5965 | tr->trace_cpu.cpu = RING_BUFFER_ALL_CPUS; | ||
5966 | tr->trace_cpu.tr = tr; | ||
5967 | |||
5968 | tr->dir = debugfs_create_dir(name, trace_instance_dir); | 5951 | tr->dir = debugfs_create_dir(name, trace_instance_dir); |
5969 | if (!tr->dir) | 5952 | if (!tr->dir) |
5970 | goto out_free_tr; | 5953 | goto out_free_tr; |
@@ -6438,10 +6421,6 @@ __init static int tracer_alloc_buffers(void) | |||
6438 | 6421 | ||
6439 | global_trace.flags = TRACE_ARRAY_FL_GLOBAL; | 6422 | global_trace.flags = TRACE_ARRAY_FL_GLOBAL; |
6440 | 6423 | ||
6441 | /* Holder for file callbacks */ | ||
6442 | global_trace.trace_cpu.cpu = RING_BUFFER_ALL_CPUS; | ||
6443 | global_trace.trace_cpu.tr = &global_trace; | ||
6444 | |||
6445 | INIT_LIST_HEAD(&global_trace.systems); | 6424 | INIT_LIST_HEAD(&global_trace.systems); |
6446 | INIT_LIST_HEAD(&global_trace.events); | 6425 | INIT_LIST_HEAD(&global_trace.events); |
6447 | list_add(&global_trace.list, &ftrace_trace_arrays); | 6426 | list_add(&global_trace.list, &ftrace_trace_arrays); |