diff options
Diffstat (limited to 'arch/arm/common/bL_switcher.c')
-rw-r--r-- | arch/arm/common/bL_switcher.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c index 7002de360d23..f0dc025077d5 100644 --- a/arch/arm/common/bL_switcher.c +++ b/arch/arm/common/bL_switcher.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/notifier.h> | 27 | #include <linux/notifier.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/smp.h> | ||
30 | #include <linux/spinlock.h> | 31 | #include <linux/spinlock.h> |
31 | #include <linux/string.h> | 32 | #include <linux/string.h> |
32 | #include <linux/sysfs.h> | 33 | #include <linux/sysfs.h> |
@@ -531,6 +532,25 @@ static int bL_switcher_halve_cpus(void) | |||
531 | return 0; | 532 | return 0; |
532 | } | 533 | } |
533 | 534 | ||
535 | static void bL_switcher_trace_trigger_cpu(void *__always_unused info) | ||
536 | { | ||
537 | trace_cpu_migrate_current(get_ns(), read_mpidr()); | ||
538 | } | ||
539 | |||
540 | static int bL_switcher_trace_trigger(void) | ||
541 | { | ||
542 | int ret; | ||
543 | |||
544 | preempt_disable(); | ||
545 | |||
546 | bL_switcher_trace_trigger_cpu(NULL); | ||
547 | ret = smp_call_function(bL_switcher_trace_trigger_cpu, NULL, true); | ||
548 | |||
549 | preempt_enable(); | ||
550 | |||
551 | return ret; | ||
552 | } | ||
553 | |||
534 | static int bL_switcher_enable(void) | 554 | static int bL_switcher_enable(void) |
535 | { | 555 | { |
536 | int cpu, ret; | 556 | int cpu, ret; |
@@ -553,6 +573,8 @@ static int bL_switcher_enable(void) | |||
553 | if (ret) | 573 | if (ret) |
554 | goto error; | 574 | goto error; |
555 | 575 | ||
576 | bL_switcher_trace_trigger(); | ||
577 | |||
556 | for_each_online_cpu(cpu) { | 578 | for_each_online_cpu(cpu) { |
557 | struct bL_thread *t = &bL_threads[cpu]; | 579 | struct bL_thread *t = &bL_threads[cpu]; |
558 | spin_lock_init(&t->lock); | 580 | spin_lock_init(&t->lock); |
@@ -637,6 +659,8 @@ static void bL_switcher_disable(void) | |||
637 | } | 659 | } |
638 | 660 | ||
639 | bL_switcher_restore_cpus(); | 661 | bL_switcher_restore_cpus(); |
662 | bL_switcher_trace_trigger(); | ||
663 | |||
640 | bL_activation_notify(BL_NOTIFY_POST_DISABLE); | 664 | bL_activation_notify(BL_NOTIFY_POST_DISABLE); |
641 | 665 | ||
642 | out: | 666 | out: |
@@ -670,11 +694,23 @@ static ssize_t bL_switcher_active_store(struct kobject *kobj, | |||
670 | return (ret >= 0) ? count : ret; | 694 | return (ret >= 0) ? count : ret; |
671 | } | 695 | } |
672 | 696 | ||
697 | static ssize_t bL_switcher_trace_trigger_store(struct kobject *kobj, | ||
698 | struct kobj_attribute *attr, const char *buf, size_t count) | ||
699 | { | ||
700 | int ret = bL_switcher_trace_trigger(); | ||
701 | |||
702 | return ret ? ret : count; | ||
703 | } | ||
704 | |||
673 | static struct kobj_attribute bL_switcher_active_attr = | 705 | static struct kobj_attribute bL_switcher_active_attr = |
674 | __ATTR(active, 0644, bL_switcher_active_show, bL_switcher_active_store); | 706 | __ATTR(active, 0644, bL_switcher_active_show, bL_switcher_active_store); |
675 | 707 | ||
708 | static struct kobj_attribute bL_switcher_trace_trigger_attr = | ||
709 | __ATTR(trace_trigger, 0200, NULL, bL_switcher_trace_trigger_store); | ||
710 | |||
676 | static struct attribute *bL_switcher_attrs[] = { | 711 | static struct attribute *bL_switcher_attrs[] = { |
677 | &bL_switcher_active_attr.attr, | 712 | &bL_switcher_active_attr.attr, |
713 | &bL_switcher_trace_trigger_attr.attr, | ||
678 | NULL, | 714 | NULL, |
679 | }; | 715 | }; |
680 | 716 | ||