diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-13 03:24:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-13 03:24:59 -0400 |
commit | 2c96c142e941041973faab20ca3b82d57f435c5e (patch) | |
tree | 45188f0ecb3f4bb7408a7219f8fcd041d500235a /kernel | |
parent | 3c355863fb32070a2800f41106519c5c3038623a (diff) | |
parent | 8ad807318fcd62aba0e18c7c7fbfcc1af3fcdbab (diff) |
Merge branch 'tracing/urgent' into tracing/core
Merge reason: Pick up tracing/filters fix from the urgent queue,
we will queue up dependent patches.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 15 | ||||
-rw-r--r-- | kernel/kprobes.c | 4 | ||||
-rw-r--r-- | kernel/module.c | 7 | ||||
-rw-r--r-- | kernel/rcutree_trace.c | 10 | ||||
-rw-r--r-- | kernel/res_counter.c | 18 | ||||
-rw-r--r-- | kernel/sched.c | 2 | ||||
-rw-r--r-- | kernel/time/timer_list.c | 2 | ||||
-rw-r--r-- | kernel/time/timer_stats.c | 2 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 23 | ||||
-rw-r--r-- | kernel/trace/trace.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_branch.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace_event_profile.c | 15 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 3 | ||||
-rw-r--r-- | kernel/trace/trace_hw_branches.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace_output.c | 18 |
15 files changed, 65 insertions, 72 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7ccba4bc5e3b..ca83b73fba19 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -703,7 +703,7 @@ static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, int mode); | |||
703 | static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry); | 703 | static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry); |
704 | static int cgroup_populate_dir(struct cgroup *cgrp); | 704 | static int cgroup_populate_dir(struct cgroup *cgrp); |
705 | static const struct inode_operations cgroup_dir_inode_operations; | 705 | static const struct inode_operations cgroup_dir_inode_operations; |
706 | static struct file_operations proc_cgroupstats_operations; | 706 | static const struct file_operations proc_cgroupstats_operations; |
707 | 707 | ||
708 | static struct backing_dev_info cgroup_backing_dev_info = { | 708 | static struct backing_dev_info cgroup_backing_dev_info = { |
709 | .name = "cgroup", | 709 | .name = "cgroup", |
@@ -1863,7 +1863,7 @@ static int cgroup_seqfile_release(struct inode *inode, struct file *file) | |||
1863 | return single_release(inode, file); | 1863 | return single_release(inode, file); |
1864 | } | 1864 | } |
1865 | 1865 | ||
1866 | static struct file_operations cgroup_seqfile_operations = { | 1866 | static const struct file_operations cgroup_seqfile_operations = { |
1867 | .read = seq_read, | 1867 | .read = seq_read, |
1868 | .write = cgroup_file_write, | 1868 | .write = cgroup_file_write, |
1869 | .llseek = seq_lseek, | 1869 | .llseek = seq_lseek, |
@@ -1922,7 +1922,7 @@ static int cgroup_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1922 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry); | 1922 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry); |
1923 | } | 1923 | } |
1924 | 1924 | ||
1925 | static struct file_operations cgroup_file_operations = { | 1925 | static const struct file_operations cgroup_file_operations = { |
1926 | .read = cgroup_file_read, | 1926 | .read = cgroup_file_read, |
1927 | .write = cgroup_file_write, | 1927 | .write = cgroup_file_write, |
1928 | .llseek = generic_file_llseek, | 1928 | .llseek = generic_file_llseek, |
@@ -3369,7 +3369,7 @@ static int cgroup_open(struct inode *inode, struct file *file) | |||
3369 | return single_open(file, proc_cgroup_show, pid); | 3369 | return single_open(file, proc_cgroup_show, pid); |
3370 | } | 3370 | } |
3371 | 3371 | ||
3372 | struct file_operations proc_cgroup_operations = { | 3372 | const struct file_operations proc_cgroup_operations = { |
3373 | .open = cgroup_open, | 3373 | .open = cgroup_open, |
3374 | .read = seq_read, | 3374 | .read = seq_read, |
3375 | .llseek = seq_lseek, | 3375 | .llseek = seq_lseek, |
@@ -3398,7 +3398,7 @@ static int cgroupstats_open(struct inode *inode, struct file *file) | |||
3398 | return single_open(file, proc_cgroupstats_show, NULL); | 3398 | return single_open(file, proc_cgroupstats_show, NULL); |
3399 | } | 3399 | } |
3400 | 3400 | ||
3401 | static struct file_operations proc_cgroupstats_operations = { | 3401 | static const struct file_operations proc_cgroupstats_operations = { |
3402 | .open = cgroupstats_open, | 3402 | .open = cgroupstats_open, |
3403 | .read = seq_read, | 3403 | .read = seq_read, |
3404 | .llseek = seq_lseek, | 3404 | .llseek = seq_lseek, |
@@ -3708,8 +3708,10 @@ static void check_for_release(struct cgroup *cgrp) | |||
3708 | void __css_put(struct cgroup_subsys_state *css) | 3708 | void __css_put(struct cgroup_subsys_state *css) |
3709 | { | 3709 | { |
3710 | struct cgroup *cgrp = css->cgroup; | 3710 | struct cgroup *cgrp = css->cgroup; |
3711 | int val; | ||
3711 | rcu_read_lock(); | 3712 | rcu_read_lock(); |
3712 | if (atomic_dec_return(&css->refcnt) == 1) { | 3713 | val = atomic_dec_return(&css->refcnt); |
3714 | if (val == 1) { | ||
3713 | if (notify_on_release(cgrp)) { | 3715 | if (notify_on_release(cgrp)) { |
3714 | set_bit(CGRP_RELEASABLE, &cgrp->flags); | 3716 | set_bit(CGRP_RELEASABLE, &cgrp->flags); |
3715 | check_for_release(cgrp); | 3717 | check_for_release(cgrp); |
@@ -3717,6 +3719,7 @@ void __css_put(struct cgroup_subsys_state *css) | |||
3717 | cgroup_wakeup_rmdir_waiter(cgrp); | 3719 | cgroup_wakeup_rmdir_waiter(cgrp); |
3718 | } | 3720 | } |
3719 | rcu_read_unlock(); | 3721 | rcu_read_unlock(); |
3722 | WARN_ON_ONCE(val < 1); | ||
3720 | } | 3723 | } |
3721 | 3724 | ||
3722 | /* | 3725 | /* |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index cfadc1291d0b..5240d75f4c60 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -1333,7 +1333,7 @@ static int __kprobes kprobes_open(struct inode *inode, struct file *filp) | |||
1333 | return seq_open(filp, &kprobes_seq_ops); | 1333 | return seq_open(filp, &kprobes_seq_ops); |
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | static struct file_operations debugfs_kprobes_operations = { | 1336 | static const struct file_operations debugfs_kprobes_operations = { |
1337 | .open = kprobes_open, | 1337 | .open = kprobes_open, |
1338 | .read = seq_read, | 1338 | .read = seq_read, |
1339 | .llseek = seq_lseek, | 1339 | .llseek = seq_lseek, |
@@ -1515,7 +1515,7 @@ static ssize_t write_enabled_file_bool(struct file *file, | |||
1515 | return count; | 1515 | return count; |
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | static struct file_operations fops_kp = { | 1518 | static const struct file_operations fops_kp = { |
1519 | .read = read_enabled_file_bool, | 1519 | .read = read_enabled_file_bool, |
1520 | .write = write_enabled_file_bool, | 1520 | .write = write_enabled_file_bool, |
1521 | }; | 1521 | }; |
diff --git a/kernel/module.c b/kernel/module.c index fe748a86d452..8b7d8805819d 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1992,12 +1992,14 @@ static inline unsigned long layout_symtab(struct module *mod, | |||
1992 | Elf_Shdr *sechdrs, | 1992 | Elf_Shdr *sechdrs, |
1993 | unsigned int symindex, | 1993 | unsigned int symindex, |
1994 | unsigned int strindex, | 1994 | unsigned int strindex, |
1995 | const Elf_Hdr *hdr, | 1995 | const Elf_Ehdr *hdr, |
1996 | const char *secstrings, | 1996 | const char *secstrings, |
1997 | unsigned long *pstroffs, | 1997 | unsigned long *pstroffs, |
1998 | unsigned long *strmap) | 1998 | unsigned long *strmap) |
1999 | { | 1999 | { |
2000 | return 0; | ||
2000 | } | 2001 | } |
2002 | |||
2001 | static inline void add_kallsyms(struct module *mod, | 2003 | static inline void add_kallsyms(struct module *mod, |
2002 | Elf_Shdr *sechdrs, | 2004 | Elf_Shdr *sechdrs, |
2003 | unsigned int shnum, | 2005 | unsigned int shnum, |
@@ -2081,9 +2083,8 @@ static noinline struct module *load_module(void __user *umod, | |||
2081 | struct module *mod; | 2083 | struct module *mod; |
2082 | long err = 0; | 2084 | long err = 0; |
2083 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ | 2085 | void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */ |
2084 | #ifdef CONFIG_KALLSYMS | ||
2085 | unsigned long symoffs, stroffs, *strmap; | 2086 | unsigned long symoffs, stroffs, *strmap; |
2086 | #endif | 2087 | |
2087 | mm_segment_t old_fs; | 2088 | mm_segment_t old_fs; |
2088 | 2089 | ||
2089 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", | 2090 | DEBUGP("load_module: umod=%p, len=%lu, uargs=%p\n", |
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index c89f5e9fd173..179e6ad80dc0 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c | |||
@@ -93,7 +93,7 @@ static int rcudata_open(struct inode *inode, struct file *file) | |||
93 | return single_open(file, show_rcudata, NULL); | 93 | return single_open(file, show_rcudata, NULL); |
94 | } | 94 | } |
95 | 95 | ||
96 | static struct file_operations rcudata_fops = { | 96 | static const struct file_operations rcudata_fops = { |
97 | .owner = THIS_MODULE, | 97 | .owner = THIS_MODULE, |
98 | .open = rcudata_open, | 98 | .open = rcudata_open, |
99 | .read = seq_read, | 99 | .read = seq_read, |
@@ -145,7 +145,7 @@ static int rcudata_csv_open(struct inode *inode, struct file *file) | |||
145 | return single_open(file, show_rcudata_csv, NULL); | 145 | return single_open(file, show_rcudata_csv, NULL); |
146 | } | 146 | } |
147 | 147 | ||
148 | static struct file_operations rcudata_csv_fops = { | 148 | static const struct file_operations rcudata_csv_fops = { |
149 | .owner = THIS_MODULE, | 149 | .owner = THIS_MODULE, |
150 | .open = rcudata_csv_open, | 150 | .open = rcudata_csv_open, |
151 | .read = seq_read, | 151 | .read = seq_read, |
@@ -196,7 +196,7 @@ static int rcuhier_open(struct inode *inode, struct file *file) | |||
196 | return single_open(file, show_rcuhier, NULL); | 196 | return single_open(file, show_rcuhier, NULL); |
197 | } | 197 | } |
198 | 198 | ||
199 | static struct file_operations rcuhier_fops = { | 199 | static const struct file_operations rcuhier_fops = { |
200 | .owner = THIS_MODULE, | 200 | .owner = THIS_MODULE, |
201 | .open = rcuhier_open, | 201 | .open = rcuhier_open, |
202 | .read = seq_read, | 202 | .read = seq_read, |
@@ -222,7 +222,7 @@ static int rcugp_open(struct inode *inode, struct file *file) | |||
222 | return single_open(file, show_rcugp, NULL); | 222 | return single_open(file, show_rcugp, NULL); |
223 | } | 223 | } |
224 | 224 | ||
225 | static struct file_operations rcugp_fops = { | 225 | static const struct file_operations rcugp_fops = { |
226 | .owner = THIS_MODULE, | 226 | .owner = THIS_MODULE, |
227 | .open = rcugp_open, | 227 | .open = rcugp_open, |
228 | .read = seq_read, | 228 | .read = seq_read, |
@@ -276,7 +276,7 @@ static int rcu_pending_open(struct inode *inode, struct file *file) | |||
276 | return single_open(file, show_rcu_pending, NULL); | 276 | return single_open(file, show_rcu_pending, NULL); |
277 | } | 277 | } |
278 | 278 | ||
279 | static struct file_operations rcu_pending_fops = { | 279 | static const struct file_operations rcu_pending_fops = { |
280 | .owner = THIS_MODULE, | 280 | .owner = THIS_MODULE, |
281 | .open = rcu_pending_open, | 281 | .open = rcu_pending_open, |
282 | .read = seq_read, | 282 | .read = seq_read, |
diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 88faec23e833..bcdabf37c40b 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c | |||
@@ -37,27 +37,17 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val) | |||
37 | } | 37 | } |
38 | 38 | ||
39 | int res_counter_charge(struct res_counter *counter, unsigned long val, | 39 | int res_counter_charge(struct res_counter *counter, unsigned long val, |
40 | struct res_counter **limit_fail_at, | 40 | struct res_counter **limit_fail_at) |
41 | struct res_counter **soft_limit_fail_at) | ||
42 | { | 41 | { |
43 | int ret; | 42 | int ret; |
44 | unsigned long flags; | 43 | unsigned long flags; |
45 | struct res_counter *c, *u; | 44 | struct res_counter *c, *u; |
46 | 45 | ||
47 | *limit_fail_at = NULL; | 46 | *limit_fail_at = NULL; |
48 | if (soft_limit_fail_at) | ||
49 | *soft_limit_fail_at = NULL; | ||
50 | local_irq_save(flags); | 47 | local_irq_save(flags); |
51 | for (c = counter; c != NULL; c = c->parent) { | 48 | for (c = counter; c != NULL; c = c->parent) { |
52 | spin_lock(&c->lock); | 49 | spin_lock(&c->lock); |
53 | ret = res_counter_charge_locked(c, val); | 50 | ret = res_counter_charge_locked(c, val); |
54 | /* | ||
55 | * With soft limits, we return the highest ancestor | ||
56 | * that exceeds its soft limit | ||
57 | */ | ||
58 | if (soft_limit_fail_at && | ||
59 | !res_counter_soft_limit_check_locked(c)) | ||
60 | *soft_limit_fail_at = c; | ||
61 | spin_unlock(&c->lock); | 51 | spin_unlock(&c->lock); |
62 | if (ret < 0) { | 52 | if (ret < 0) { |
63 | *limit_fail_at = c; | 53 | *limit_fail_at = c; |
@@ -85,8 +75,7 @@ void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val) | |||
85 | counter->usage -= val; | 75 | counter->usage -= val; |
86 | } | 76 | } |
87 | 77 | ||
88 | void res_counter_uncharge(struct res_counter *counter, unsigned long val, | 78 | void res_counter_uncharge(struct res_counter *counter, unsigned long val) |
89 | bool *was_soft_limit_excess) | ||
90 | { | 79 | { |
91 | unsigned long flags; | 80 | unsigned long flags; |
92 | struct res_counter *c; | 81 | struct res_counter *c; |
@@ -94,9 +83,6 @@ void res_counter_uncharge(struct res_counter *counter, unsigned long val, | |||
94 | local_irq_save(flags); | 83 | local_irq_save(flags); |
95 | for (c = counter; c != NULL; c = c->parent) { | 84 | for (c = counter; c != NULL; c = c->parent) { |
96 | spin_lock(&c->lock); | 85 | spin_lock(&c->lock); |
97 | if (was_soft_limit_excess) | ||
98 | *was_soft_limit_excess = | ||
99 | !res_counter_soft_limit_check_locked(c); | ||
100 | res_counter_uncharge_locked(c, val); | 86 | res_counter_uncharge_locked(c, val); |
101 | spin_unlock(&c->lock); | 87 | spin_unlock(&c->lock); |
102 | } | 88 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index ee61f454a98b..1535f3884b88 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -780,7 +780,7 @@ static int sched_feat_open(struct inode *inode, struct file *filp) | |||
780 | return single_open(filp, sched_feat_show, NULL); | 780 | return single_open(filp, sched_feat_show, NULL); |
781 | } | 781 | } |
782 | 782 | ||
783 | static struct file_operations sched_feat_fops = { | 783 | static const struct file_operations sched_feat_fops = { |
784 | .open = sched_feat_open, | 784 | .open = sched_feat_open, |
785 | .write = sched_feat_write, | 785 | .write = sched_feat_write, |
786 | .read = seq_read, | 786 | .read = seq_read, |
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index fddd69d16e03..1b5b7aa2fdfd 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -275,7 +275,7 @@ static int timer_list_open(struct inode *inode, struct file *filp) | |||
275 | return single_open(filp, timer_list_show, NULL); | 275 | return single_open(filp, timer_list_show, NULL); |
276 | } | 276 | } |
277 | 277 | ||
278 | static struct file_operations timer_list_fops = { | 278 | static const struct file_operations timer_list_fops = { |
279 | .open = timer_list_open, | 279 | .open = timer_list_open, |
280 | .read = seq_read, | 280 | .read = seq_read, |
281 | .llseek = seq_lseek, | 281 | .llseek = seq_lseek, |
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c index 4cde8b9c716f..ee5681f8d7ec 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c | |||
@@ -395,7 +395,7 @@ static int tstats_open(struct inode *inode, struct file *filp) | |||
395 | return single_open(filp, tstats_show, NULL); | 395 | return single_open(filp, tstats_show, NULL); |
396 | } | 396 | } |
397 | 397 | ||
398 | static struct file_operations tstats_fops = { | 398 | static const struct file_operations tstats_fops = { |
399 | .open = tstats_open, | 399 | .open = tstats_open, |
400 | .read = seq_read, | 400 | .read = seq_read, |
401 | .write = tstats_write, | 401 | .write = tstats_write, |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 9a72853a8f0a..1a7f6abd06bf 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1078,14 +1078,9 @@ static void ftrace_replace_code(int enable) | |||
1078 | failed = __ftrace_replace_code(rec, enable); | 1078 | failed = __ftrace_replace_code(rec, enable); |
1079 | if (failed) { | 1079 | if (failed) { |
1080 | rec->flags |= FTRACE_FL_FAILED; | 1080 | rec->flags |= FTRACE_FL_FAILED; |
1081 | if ((system_state == SYSTEM_BOOTING) || | 1081 | ftrace_bug(failed, rec->ip); |
1082 | !core_kernel_text(rec->ip)) { | 1082 | /* Stop processing */ |
1083 | ftrace_free_rec(rec); | 1083 | return; |
1084 | } else { | ||
1085 | ftrace_bug(failed, rec->ip); | ||
1086 | /* Stop processing */ | ||
1087 | return; | ||
1088 | } | ||
1089 | } | 1084 | } |
1090 | } while_for_each_ftrace_rec(); | 1085 | } while_for_each_ftrace_rec(); |
1091 | } | 1086 | } |
@@ -2608,19 +2603,17 @@ static int ftrace_convert_nops(struct module *mod, | |||
2608 | } | 2603 | } |
2609 | 2604 | ||
2610 | #ifdef CONFIG_MODULES | 2605 | #ifdef CONFIG_MODULES |
2611 | void ftrace_release(void *start, void *end) | 2606 | void ftrace_release_mod(struct module *mod) |
2612 | { | 2607 | { |
2613 | struct dyn_ftrace *rec; | 2608 | struct dyn_ftrace *rec; |
2614 | struct ftrace_page *pg; | 2609 | struct ftrace_page *pg; |
2615 | unsigned long s = (unsigned long)start; | ||
2616 | unsigned long e = (unsigned long)end; | ||
2617 | 2610 | ||
2618 | if (ftrace_disabled || !start || start == end) | 2611 | if (ftrace_disabled) |
2619 | return; | 2612 | return; |
2620 | 2613 | ||
2621 | mutex_lock(&ftrace_lock); | 2614 | mutex_lock(&ftrace_lock); |
2622 | do_for_each_ftrace_rec(pg, rec) { | 2615 | do_for_each_ftrace_rec(pg, rec) { |
2623 | if ((rec->ip >= s) && (rec->ip < e)) { | 2616 | if (within_module_core(rec->ip, mod)) { |
2624 | /* | 2617 | /* |
2625 | * rec->ip is changed in ftrace_free_rec() | 2618 | * rec->ip is changed in ftrace_free_rec() |
2626 | * It should not between s and e if record was freed. | 2619 | * It should not between s and e if record was freed. |
@@ -2652,9 +2645,7 @@ static int ftrace_module_notify(struct notifier_block *self, | |||
2652 | mod->num_ftrace_callsites); | 2645 | mod->num_ftrace_callsites); |
2653 | break; | 2646 | break; |
2654 | case MODULE_STATE_GOING: | 2647 | case MODULE_STATE_GOING: |
2655 | ftrace_release(mod->ftrace_callsites, | 2648 | ftrace_release_mod(mod); |
2656 | mod->ftrace_callsites + | ||
2657 | mod->num_ftrace_callsites); | ||
2658 | break; | 2649 | break; |
2659 | } | 2650 | } |
2660 | 2651 | ||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 45068269ebb1..c820b0310a12 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1393,7 +1393,7 @@ int trace_array_vprintk(struct trace_array *tr, | |||
1393 | 1393 | ||
1394 | int trace_vprintk(unsigned long ip, const char *fmt, va_list args) | 1394 | int trace_vprintk(unsigned long ip, const char *fmt, va_list args) |
1395 | { | 1395 | { |
1396 | return trace_array_printk(&global_trace, ip, fmt, args); | 1396 | return trace_array_vprintk(&global_trace, ip, fmt, args); |
1397 | } | 1397 | } |
1398 | EXPORT_SYMBOL_GPL(trace_vprintk); | 1398 | EXPORT_SYMBOL_GPL(trace_vprintk); |
1399 | 1399 | ||
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 7a7a9fd249a9..4a194f08f88c 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -34,6 +34,7 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) | |||
34 | struct trace_array *tr = branch_tracer; | 34 | struct trace_array *tr = branch_tracer; |
35 | struct ring_buffer_event *event; | 35 | struct ring_buffer_event *event; |
36 | struct trace_branch *entry; | 36 | struct trace_branch *entry; |
37 | struct ring_buffer *buffer; | ||
37 | unsigned long flags; | 38 | unsigned long flags; |
38 | int cpu, pc; | 39 | int cpu, pc; |
39 | const char *p; | 40 | const char *p; |
@@ -54,7 +55,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) | |||
54 | goto out; | 55 | goto out; |
55 | 56 | ||
56 | pc = preempt_count(); | 57 | pc = preempt_count(); |
57 | event = trace_buffer_lock_reserve(tr, TRACE_BRANCH, | 58 | buffer = tr->buffer; |
59 | event = trace_buffer_lock_reserve(buffer, TRACE_BRANCH, | ||
58 | sizeof(*entry), flags, pc); | 60 | sizeof(*entry), flags, pc); |
59 | if (!event) | 61 | if (!event) |
60 | goto out; | 62 | goto out; |
@@ -74,8 +76,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) | |||
74 | entry->line = f->line; | 76 | entry->line = f->line; |
75 | entry->correct = val == expect; | 77 | entry->correct = val == expect; |
76 | 78 | ||
77 | if (!filter_check_discard(call, entry, tr->buffer, event)) | 79 | if (!filter_check_discard(call, entry, buffer, event)) |
78 | ring_buffer_unlock_commit(tr->buffer, event); | 80 | ring_buffer_unlock_commit(buffer, event); |
79 | 81 | ||
80 | out: | 82 | out: |
81 | atomic_dec(&tr->data[cpu]->disabled); | 83 | atomic_dec(&tr->data[cpu]->disabled); |
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c index dd44b8768867..8d5c171cc998 100644 --- a/kernel/trace/trace_event_profile.c +++ b/kernel/trace/trace_event_profile.c | |||
@@ -31,7 +31,7 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event) | |||
31 | if (atomic_inc_return(&event->profile_count)) | 31 | if (atomic_inc_return(&event->profile_count)) |
32 | return 0; | 32 | return 0; |
33 | 33 | ||
34 | if (!total_profile_count++) { | 34 | if (!total_profile_count) { |
35 | buf = (char *)alloc_percpu(profile_buf_t); | 35 | buf = (char *)alloc_percpu(profile_buf_t); |
36 | if (!buf) | 36 | if (!buf) |
37 | goto fail_buf; | 37 | goto fail_buf; |
@@ -46,14 +46,19 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | ret = event->profile_enable(); | 48 | ret = event->profile_enable(); |
49 | if (!ret) | 49 | if (!ret) { |
50 | total_profile_count++; | ||
50 | return 0; | 51 | return 0; |
52 | } | ||
51 | 53 | ||
52 | kfree(trace_profile_buf_nmi); | ||
53 | fail_buf_nmi: | 54 | fail_buf_nmi: |
54 | kfree(trace_profile_buf); | 55 | if (!total_profile_count) { |
56 | free_percpu(trace_profile_buf_nmi); | ||
57 | free_percpu(trace_profile_buf); | ||
58 | trace_profile_buf_nmi = NULL; | ||
59 | trace_profile_buf = NULL; | ||
60 | } | ||
55 | fail_buf: | 61 | fail_buf: |
56 | total_profile_count--; | ||
57 | atomic_dec(&event->profile_count); | 62 | atomic_dec(&event->profile_count); |
58 | 63 | ||
59 | return ret; | 64 | return ret; |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 8c194de675b0..92672016da28 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -1052,8 +1052,9 @@ static void postfix_clear(struct filter_parse_state *ps) | |||
1052 | 1052 | ||
1053 | while (!list_empty(&ps->postfix)) { | 1053 | while (!list_empty(&ps->postfix)) { |
1054 | elt = list_first_entry(&ps->postfix, struct postfix_elt, list); | 1054 | elt = list_first_entry(&ps->postfix, struct postfix_elt, list); |
1055 | kfree(elt->operand); | ||
1056 | list_del(&elt->list); | 1055 | list_del(&elt->list); |
1056 | kfree(elt->operand); | ||
1057 | kfree(elt); | ||
1057 | } | 1058 | } |
1058 | } | 1059 | } |
1059 | 1060 | ||
diff --git a/kernel/trace/trace_hw_branches.c b/kernel/trace/trace_hw_branches.c index 23b63859130e..69543a905cd5 100644 --- a/kernel/trace/trace_hw_branches.c +++ b/kernel/trace/trace_hw_branches.c | |||
@@ -165,6 +165,7 @@ void trace_hw_branch(u64 from, u64 to) | |||
165 | struct ftrace_event_call *call = &event_hw_branch; | 165 | struct ftrace_event_call *call = &event_hw_branch; |
166 | struct trace_array *tr = hw_branch_trace; | 166 | struct trace_array *tr = hw_branch_trace; |
167 | struct ring_buffer_event *event; | 167 | struct ring_buffer_event *event; |
168 | struct ring_buffer *buf; | ||
168 | struct hw_branch_entry *entry; | 169 | struct hw_branch_entry *entry; |
169 | unsigned long irq1; | 170 | unsigned long irq1; |
170 | int cpu; | 171 | int cpu; |
@@ -180,7 +181,8 @@ void trace_hw_branch(u64 from, u64 to) | |||
180 | if (atomic_inc_return(&tr->data[cpu]->disabled) != 1) | 181 | if (atomic_inc_return(&tr->data[cpu]->disabled) != 1) |
181 | goto out; | 182 | goto out; |
182 | 183 | ||
183 | event = trace_buffer_lock_reserve(tr, TRACE_HW_BRANCHES, | 184 | buf = tr->buffer; |
185 | event = trace_buffer_lock_reserve(buf, TRACE_HW_BRANCHES, | ||
184 | sizeof(*entry), 0, 0); | 186 | sizeof(*entry), 0, 0); |
185 | if (!event) | 187 | if (!event) |
186 | goto out; | 188 | goto out; |
@@ -189,8 +191,8 @@ void trace_hw_branch(u64 from, u64 to) | |||
189 | entry->ent.type = TRACE_HW_BRANCHES; | 191 | entry->ent.type = TRACE_HW_BRANCHES; |
190 | entry->from = from; | 192 | entry->from = from; |
191 | entry->to = to; | 193 | entry->to = to; |
192 | if (!filter_check_discard(call, entry, tr->buffer, event)) | 194 | if (!filter_check_discard(call, entry, buf, event)) |
193 | trace_buffer_unlock_commit(tr, event, 0, 0); | 195 | trace_buffer_unlock_commit(buf, event, 0, 0); |
194 | 196 | ||
195 | out: | 197 | out: |
196 | atomic_dec(&tr->data[cpu]->disabled); | 198 | atomic_dec(&tr->data[cpu]->disabled); |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index f572f44c6e1e..ed17565826b0 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -486,16 +486,18 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) | |||
486 | hardirq ? 'h' : softirq ? 's' : '.')) | 486 | hardirq ? 'h' : softirq ? 's' : '.')) |
487 | return 0; | 487 | return 0; |
488 | 488 | ||
489 | if (entry->lock_depth < 0) | 489 | if (entry->preempt_count) |
490 | ret = trace_seq_putc(s, '.'); | 490 | ret = trace_seq_printf(s, "%x", entry->preempt_count); |
491 | else | 491 | else |
492 | ret = trace_seq_printf(s, "%d", entry->lock_depth); | 492 | ret = trace_seq_putc(s, '.'); |
493 | |||
493 | if (!ret) | 494 | if (!ret) |
494 | return 0; | 495 | return 0; |
495 | 496 | ||
496 | if (entry->preempt_count) | 497 | if (entry->lock_depth < 0) |
497 | return trace_seq_printf(s, "%x", entry->preempt_count); | 498 | return trace_seq_putc(s, '.'); |
498 | return trace_seq_putc(s, '.'); | 499 | |
500 | return trace_seq_printf(s, "%d", entry->lock_depth); | ||
499 | } | 501 | } |
500 | 502 | ||
501 | static int | 503 | static int |
@@ -883,7 +885,7 @@ static int trace_ctxwake_raw(struct trace_iterator *iter, char S) | |||
883 | trace_assign_type(field, iter->ent); | 885 | trace_assign_type(field, iter->ent); |
884 | 886 | ||
885 | if (!S) | 887 | if (!S) |
886 | task_state_char(field->prev_state); | 888 | S = task_state_char(field->prev_state); |
887 | T = task_state_char(field->next_state); | 889 | T = task_state_char(field->next_state); |
888 | if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n", | 890 | if (!trace_seq_printf(&iter->seq, "%d %d %c %d %d %d %c\n", |
889 | field->prev_pid, | 891 | field->prev_pid, |
@@ -918,7 +920,7 @@ static int trace_ctxwake_hex(struct trace_iterator *iter, char S) | |||
918 | trace_assign_type(field, iter->ent); | 920 | trace_assign_type(field, iter->ent); |
919 | 921 | ||
920 | if (!S) | 922 | if (!S) |
921 | task_state_char(field->prev_state); | 923 | S = task_state_char(field->prev_state); |
922 | T = task_state_char(field->next_state); | 924 | T = task_state_char(field->next_state); |
923 | 925 | ||
924 | SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid); | 926 | SEQ_PUT_HEX_FIELD_RET(s, field->prev_pid); |