From 440d9b00db23a1cb4b150e19390b6a137bf40d06 Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Fri, 16 Sep 2011 16:18:09 -0400 Subject: [PATCH] PR 11441 - continue with unprivileged test suite Deprecate probe types discovered during testing to have no reasonable meaning: kernel.function(number).inline module(string).function(number).inline process.function(number).inline process.library(string).function(number).inline process(string).function(number).inline process(string).library(string).function(number).inline --- NEWS | 8 ++++++++ tapsets.cxx | 38 ++++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index 922e751b3..649d3a8c9 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,14 @@ and a positive number representing the timeout desired. The default behavior is to not automatically download the debuginfo. +- The following probe types are deprecated in release 1.7 and will be removed in release 1.8: + kernel.function(number).inline + module(string).function(number).inline + process.function(number).inline + process.library(string).function(number).inline + process(string).function(number).inline + process(string).library(string).function(number).inline + * What's new in version 1.6, 2011-07-25 - Security fixes for CVE-2011-2503: read instead of mmap to load modules, diff --git a/tapsets.cxx b/tapsets.cxx index 18329c010..23c29b695 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -414,7 +414,8 @@ struct dwarf_derived_probe: public derived_probe static void register_function_variants(match_node * root, dwarf_builder * dw, bool bind_unprivileged_p); - static void register_function_and_statement_variants(match_node * root, + static void register_function_and_statement_variants(systemtap_session& s, + match_node * root, dwarf_builder * dw, bool bind_unprivileged_p); static void register_patterns(systemtap_session& s); @@ -4164,9 +4165,6 @@ dwarf_derived_probe::register_function_variants(match_node * root, root ->bind_unprivileged(bind_unprivileged_p) ->bind(dw); - root->bind(TOK_INLINE) - ->bind_unprivileged(bind_unprivileged_p) - ->bind(dw); root->bind(TOK_CALL) ->bind_unprivileged(bind_unprivileged_p) ->bind(dw); @@ -4184,6 +4182,7 @@ dwarf_derived_probe::register_function_variants(match_node * root, void dwarf_derived_probe::register_function_and_statement_variants( + systemtap_session& s, match_node * root, dwarf_builder * dw, bool bind_unprivileged_p @@ -4196,8 +4195,23 @@ dwarf_derived_probe::register_function_and_statement_variants( // .statement("foo") // .statement(0xdeadbeef) - register_function_variants(root->bind_str(TOK_FUNCTION), dw, bind_unprivileged_p); - register_function_variants(root->bind_num(TOK_FUNCTION), dw, bind_unprivileged_p); + match_node *fv_root = root->bind_str(TOK_FUNCTION); + register_function_variants(fv_root, dw, bind_unprivileged_p); + // ROOT.function("STRING") always gets the .inline variant. + fv_root->bind(TOK_INLINE) + ->bind_unprivileged(bind_unprivileged_p) + ->bind(dw); + + fv_root = root->bind_num(TOK_FUNCTION); + register_function_variants(fv_root, dw, bind_unprivileged_p); + // ROOT.function(NUMBER).inline is deprecated in release 1.7 and removed thereafter. + if (strverscmp(s.compatible.c_str(), "1.7") <= 0) + { + fv_root->bind(TOK_INLINE) + ->bind_unprivileged(bind_unprivileged_p) + ->bind(dw); + } + register_statement_variants(root->bind_str(TOK_STATEMENT), dw, bind_unprivileged_p); register_statement_variants(root->bind_num(TOK_STATEMENT), dw, bind_unprivileged_p); } @@ -4211,8 +4225,8 @@ dwarf_derived_probe::register_patterns(systemtap_session& s) update_visitor *filter = new dwarf_cast_expanding_visitor(s, *dw); s.code_filters.push_back(filter); - register_function_and_statement_variants(root->bind(TOK_KERNEL), dw, false); - register_function_and_statement_variants(root->bind_str(TOK_MODULE), dw, false); + register_function_and_statement_variants(s, root->bind(TOK_KERNEL), dw, false); + register_function_and_statement_variants(s, root->bind_str(TOK_MODULE), dw, false); root->bind(TOK_KERNEL)->bind_num(TOK_STATEMENT)->bind(TOK_ABSOLUTE) ->bind(dw); @@ -4222,10 +4236,10 @@ dwarf_derived_probe::register_patterns(systemtap_session& s) root->bind_str(TOK_MODULE)->bind_str(TOK_FUNCTION)->bind_str(TOK_LABEL) ->bind(dw); - register_function_and_statement_variants(root->bind_str(TOK_PROCESS), dw, true); - register_function_and_statement_variants(root->bind(TOK_PROCESS), dw, true); - register_function_and_statement_variants(root->bind_str(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw, true); - register_function_and_statement_variants(root->bind(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw, true); + register_function_and_statement_variants(s, root->bind_str(TOK_PROCESS), dw, true); + register_function_and_statement_variants(s, root->bind(TOK_PROCESS), dw, true); + register_function_and_statement_variants(s, root->bind_str(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw, true); + register_function_and_statement_variants(s, root->bind(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw, true); root->bind_str(TOK_PROCESS)->bind_str(TOK_FUNCTION)->bind_str(TOK_LABEL) ->bind_unprivileged() -- 2.43.5