diff options
author | Olof Johansson <olof@lixom.net> | 2014-07-19 18:03:08 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-19 18:03:08 -0400 |
commit | f37ac9e5a47d72eab5185b0ddc14dfc943cc9589 (patch) | |
tree | 53577aa529e3bbe718459d0626fc6d45ada3dcdd /kernel/trace/trace_uprobe.c | |
parent | 4338925434e4bf5ff714055713f3fb9b5fae9037 (diff) | |
parent | fc2cac41ebbfb16da8b036cba6ec6714ab780a6d (diff) |
Merge tag 'exynos-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc
Merge "Samsung exynos cpuidle update for v3.17" from Kukjin Kim:
- add callbacks exynos_suspend() and exynos_powered_up()
for support cpuidle through mcpm
- skip exynos_cpuidle for exynos5420 because is uses
cpuidle-big-liggle generic cpuidle driver
- add generic functions to calculate cpu number is used
for pmu and this is required for exynos5420 multi-cluster
- add of_device_id structure for big.LITTLE cpuidle and
add "samsung,exynos5420" compatible string for exynos5420
* tag 'exynos-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
ARM: EXYNOS: populate suspend and powered_up callbacks for mcpm
ARM: EXYNOS: do not allow cpuidle registration for exynos5420
cpuidle: big.LITTLE: init driver for exynos5420
cpuidle: big.LITTLE: Add ARCH_EXYNOS entry in config
ARM: EXYNOS: add generic function to calculate cpu number
cpuidle: big.LITTLE: add of_device_id structure
+ Linux 3.16-rc5
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
-rw-r--r-- | kernel/trace/trace_uprobe.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 04fdb5de823c..3c9b97e6b1f4 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
@@ -893,6 +893,9 @@ probe_event_enable(struct trace_uprobe *tu, struct ftrace_event_file *file, | |||
893 | int ret; | 893 | int ret; |
894 | 894 | ||
895 | if (file) { | 895 | if (file) { |
896 | if (tu->tp.flags & TP_FLAG_PROFILE) | ||
897 | return -EINTR; | ||
898 | |||
896 | link = kmalloc(sizeof(*link), GFP_KERNEL); | 899 | link = kmalloc(sizeof(*link), GFP_KERNEL); |
897 | if (!link) | 900 | if (!link) |
898 | return -ENOMEM; | 901 | return -ENOMEM; |
@@ -901,29 +904,40 @@ probe_event_enable(struct trace_uprobe *tu, struct ftrace_event_file *file, | |||
901 | list_add_tail_rcu(&link->list, &tu->tp.files); | 904 | list_add_tail_rcu(&link->list, &tu->tp.files); |
902 | 905 | ||
903 | tu->tp.flags |= TP_FLAG_TRACE; | 906 | tu->tp.flags |= TP_FLAG_TRACE; |
904 | } else | 907 | } else { |
905 | tu->tp.flags |= TP_FLAG_PROFILE; | 908 | if (tu->tp.flags & TP_FLAG_TRACE) |
909 | return -EINTR; | ||
906 | 910 | ||
907 | ret = uprobe_buffer_enable(); | 911 | tu->tp.flags |= TP_FLAG_PROFILE; |
908 | if (ret < 0) | 912 | } |
909 | return ret; | ||
910 | 913 | ||
911 | WARN_ON(!uprobe_filter_is_empty(&tu->filter)); | 914 | WARN_ON(!uprobe_filter_is_empty(&tu->filter)); |
912 | 915 | ||
913 | if (enabled) | 916 | if (enabled) |
914 | return 0; | 917 | return 0; |
915 | 918 | ||
919 | ret = uprobe_buffer_enable(); | ||
920 | if (ret) | ||
921 | goto err_flags; | ||
922 | |||
916 | tu->consumer.filter = filter; | 923 | tu->consumer.filter = filter; |
917 | ret = uprobe_register(tu->inode, tu->offset, &tu->consumer); | 924 | ret = uprobe_register(tu->inode, tu->offset, &tu->consumer); |
918 | if (ret) { | 925 | if (ret) |
919 | if (file) { | 926 | goto err_buffer; |
920 | list_del(&link->list); | ||
921 | kfree(link); | ||
922 | tu->tp.flags &= ~TP_FLAG_TRACE; | ||
923 | } else | ||
924 | tu->tp.flags &= ~TP_FLAG_PROFILE; | ||
925 | } | ||
926 | 927 | ||
928 | return 0; | ||
929 | |||
930 | err_buffer: | ||
931 | uprobe_buffer_disable(); | ||
932 | |||
933 | err_flags: | ||
934 | if (file) { | ||
935 | list_del(&link->list); | ||
936 | kfree(link); | ||
937 | tu->tp.flags &= ~TP_FLAG_TRACE; | ||
938 | } else { | ||
939 | tu->tp.flags &= ~TP_FLAG_PROFILE; | ||
940 | } | ||
927 | return ret; | 941 | return ret; |
928 | } | 942 | } |
929 | 943 | ||
@@ -1201,12 +1215,6 @@ static int uprobe_dispatcher(struct uprobe_consumer *con, struct pt_regs *regs) | |||
1201 | 1215 | ||
1202 | current->utask->vaddr = (unsigned long) &udd; | 1216 | current->utask->vaddr = (unsigned long) &udd; |
1203 | 1217 | ||
1204 | #ifdef CONFIG_PERF_EVENTS | ||
1205 | if ((tu->tp.flags & TP_FLAG_TRACE) == 0 && | ||
1206 | !uprobe_perf_filter(&tu->consumer, 0, current->mm)) | ||
1207 | return UPROBE_HANDLER_REMOVE; | ||
1208 | #endif | ||
1209 | |||
1210 | if (WARN_ON_ONCE(!uprobe_cpu_buffer)) | 1218 | if (WARN_ON_ONCE(!uprobe_cpu_buffer)) |
1211 | return 0; | 1219 | return 0; |
1212 | 1220 | ||