diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-31 18:42:23 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-31 18:42:23 -0500 |
commit | 4462344ee9ea9224d026801b877887f2f39774a3 (patch) | |
tree | deb703d6858f2fb7f7db69c65e90560ce4a0654e /kernel/trace/trace.c | |
parent | 9e01c1b74c9531e301c900edaa92a99fcb7738f2 (diff) |
cpumask: convert kernel trace functions further
Impact: Reduce future memory usage, use new cpumask API.
Since the last patch was created and acked, more old cpumask users
slipped into kernel/trace.
Mostly trivial conversions, except struct trace_iterator's "started"
member becomes a cpumask_var_t.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 5d04e27f3b40..c580233add95 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1811,10 +1811,10 @@ static void test_cpu_buff_start(struct trace_iterator *iter) | |||
1811 | if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) | 1811 | if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) |
1812 | return; | 1812 | return; |
1813 | 1813 | ||
1814 | if (cpu_isset(iter->cpu, iter->started)) | 1814 | if (cpumask_test_cpu(iter->cpu, iter->started)) |
1815 | return; | 1815 | return; |
1816 | 1816 | ||
1817 | cpu_set(iter->cpu, iter->started); | 1817 | cpumask_set_cpu(iter->cpu, iter->started); |
1818 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); | 1818 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); |
1819 | } | 1819 | } |
1820 | 1820 | ||
@@ -3114,10 +3114,15 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) | |||
3114 | if (!iter) | 3114 | if (!iter) |
3115 | return -ENOMEM; | 3115 | return -ENOMEM; |
3116 | 3116 | ||
3117 | if (!alloc_cpumask_var(&iter->started, GFP_KERNEL)) { | ||
3118 | kfree(iter); | ||
3119 | return -ENOMEM; | ||
3120 | } | ||
3121 | |||
3117 | mutex_lock(&trace_types_lock); | 3122 | mutex_lock(&trace_types_lock); |
3118 | 3123 | ||
3119 | /* trace pipe does not show start of buffer */ | 3124 | /* trace pipe does not show start of buffer */ |
3120 | cpus_setall(iter->started); | 3125 | cpumask_setall(iter->started); |
3121 | 3126 | ||
3122 | iter->tr = &global_trace; | 3127 | iter->tr = &global_trace; |
3123 | iter->trace = current_trace; | 3128 | iter->trace = current_trace; |
@@ -3134,6 +3139,7 @@ static int tracing_release_pipe(struct inode *inode, struct file *file) | |||
3134 | { | 3139 | { |
3135 | struct trace_iterator *iter = file->private_data; | 3140 | struct trace_iterator *iter = file->private_data; |
3136 | 3141 | ||
3142 | free_cpumask_var(iter->started); | ||
3137 | kfree(iter); | 3143 | kfree(iter); |
3138 | atomic_dec(&tracing_reader); | 3144 | atomic_dec(&tracing_reader); |
3139 | 3145 | ||