~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/kernel/perf_event.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
560
560
        event->destroy = hw_perf_event_destroy;
561
561
 
562
562
        if (!atomic_inc_not_zero(&active_events)) {
563
 
                if (atomic_read(&active_events) > armpmu->num_events) {
564
 
                        atomic_dec(&active_events);
565
 
                        return -ENOSPC;
566
 
                }
567
 
 
568
563
                mutex_lock(&pmu_reserve_mutex);
569
564
                if (atomic_read(&active_events) == 0) {
570
565
                        err = armpmu_reserve_hardware();
588
583
static void armpmu_enable(struct pmu *pmu)
589
584
{
590
585
        /* Enable all of the perf events on hardware. */
591
 
        int idx;
 
586
        int idx, enabled = 0;
592
587
        struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
593
588
 
594
589
        if (!armpmu)
601
596
                        continue;
602
597
 
603
598
                armpmu->enable(&event->hw, idx);
 
599
                enabled = 1;
604
600
        }
605
601
 
606
 
        armpmu->start();
 
602
        if (enabled)
 
603
                armpmu->start();
607
604
}
608
605
 
609
606
static void armpmu_disable(struct pmu *pmu)
746
743
 
747
744
        tail = (struct frame_tail __user *)regs->ARM_fp - 1;
748
745
 
749
 
        while (tail && !((unsigned long)tail & 0x3))
 
746
        while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
 
747
               tail && !((unsigned long)tail & 0x3))
750
748
                tail = user_backtrace(tail, entry);
751
749
}
752
750