/** * @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 | 108 | 64.67% | 2 | 40.00% |
Bob Nelson | 49 | 29.34% | 1 | 20.00% |
Markus Armbruster | 6 | 3.59% | 1 | 20.00% |
Greg Banks | 4 | 2.40% | 1 | 20.00% |
Total | 167 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Jason Yeh | 15 | 68.18% | 1 | 33.33% |
Robert Richter | 7 | 31.82% | 2 | 66.67% |
Total | 22 | 100.00% | 3 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Robert Richter | 14 | 100.00% | 1 | 100.00% |
Total | 14 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Jason Yeh | 21 | 70.00% | 1 | 50.00% |
Robert Richter | 9 | 30.00% | 1 | 50.00% |
Total | 30 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Robert Richter | 93 | 100.00% | 1 | 100.00% |
Total | 93 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Robert Richter | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Robert Richter | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Levon | 65 | 89.04% | 2 | 40.00% |
Markus Armbruster | 4 | 5.48% | 1 | 20.00% |
Jason Yeh | 3 | 4.11% | 1 | 20.00% |
Greg Banks | 1 | 1.37% | 1 | 20.00% |
Total | 73 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Levon | 37 | 82.22% | 1 | 20.00% |
Markus Armbruster | 4 | 8.89% | 1 | 20.00% |
Robert Richter | 2 | 4.44% | 1 | 20.00% |
Jason Yeh | 1 | 2.22% | 1 | 20.00% |
Greg Banks | 1 | 2.22% | 1 | 20.00% |
Total | 45 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Bob Nelson | 42 | 49.41% | 1 | 20.00% |
John Levon | 37 | 43.53% | 2 | 40.00% |
Markus Armbruster | 4 | 4.71% | 1 | 20.00% |
Greg Banks | 2 | 2.35% | 1 | 20.00% |
Total | 85 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Levon | 17 | 33.33% | 4 | 57.14% |
Greg Banks | 17 | 33.33% | 1 | 14.29% |
Robert Richter | 13 | 25.49% | 1 | 14.29% |
Markus Armbruster | 4 | 7.84% | 1 | 14.29% |
Total | 51 | 100.00% | 7 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Robert Richter | 44 | 52.38% | 2 | 22.22% |
Greg Banks | 24 | 28.57% | 2 | 22.22% |
Martin Schwidefsky | 8 | 9.52% | 1 | 11.11% |
John Levon | 4 | 4.76% | 2 | 22.22% |
Akinobu Mita | 2 | 2.38% | 1 | 11.11% |
Will Deacon | 2 | 2.38% | 1 | 11.11% |
Total | 84 | 100.00% | 9 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Levon | 12 | 60.00% | 2 | 40.00% |
Robert Richter | 6 | 30.00% | 2 | 40.00% |
Martin Schwidefsky | 2 | 10.00% | 1 | 20.00% |
Total | 20 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
John Levon | 382 | 45.21% | 8 | 32.00% |
Robert Richter | 230 | 27.22% | 8 | 32.00% |
Bob Nelson | 91 | 10.77% | 1 | 4.00% |
Greg Banks | 52 | 6.15% | 2 | 8.00% |
Jason Yeh | 51 | 6.04% | 1 | 4.00% |
Markus Armbruster | 24 | 2.84% | 1 | 4.00% |
Martin Schwidefsky | 10 | 1.18% | 1 | 4.00% |
Will Deacon | 2 | 0.24% | 1 | 4.00% |
Akinobu Mita | 2 | 0.24% | 1 | 4.00% |
Anton Blanchard | 1 | 0.12% | 1 | 4.00% |
Total | 845 | 100.00% | 25 | 100.00% |