/** * @file oprof.c * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author John Levon <levon@movementarian.org> */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/oprofile.h> #include <linux/moduleparam.h> #include <linux/workqueue.h> #include <linux/time.h> #include <linux/mutex.h> #include "oprof.h" #include "event_buffer.h" #include "cpu_buffer.h" #include "buffer_sync.h" #include "oprofile_stats.h" struct oprofile_operations oprofile_ops; unsigned long oprofile_started; unsigned long oprofile_backtrace_depth; static unsigned long is_setup; static DEFINE_MUTEX(start_mutex); /* timer 0 - use performance monitoring hardware if available 1 - use the timer int mechanism regardless */ static int timer = 0;
int oprofile_setup(void) { int err; mutex_lock(&start_mutex); if ((err = alloc_cpu_buffers())) goto out; if ((err = alloc_event_buffer())) goto out1; if (oprofile_ops.setup && (err = oprofile_ops.setup())) goto out2; /* Note even though this starts part of the * profiling overhead, it's necessary to prevent * us missing task deaths and eventually oopsing * when trying to process the event buffer. */ if (oprofile_ops.sync_start) { int sync_ret = oprofile_ops.sync_start(); switch (sync_ret) { case 0: goto post_sync; case 1: goto do_generic; case -1: goto out3; default: goto out3; } } do_generic: if ((err = sync_start())) goto out3; post_sync: is_setup = 1; mutex_unlock(&start_mutex); return 0; out3: if (oprofile_ops.shutdown) oprofile_ops.shutdown(); out2: free_event_buffer(); out1: free_cpu_buffers(); out: mutex_unlock(&start_mutex); return err; }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
john levon | john levon | 108 | 64.67% | 2 | 40.00% |
bob nelson | bob nelson | 49 | 29.34% | 1 | 20.00% |
markus armbruster | markus armbruster | 6 | 3.59% | 1 | 20.00% |
greg banks | greg banks | 4 | 2.40% | 1 | 20.00% |
Total | 167 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
jason yeh | jason yeh | 15 | 68.18% | 1 | 33.33% |
robert richter | robert richter | 7 | 31.82% | 2 | 66.67% |
Total | 22 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
robert richter | robert richter | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
jason yeh | jason yeh | 21 | 70.00% | 1 | 50.00% |
robert richter | robert richter | 9 | 30.00% | 1 | 50.00% |
Total | 30 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
robert richter | robert richter | 93 | 100.00% | 1 | 100.00% |
Total | 93 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
robert richter | robert richter | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
robert richter | robert richter | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john levon | john levon | 65 | 89.04% | 2 | 40.00% |
markus armbruster | markus armbruster | 4 | 5.48% | 1 | 20.00% |
jason yeh | jason yeh | 3 | 4.11% | 1 | 20.00% |
greg banks | greg banks | 1 | 1.37% | 1 | 20.00% |
Total | 73 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john levon | john levon | 37 | 82.22% | 1 | 20.00% |
markus armbruster | markus armbruster | 4 | 8.89% | 1 | 20.00% |
robert richter | robert richter | 2 | 4.44% | 1 | 20.00% |
greg banks | greg banks | 1 | 2.22% | 1 | 20.00% |
jason yeh | jason yeh | 1 | 2.22% | 1 | 20.00% |
Total | 45 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
bob nelson | bob nelson | 42 | 49.41% | 1 | 20.00% |
john levon | john levon | 37 | 43.53% | 2 | 40.00% |
markus armbruster | markus armbruster | 4 | 4.71% | 1 | 20.00% |
greg banks | greg banks | 2 | 2.35% | 1 | 20.00% |
Total | 85 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john levon | john levon | 17 | 33.33% | 4 | 57.14% |
greg banks | greg banks | 17 | 33.33% | 1 | 14.29% |
robert richter | robert richter | 13 | 25.49% | 1 | 14.29% |
markus armbruster | markus armbruster | 4 | 7.84% | 1 | 14.29% |
Total | 51 | 100.00% | 7 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
robert richter | robert richter | 44 | 52.38% | 2 | 22.22% |
greg banks | greg banks | 24 | 28.57% | 2 | 22.22% |
martin schwidefsky | martin schwidefsky | 8 | 9.52% | 1 | 11.11% |
john levon | john levon | 4 | 4.76% | 2 | 22.22% |
will deacon | will deacon | 2 | 2.38% | 1 | 11.11% |
akinobu mita | akinobu mita | 2 | 2.38% | 1 | 11.11% |
Total | 84 | 100.00% | 9 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john levon | john levon | 12 | 60.00% | 2 | 40.00% |
robert richter | robert richter | 6 | 30.00% | 2 | 40.00% |
martin schwidefsky | martin schwidefsky | 2 | 10.00% | 1 | 20.00% |
Total | 20 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
john levon | john levon | 382 | 45.21% | 8 | 32.00% |
robert richter | robert richter | 230 | 27.22% | 8 | 32.00% |
bob nelson | bob nelson | 91 | 10.77% | 1 | 4.00% |
greg banks | greg banks | 52 | 6.15% | 2 | 8.00% |
jason yeh | jason yeh | 51 | 6.04% | 1 | 4.00% |
markus armbruster | markus armbruster | 24 | 2.84% | 1 | 4.00% |
martin schwidefsky | martin schwidefsky | 10 | 1.18% | 1 | 4.00% |
will deacon | will deacon | 2 | 0.24% | 1 | 4.00% |
akinobu mita | akinobu mita | 2 | 0.24% | 1 | 4.00% |
anton blanchard | anton blanchard | 1 | 0.12% | 1 | 4.00% |
Total | 845 | 100.00% | 25 | 100.00% |