From 197a4d6270c59a00030a33735865262a157edc24 Mon Sep 17 00:00:00 2001 From: jistone Date: Thu, 28 Sep 2006 01:48:59 +0000 Subject: 2006-09-27 Josh Stone * session.h (struct systemtap_session): Add kernel_base_release to store the kernel version without the -NNN suffix. * main.cxx (main): Generate and use kernel_base_release. * parse.cxx (eval_pp_conditional): Use kernel_base_release. * tapsets.cxx (profile_derived_probe::profile_derived_probe): Use kernel_base_release. * tapsets.cxx (timer_builder::build): Support a wide variety of timer varients -- jiffies, s/sec, ms/msec, us/usec, ns/nsec, and hz. Use hrtimers automatically on kernels that have it. (timer_builder::register_patterns): Bind all of the new timer varients in one easy place. (register_standard_tapsets): Call timer_builder::register_patterns. (struct hrtimer_builder): Removed since timer_builder is generic. * stapprobes.5.in: Document new timer.* functionality. * tapsets.cxx (hrtimer_derived_probe_group::emit_probes): Add a shared global for the actual hrtimer resolution, _stp_hrtimer_res. (hrtimer_derived_probe_group::emit_module): Init _stp_hrtimer_res. (hrtimer_derived_probe::emit_interval): Limit intervals at a minimum to the hrtimer's actual resolution. (hrtimer_derived_probe::emit_probe_entries): Forward timers based on previous expiration instead of restarting relative. testsuite/ * buildok/fourteen.stp: Test new timer functionality. --- main.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 8f084024..12cca4c7 100644 --- a/main.cxx +++ b/main.cxx @@ -311,6 +311,8 @@ main (int argc, char * const argv []) << e << endl; } + s.kernel_base_release.assign(s.kernel_release, 0, s.kernel_release.find('-')); + // arguments parsed; get down to business @@ -366,9 +368,8 @@ main (int argc, char * const argv []) version_suffixes.push_back ("/" + kvr + "/" + arch); version_suffixes.push_back ("/" + kvr); // add kernel version (2.6.NN) + arch - string::size_type dash_index = kvr.find ('-'); - if (dash_index > 0 && dash_index != string::npos) { - kvr.erase(dash_index); + if (kvr != s.kernel_base_release) { + kvr = s.kernel_base_release; version_suffixes.push_back ("/" + kvr + "/" + arch); version_suffixes.push_back ("/" + kvr); } -- cgit