307-mips_oprofile_fix.patch 900 B

1234567891011121314151617181920212223242526272829303132333435
  1. --- a/arch/mips/oprofile/op_model_mipsxx.c
  2. +++ b/arch/mips/oprofile/op_model_mipsxx.c
  3. @@ -298,6 +298,11 @@ static void reset_counters(void *arg)
  4. }
  5. }
  6. +static irqreturn_t mipsxx_perfcount_int(int irq, void *dev_id)
  7. +{
  8. + return mipsxx_perfcount_handler();
  9. +}
  10. +
  11. static int __init mipsxx_init(void)
  12. {
  13. int counters;
  14. @@ -374,6 +379,10 @@ static int __init mipsxx_init(void)
  15. save_perf_irq = perf_irq;
  16. perf_irq = mipsxx_perfcount_handler;
  17. + if (cp0_perfcount_irq >= 0)
  18. + return request_irq(cp0_perfcount_irq, mipsxx_perfcount_int,
  19. + IRQF_SHARED, "Perfcounter", save_perf_irq);
  20. +
  21. return 0;
  22. }
  23. @@ -381,6 +390,9 @@ static void mipsxx_exit(void)
  24. {
  25. int counters = op_model_mipsxx_ops.num_counters;
  26. + if (cp0_perfcount_irq >= 0)
  27. + free_irq(cp0_perfcount_irq, save_perf_irq);
  28. +
  29. counters = counters_per_cpu_to_total(counters);
  30. on_each_cpu(reset_counters, (void *)(long)counters, 1);