]> sourceware.org Git - systemtap.git/commitdiff
Add the pattern for label probes in libraries
authorJosh Stone <jistone@redhat.com>
Fri, 28 Oct 2011 22:42:02 +0000 (15:42 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 28 Oct 2011 22:42:02 +0000 (15:42 -0700)
* tapsets.cxx (dwarf_derived_probe::register_patterns): Refactor so that
  all process[.library] variants get the same set of suffixes.
  (dwarf_derived_probe::register_function_and_statement_variants): Add
  the label pattern from here, just as .inline is done.

tapsets.cxx

index f3f37f880474b6ddeb1388e83f950302b7d755ee..1048dcde2a68cec990bb74bf99b58a2b6757d763 100644 (file)
@@ -4315,10 +4315,13 @@ dwarf_derived_probe::register_function_and_statement_variants(
 
   match_node *fv_root = root->bind_str(TOK_FUNCTION);
   register_function_variants(fv_root, dw, privilege);
-  // ROOT.function("STRING") always gets the .inline variant.
+  // ROOT.function("STRING") always gets the .inline and .label variants.
   fv_root->bind(TOK_INLINE)
     ->bind_privilege(privilege)
     ->bind(dw);
+  fv_root->bind_str(TOK_LABEL)
+    ->bind_privilege(privilege)
+    ->bind(dw);
 
   fv_root = root->bind_num(TOK_FUNCTION);
   register_function_variants(fv_root, dw, privilege);
@@ -4377,36 +4380,21 @@ dwarf_derived_probe::register_patterns(systemtap_session& s)
 
   register_function_and_statement_variants(s, root->bind(TOK_KERNEL), dw, pr_stapdev);
   register_function_and_statement_variants(s, root->bind_str(TOK_MODULE), dw, pr_stapdev);
-
   root->bind(TOK_KERNEL)->bind_num(TOK_STATEMENT)->bind(TOK_ABSOLUTE)
     ->bind(dw);
-  root->bind(TOK_KERNEL)->bind_str(TOK_FUNCTION)->bind_str(TOK_LABEL)
-    ->bind(dw);
-
-  root->bind_str(TOK_MODULE)->bind_str(TOK_FUNCTION)->bind_str(TOK_LABEL)
-    ->bind(dw);
-
-  register_function_and_statement_variants(s, root->bind_str(TOK_PROCESS), dw, pr_stapusr);
-  register_function_and_statement_variants(s, root->bind(TOK_PROCESS), dw, pr_stapusr);
-  register_function_and_statement_variants(s, root->bind_str(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw, pr_stapusr);
-  register_function_and_statement_variants(s, root->bind(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw, pr_stapusr);
-
-  root->bind_str(TOK_PROCESS)->bind_str(TOK_FUNCTION)->bind_str(TOK_LABEL)
-    ->bind_privilege(pr_stapusr)
-    ->bind(dw);
-  root->bind(TOK_PROCESS)->bind_str(TOK_FUNCTION)->bind_str(TOK_LABEL)
-    ->bind_privilege(pr_stapusr)
-    ->bind(dw);
 
-  register_sdt_variants(s, root->bind(TOK_PROCESS), dw);
-  register_sdt_variants(s, root->bind_str(TOK_PROCESS), dw);
-  register_sdt_variants(s, root->bind(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw);
-  register_sdt_variants(s, root->bind_str(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw);
-
-  register_plt_variants(s, root->bind(TOK_PROCESS), dw);
-  register_plt_variants(s, root->bind_str(TOK_PROCESS), dw);
-  register_plt_variants(s, root->bind(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw);
-  register_plt_variants(s, root->bind_str(TOK_PROCESS)->bind_str(TOK_LIBRARY), dw);
+  match_node* uprobes[] = {
+      root->bind(TOK_PROCESS),
+      root->bind_str(TOK_PROCESS),
+      root->bind(TOK_PROCESS)->bind_str(TOK_LIBRARY),
+      root->bind_str(TOK_PROCESS)->bind_str(TOK_LIBRARY),
+  };
+  for (size_t i = 0; i < sizeof(uprobes) / sizeof(*uprobes); ++i)
+    {
+      register_function_and_statement_variants(s, uprobes[i], dw, pr_stapusr);
+      register_sdt_variants(s, uprobes[i], dw);
+      register_plt_variants(s, uprobes[i], dw);
+    }
 }
 
 void
This page took 0.036242 seconds and 5 git commands to generate.