summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroland <roland>2005-07-29 08:37:01 +0000
committerroland <roland>2005-07-29 08:37:01 +0000
commit7a053d3b5c117886a07d7a56a7a74ac6a50b6be2 (patch)
tree5dd1557b36edf0c005759ba7729b5647f833e7a2
parent44049283175b1b0c0355e226321b8ce6088434db (diff)
downloadsystemtap-steved-7a053d3b5c117886a07d7a56a7a74ac6a50b6be2.tar.gz
systemtap-steved-7a053d3b5c117886a07d7a56a7a74ac6a50b6be2.tar.xz
systemtap-steved-7a053d3b5c117886a07d7a56a7a74ac6a50b6be2.zip
2005-07-29 Roland McGrath <roland@redhat.com>
* tapsets.cxx: <libdw.h> -> <elfutils/libdw.h> * loc2c.c, loc2c.h: Likewise.
-rw-r--r--loc2c.h2
-rw-r--r--tapsets.cxx314
2 files changed, 158 insertions, 158 deletions
diff --git a/loc2c.h b/loc2c.h
index 15d89280..75467010 100644
--- a/loc2c.h
+++ b/loc2c.h
@@ -1,4 +1,4 @@
-#include <libdw.h>
+#include <elfutils/libdw.h>
struct obstack; /* Use <obstack.h> */
struct location; /* Opaque */
diff --git a/tapsets.cxx b/tapsets.cxx
index d60cb480..7b4b3f38 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -24,7 +24,7 @@
extern "C" {
#include <elfutils/libdwfl.h>
-#include <libdw.h>
+#include <elfutils/libdw.h>
#include <dwarf.h>
#include <elf.h>
#include <obstack.h>
@@ -54,13 +54,13 @@ struct be_derived_probe: public derived_probe
};
struct
-be_builder
+be_builder
: public derived_probe_builder
{
bool begin;
be_builder(bool b) : begin(b) {}
virtual void build(systemtap_session & sess,
- probe * base,
+ probe * base,
probe_point * location,
std::map<std::string, literal *> const & parameters,
vector<probe *> & results_to_expand_further,
@@ -72,7 +72,7 @@ be_builder
};
-void
+void
be_derived_probe::emit_registrations (translator_output* o, unsigned j)
{
if (begin)
@@ -81,7 +81,7 @@ be_derived_probe::emit_registrations (translator_output* o, unsigned j)
}
-void
+void
be_derived_probe::emit_deregistrations (translator_output* o, unsigned j)
{
if (!begin)
@@ -100,7 +100,7 @@ be_derived_probe::emit_probe_entries (translator_output* o, unsigned j)
o->newline() << "static void enter_" << j << "_" << i << " (void);";
o->newline() << "void enter_" << j << "_" << i << " () {";
- // While begin/end probes are executed single-threaded, we
+ // While begin/end probes are executed single-threaded, we
// still code defensively and use a per-cpu context.
o->newline(1) << "struct context* c = & contexts [smp_processor_id()];";
@@ -117,7 +117,7 @@ be_derived_probe::emit_probe_entries (translator_output* o, unsigned j)
o->newline() << "return;";
o->newline(-1) << "}";
o->newline();
-
+
o->newline() << "c->busy ++;";
o->newline() << "mb ();"; // for smp
o->newline() << "c->errorcount = 0;";
@@ -149,7 +149,7 @@ be_derived_probe::emit_probe_entries (translator_output* o, unsigned j)
// Dwarf derived probes.
// ------------------------------------------------------------------------
-template <typename OUT, typename IN> inline OUT
+template <typename OUT, typename IN> inline OUT
lex_cast(IN const & in)
{
stringstream ss;
@@ -179,10 +179,10 @@ dwflpp
string cu_name;
string function_name;
- string const default_name(char const * in,
+ string const default_name(char const * in,
char const * type)
{
- if (in)
+ if (in)
return in;
if (false && sess.verbose)
clog << "WARNING: no name found for " << type << endl;
@@ -200,7 +200,7 @@ dwflpp
assert(m);
module = m;
module_dwarf = NULL;
- module_name = default_name(dwfl_module_info(module, NULL,
+ module_name = default_name(dwfl_module_info(module, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL),
@@ -215,7 +215,7 @@ dwflpp
cu = c;
cu_name = default_name(dwarf_diename(c), "cu");
if (false && sess.verbose)
- clog << "focused on CU " << cu_name
+ clog << "focused on CU " << cu_name
<< ", in module " << module_name << endl;
}
@@ -223,11 +223,11 @@ dwflpp
{
assert(f);
function = f;
- function_name = default_name(dwarf_func_name(function),
+ function_name = default_name(dwarf_func_name(function),
"function");
if (false && sess.verbose)
- clog << "focused on function " << function_name
- << ", in CU " << cu_name
+ clog << "focused on function " << function_name
+ << ", in CU " << cu_name
<< ", module " << module_name << endl;
}
@@ -268,8 +268,8 @@ dwflpp
assert(module);
get_module_dwarf();
if (sess.verbose)
- clog << "module addr " << a
- << " + bias " << module_bias
+ clog << "module addr " << a
+ << " + bias " << module_bias
<< " -> global addr " << a + module_bias << endl;
return a + module_bias;
}
@@ -279,8 +279,8 @@ dwflpp
assert(module);
get_module_dwarf();
if (sess.verbose)
- clog << "global addr " << a
- << " - bias " << module_bias
+ clog << "global addr " << a
+ << " - bias " << module_bias
<< " -> module addr " << a - module_bias << endl;
return a - module_bias;
}
@@ -323,7 +323,7 @@ dwflpp
void dwflpp_assert(string desc, int rc)
{
if (rc != 0)
- throw semantic_error("dwfl failure (" + desc + "): "
+ throw semantic_error("dwfl failure (" + desc + "): "
+ dwfl_errmsg(rc));
}
@@ -337,7 +337,7 @@ dwflpp
cu(NULL),
function(NULL)
{}
-
+
void setup(bool kernel)
{
static const Dwfl_Callbacks proc_callbacks =
@@ -347,7 +347,7 @@ dwflpp
NULL,
NULL
};
-
+
static const Dwfl_Callbacks kernel_callbacks =
{
dwfl_linux_kernel_find_elf,
@@ -395,7 +395,7 @@ dwflpp
dwflpp_assert("getdwarf", off);
}
- void iterate_over_cus (int (*callback)(Dwarf_Die * die, void * arg),
+ void iterate_over_cus (int (*callback)(Dwarf_Die * die, void * arg),
void * data)
{
get_module_dwarf();
@@ -414,7 +414,7 @@ dwflpp
size_t cuhl;
Dwarf_Off noff;
while (dwarf_nextcu(dw, off, &noff, &cuhl, NULL, NULL, NULL) == 0)
- {
+ {
Dwarf_Die die_mem;
Dwarf_Die *die;
die = dwarf_offdie(dw, off + cuhl, &die_mem);
@@ -451,18 +451,18 @@ dwflpp
clog << "WARNING: cannot find low PC value for function " << function_name << endl;
return false;
}
-
+
if (dwarf_func_highpc(function, &hi) != 0)
{
if (sess.verbose)
clog << "WARNING: cannot find high PC value for function " << function_name << endl;
return false;
}
-
+
bool t = lo <= addr && addr <= hi;
if (sess.verbose)
clog << "function " << function_name << " = [" << lo << "," << hi << "] "
- << (t ? "contains " : "does not contain ")
+ << (t ? "contains " : "does not contain ")
<< " global addr " << addr << endl;
return t;
}
@@ -485,9 +485,9 @@ dwflpp
linep = dwarf_onesrcline(lines, line);
dwflpp_assert("lineaddr", dwarf_lineaddr(linep, &addr));
if (sess.verbose)
- clog << "line " << line
- << " of cu " << cu_name
- << " has module address " << addr
+ clog << "line " << line
+ << " of cu " << cu_name
+ << " has module address " << addr
<< " in " << module_name << endl;
return module_address_to_global(addr);
}
@@ -501,24 +501,24 @@ dwflpp
Dwarf_Die *scopes;
Dwarf_Die vardie;
- int nscopes = dwarf_getscopes (cu, pc, &scopes);
+ int nscopes = dwarf_getscopes (cu, pc, &scopes);
if (nscopes == 0)
{
- throw semantic_error ("unable to find any scopes containing "
+ throw semantic_error ("unable to find any scopes containing "
+ lex_cast<string>(pc)
+ " while searching for local '" + local + "'");
}
-
+
int declaring_scope = dwarf_getscopevar (scopes, nscopes,
- local.c_str(),
- 0, NULL, 0, 0,
- &vardie);
+ local.c_str(),
+ 0, NULL, 0, 0,
+ &vardie);
if (declaring_scope < 0)
{
throw semantic_error ("unable to find local '" + local + "'"
+ " near pc " + lex_cast<string>(pc));
}
-
+
Dwarf_Attribute fb_attr_mem, *fb_attr = NULL;
for (int inner = 0; inner < nscopes; ++inner)
{
@@ -538,23 +538,23 @@ dwflpp
}
if (sess.verbose)
- clog << "finding location for local '" << local
- << "' near address " << hex << "0x" << pc
- << ", module bias " << hex << "0x" << module_bias
+ clog << "finding location for local '" << local
+ << "' near address " << hex << "0x" << pc
+ << ", module bias " << hex << "0x" << module_bias
<< endl;
-
- Dwarf_Attribute attr_mem;
+
+ Dwarf_Attribute attr_mem;
if (dwarf_attr_integrate (&vardie, DW_AT_location, &attr_mem) == NULL)
throw semantic_error("failed to retrieve location "
"attribute for local '" + local + "'");
-
+
#define obstack_chunk_alloc malloc
#define obstack_chunk_free free
-
+
struct obstack pool;
- obstack_init (&pool);
+ obstack_init (&pool);
struct location *tail = NULL;
- struct location *head = c_translate_location (&pool, 1, module_bias,
+ struct location *head = c_translate_location (&pool, 1, module_bias,
&attr_mem, pc,
&tail, fb_attr);
@@ -563,35 +563,35 @@ dwflpp
"attribute for local '" + local + "'");
c_translate_fetch (&pool, 1, module_bias, &vardie,
- &attr_mem, &tail,
+ &attr_mem, &tail,
"THIS->__retvalue");
-
-
+
+
size_t bufsz = 1024;
char *buf = static_cast<char*>(malloc(bufsz));
assert(buf);
-
+
FILE *memstream = open_memstream (&buf, &bufsz);
assert(memstream);
-
+
bool deref = c_emit_location (memstream, head, 1);
-
+
fprintf(memstream, "goto out;\n");
if (deref)
{
- fprintf(memstream,
+ fprintf(memstream,
"deref_fault:\n"
" c->errorcount++; \n"
" goto out;\n\n");
}
-
+
fclose (memstream);
string result(buf);
free (buf);
return result;
}
-
-
+
+
~dwflpp()
{
@@ -613,17 +613,17 @@ static string TOK_LABEL("label");
static string TOK_RELATIVE("relative");
-enum
+enum
function_spec_type
- {
+ {
function_alone,
function_and_file,
- function_file_and_line
+ function_file_and_line
};
enum
-dwarf_probe_type
- {
+dwarf_probe_type
+ {
probe_address,
probe_function_return,
};
@@ -641,18 +641,18 @@ struct dwarf_derived_probe : public derived_probe
string module_name;
dwarf_probe_type type;
Dwarf_Addr addr;
-
+
// Pattern registration helpers.
- static void register_relative_variants(match_node * root,
+ static void register_relative_variants(match_node * root,
dwarf_builder * dw);
- static void register_statement_variants(match_node * root,
+ static void register_statement_variants(match_node * root,
dwarf_builder * dw);
- static void register_callee_variants(match_node * root,
+ static void register_callee_variants(match_node * root,
dwarf_builder * dw);
- static void register_function_and_statement_variants(match_node * root,
+ static void register_function_and_statement_variants(match_node * root,
dwarf_builder * dw);
static void register_patterns(match_node * root);
-
+
virtual void emit_registrations (translator_output * o, unsigned i);
virtual void emit_deregistrations (translator_output * o, unsigned i);
virtual void emit_probe_entries (translator_output * o, unsigned i);
@@ -660,7 +660,7 @@ struct dwarf_derived_probe : public derived_probe
};
// Helper struct to thread through the dwfl callbacks.
-struct
+struct
dwarf_query
{
dwarf_query(systemtap_session & sess,
@@ -673,38 +673,38 @@ dwarf_query
systemtap_session & sess;
// Parameter extractors.
- static bool has_null_param(map<string, literal *> const & params,
+ static bool has_null_param(map<string, literal *> const & params,
string const & k);
- static bool get_string_param(map<string, literal *> const & params,
+ static bool get_string_param(map<string, literal *> const & params,
string const & k, string & v);
- static bool get_number_param(map<string, literal *> const & params,
+ static bool get_number_param(map<string, literal *> const & params,
string const & k, long & v);
string pt_regs_member_for_regnum(uint8_t dwarf_regnum);
vector<derived_probe *> & results;
void add_kernel_probe(dwarf_probe_type type, Dwarf_Addr addr);
- void add_module_probe(string const & module,
+ void add_module_probe(string const & module,
dwarf_probe_type type, Dwarf_Addr addr);
bool has_kernel;
bool has_process;
bool has_module;
- string process_val;
- string module_val;
- string function_val;
+ string process_val;
+ string module_val;
+ string function_val;
bool has_function_str;
bool has_statement_str;
bool has_function_num;
bool has_statement_num;
- string statement_str_val;
- string function_str_val;
- long statement_num_val;
- long function_num_val;
+ string statement_str_val;
+ string function_str_val;
+ long statement_num_val;
+ long function_num_val;
bool has_callees;
- long callee_val;
+ long callee_val;
bool has_return;
@@ -726,12 +726,12 @@ dwarf_query
};
struct
-dwarf_builder
+dwarf_builder
: public derived_probe_builder
{
dwarf_builder() {}
virtual void build(systemtap_session & sess,
- probe * base,
+ probe * base,
probe_point * location,
std::map<std::string, literal *> const & parameters,
vector<probe *> & results_to_expand_further,
@@ -739,8 +739,8 @@ dwarf_builder
virtual ~dwarf_builder() {}
};
-bool
-dwarf_query::has_null_param(map<string, literal *> const & params,
+bool
+dwarf_query::has_null_param(map<string, literal *> const & params,
string const & k)
{
map<string, literal *>::const_iterator i = params.find(k);
@@ -749,8 +749,8 @@ dwarf_query::has_null_param(map<string, literal *> const & params,
return false;
}
-bool
-dwarf_query::get_string_param(map<string, literal *> const & params,
+bool
+dwarf_query::get_string_param(map<string, literal *> const & params,
string const & k, string & v)
{
map<string, literal *>::const_iterator i = params.find(k);
@@ -763,8 +763,8 @@ dwarf_query::get_string_param(map<string, literal *> const & params,
return true;
}
-bool
-dwarf_query::get_number_param(map<string, literal *> const & params,
+bool
+dwarf_query::get_number_param(map<string, literal *> const & params,
string const & k, long & v)
{
map<string, literal *>::const_iterator i = params.find(k);
@@ -780,15 +780,15 @@ dwarf_query::get_number_param(map<string, literal *> const & params,
}
-void
+void
dwarf_query::add_kernel_probe(dwarf_probe_type type,
Dwarf_Addr addr)
{
results.push_back(new dwarf_derived_probe(*this, "", type, addr));
}
-void
-dwarf_query::add_module_probe(string const & module,
+void
+dwarf_query::add_module_probe(string const & module,
dwarf_probe_type type,
Dwarf_Addr addr)
{
@@ -804,7 +804,7 @@ dwarf_query::dwarf_query(systemtap_session & sess,
vector<derived_probe *> & results)
: sess(sess),
results(results),
- base_probe(base_probe),
+ base_probe(base_probe),
base_loc(base_loc),
dw(dw)
{
@@ -823,26 +823,26 @@ dwarf_query::dwarf_query(systemtap_session & sess,
has_statement_num = get_number_param(params, TOK_STATEMENT, statement_num_val);
callee_val = 1;
- has_callees = (has_null_param(params, TOK_CALLEES) ||
+ has_callees = (has_null_param(params, TOK_CALLEES) ||
get_number_param(params, TOK_CALLEES, callee_val));
has_return = has_null_param(params, TOK_RETURN);
has_label = get_string_param(params, TOK_LABEL, label_val);
has_relative = get_number_param(params, TOK_RELATIVE, relative_val);
-
+
if (has_function_str)
spec_type = parse_function_spec(function_str_val);
else if (has_statement_str)
spec_type = parse_function_spec(statement_str_val);
-}
+}
function_spec_type
dwarf_query::parse_function_spec(string & spec)
{
string::const_iterator i = spec.begin(), e = spec.end();
-
+
function.clear();
file.clear();
line = 0;
@@ -857,8 +857,8 @@ dwarf_query::parse_function_spec(string & spec)
if (i == e)
{
if (sess.verbose)
- clog << "parsed '" << spec
- << "' -> func '" << function
+ clog << "parsed '" << spec
+ << "' -> func '" << function
<< "'" << endl;
return function_alone;
}
@@ -868,13 +868,13 @@ dwarf_query::parse_function_spec(string & spec)
while (i != e && *i != ':')
file += *i++;
-
+
if (i == e)
{
if (sess.verbose)
- clog << "parsed '" << spec
- << "' -> func '"<< function
- << "', file '" << file
+ clog << "parsed '" << spec
+ << "' -> func '"<< function
+ << "', file '" << file
<< "'" << endl;
return function_and_file;
}
@@ -886,9 +886,9 @@ dwarf_query::parse_function_spec(string & spec)
{
line = lex_cast<int>(string(i, e));
if (sess.verbose)
- clog << "parsed '" << spec
- << "' -> func '"<< function
- << "', file '" << file
+ clog << "parsed '" << spec
+ << "' -> func '"<< function
+ << "', file '" << file
<< "', line " << line << endl;
return function_file_and_line;
}
@@ -898,7 +898,7 @@ dwarf_query::parse_function_spec(string & spec)
}
bad:
- throw semantic_error("malformed specification '" + spec + "'",
+ throw semantic_error("malformed specification '" + spec + "'",
base_probe->tok);
}
@@ -906,17 +906,17 @@ dwarf_query::parse_function_spec(string & spec)
static void
query_statement(Dwarf_Addr stmt_addr, dwarf_query * q)
{
- // XXX: implement
+ // XXX: implement
if (q->has_relative)
- throw semantic_error("incomplete: do not know how to interpret .relative",
+ throw semantic_error("incomplete: do not know how to interpret .relative",
q->base_probe->tok);
- dwarf_probe_type ty = (((q->has_function_str || q->has_function_num) && q->has_return)
- ? probe_function_return
+ dwarf_probe_type ty = (((q->has_function_str || q->has_function_num) && q->has_return)
+ ? probe_function_return
: probe_address);
if (q->has_module)
- q->add_module_probe(q->dw.module_name,
+ q->add_module_probe(q->dw.module_name,
ty, q->dw.global_address_to_module(stmt_addr));
else
q->add_kernel_probe(ty, stmt_addr);
@@ -925,37 +925,37 @@ query_statement(Dwarf_Addr stmt_addr, dwarf_query * q)
static int
query_function(Dwarf_Func * func, void * arg)
{
-
+
dwarf_query * q = static_cast<dwarf_query *>(arg);
- // XXX: implement
+ // XXX: implement
if (q->has_callees)
- throw semantic_error("incomplete: do not know how to interpret .callees",
+ throw semantic_error("incomplete: do not know how to interpret .callees",
q->base_probe->tok);
if (q->has_label)
- throw semantic_error("incomplete: do not know how to interpret .label",
+ throw semantic_error("incomplete: do not know how to interpret .label",
q->base_probe->tok);
q->dw.focus_on_function(func);
if (q->has_statement_str || q->has_function_str)
- {
+ {
if (q->dw.function_name_matches(q->function))
{
// XXX: We assume addr is a global address here. Is it?
// XXX: This code is duplicated below, but it's important
// for performance reasons to test things in this order.
-
+
Dwarf_Addr addr;
if (!q->dw.function_entrypc(&addr))
{
if (q->sess.verbose)
- clog << "WARNING: cannot find entry PC for function "
+ clog << "WARNING: cannot find entry PC for function "
<< q->dw.function_name << endl;
return DWARF_CB_OK;
}
-
+
// If this function's name matches a function or statement
// pattern, we use its entry pc, but we do not abort iteration
// since there might be other functions matching the pattern.
@@ -969,12 +969,12 @@ query_function(Dwarf_Func * func, void * arg)
if (!q->dw.function_entrypc(&addr))
{
if (false && q->sess.verbose)
- clog << "WARNING: cannot find entry PC for function "
+ clog << "WARNING: cannot find entry PC for function "
<< q->dw.function_name << endl;
return DWARF_CB_OK;
}
-
- if (q->has_kernel
+
+ if (q->has_kernel
&& q->has_function_num
&& q->dw.function_includes_global_addr(q->function_num_val))
{
@@ -1003,7 +1003,7 @@ static int
query_cu (Dwarf_Die * cudie, void * arg)
{
dwarf_query * q = static_cast<dwarf_query *>(arg);
-
+
q->dw.focus_on_cu(cudie);
// If we have enough information in the pattern to skip a CU
@@ -1014,8 +1014,8 @@ query_cu (Dwarf_Die * cudie, void * arg)
&& (!q->dw.cu_name_matches(q->file)))
return DWARF_CB_OK;
- if (q->has_statement_str
- && (q->spec_type == function_file_and_line)
+ if (q->has_statement_str
+ && (q->spec_type == function_file_and_line)
&& q->dw.cu_name_matches(q->file))
{
// If we have a complete file:line statement
@@ -1064,11 +1064,11 @@ query_module (Dwfl_Module *mod __attribute__ ((unused)),
addr = q->function_num_val;
else
addr = q->function_num_val;
-
+
q->dw.focus_on_cu_containing_module_address(addr);
q->dw.iterate_over_functions(&query_function, q);
- }
- else
+ }
+ else
{
// Otherwise if we have a function("foo") or statement("foo")
// specifier, we have to scan over all the CUs looking for
@@ -1100,7 +1100,7 @@ var_expanding_copy_visitor
unsigned lval_depth;
Dwarf_Addr addr;
- var_expanding_copy_visitor(dwarf_query & q, Dwarf_Addr a)
+ var_expanding_copy_visitor(dwarf_query & q, Dwarf_Addr a)
: q(q), lval_depth(0), addr(a)
{}
@@ -1122,7 +1122,7 @@ var_expanding_copy_visitor
e->operand->visit (this);
--lval_depth;
}
-
+
void visit_assignment (assignment* e)
{
++lval_depth;
@@ -1153,7 +1153,7 @@ var_expanding_copy_visitor::visit_symbol (symbol *e)
{
if (is_in_lvalue())
{
- throw semantic_error("read-only special variable "
+ throw semantic_error("read-only special variable "
+ e->name + " used in lvalue", e->tok);
}
@@ -1174,7 +1174,7 @@ var_expanding_copy_visitor::visit_symbol (symbol *e)
n->function = fname;
n->referent = NULL;
provide <functioncall*> (this, n);
-
+
}
else
{
@@ -1183,7 +1183,7 @@ var_expanding_copy_visitor::visit_symbol (symbol *e)
}
-dwarf_derived_probe::dwarf_derived_probe (dwarf_query & q,
+dwarf_derived_probe::dwarf_derived_probe (dwarf_query & q,
string const & module_name,
dwarf_probe_type type,
Dwarf_Addr addr)
@@ -1197,7 +1197,7 @@ dwarf_derived_probe::dwarf_derived_probe (dwarf_query & q,
this->tok = q.base_probe->tok;
}
-void
+void
dwarf_derived_probe::register_relative_variants(match_node * root,
dwarf_builder * dw)
{
@@ -1210,7 +1210,7 @@ dwarf_derived_probe::register_relative_variants(match_node * root,
root->bind_num(TOK_RELATIVE)->bind(dw);
}
-void
+void
dwarf_derived_probe::register_statement_variants(match_node * root,
dwarf_builder * dw)
{
@@ -1219,14 +1219,14 @@ dwarf_derived_probe::register_statement_variants(match_node * root,
// .
// .return
// .label("foo")
-
+
register_relative_variants(root, dw);
register_relative_variants(root->bind(TOK_RETURN), dw);
register_relative_variants(root->bind_str(TOK_LABEL), dw);
}
-void
-dwarf_derived_probe::register_callee_variants(match_node * root,
+void
+dwarf_derived_probe::register_callee_variants(match_node * root,
dwarf_builder * dw)
{
// Here we match 3 forms:
@@ -1243,7 +1243,7 @@ dwarf_derived_probe::register_callee_variants(match_node * root,
register_statement_variants(root->bind_num(TOK_CALLEES), dw);
}
-void
+void
dwarf_derived_probe::register_function_and_statement_variants(match_node * root,
dwarf_builder * dw)
{
@@ -1254,7 +1254,7 @@ dwarf_derived_probe::register_function_and_statement_variants(match_node * root,
// .statement("foo")
// .statement(0xdeadbeef)
- register_callee_variants(root->bind_str(TOK_FUNCTION), dw);
+ register_callee_variants(root->bind_str(TOK_FUNCTION), dw);
register_callee_variants(root->bind_num(TOK_FUNCTION), dw);
register_statement_variants(root->bind_str(TOK_STATEMENT), dw);
register_statement_variants(root->bind_num(TOK_STATEMENT), dw);
@@ -1276,26 +1276,26 @@ dwarf_derived_probe::register_patterns(match_node * root)
register_function_and_statement_variants(root->bind_str(TOK_PROCESS), dw);
}
-static string
+static string
probe_entry_function_name(unsigned probenum)
{
return "dwarf_kprobe_" + lex_cast<string>(probenum) + "_enter";
}
-static string
+static string
probe_entry_struct_kprobe_name(unsigned probenum)
{
return "dwarf_kprobe_" + lex_cast<string>(probenum);
}
-void
+void
dwarf_derived_probe::emit_registrations (translator_output* o, unsigned probenum)
{
if (module_name.empty())
{
- o->newline() << probe_entry_struct_kprobe_name(probenum)
+ o->newline() << probe_entry_struct_kprobe_name(probenum)
<< ".addr = (void *) 0x" << hex << addr << ";";
- o->newline() << "rc = register_kprobe (&"
+ o->newline() << "rc = register_kprobe (&"
<< probe_entry_struct_kprobe_name(probenum)
<< ");";
}
@@ -1311,9 +1311,9 @@ dwarf_derived_probe::emit_registrations (translator_output* o, unsigned probenum
o->newline() << "else";
o->newline() << "{";
o->indent(1);
- o->newline() << probe_entry_struct_kprobe_name(probenum)
+ o->newline() << probe_entry_struct_kprobe_name(probenum)
<< ".addr = (void *) (mod->module_core + 0x" << hex << addr << ");";
- o->newline() << "rc = register_kprobe (&"
+ o->newline() << "rc = register_kprobe (&"
<< probe_entry_struct_kprobe_name(probenum)
<< ");";
o->indent(-1);
@@ -1323,20 +1323,20 @@ dwarf_derived_probe::emit_registrations (translator_output* o, unsigned probenum
}
}
-void
+void
dwarf_derived_probe::emit_deregistrations (translator_output* o, unsigned probenum)
{
o->newline();
- o->newline() << "unregister_kprobe (& "
+ o->newline() << "unregister_kprobe (& "
<< probe_entry_struct_kprobe_name(probenum)
- << ");";
+ << ");";
}
-void
+void
dwarf_derived_probe::emit_probe_entries (translator_output* o, unsigned probenum)
{
- // Construct a single entry function, and a struct kprobe pointing into
+ // Construct a single entry function, and a struct kprobe pointing into
// the entry function. The entry function will call the probe function.
o->newline();
o->newline() << "static int ";
@@ -1381,7 +1381,7 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, unsigned probenum
o->newline(-1) << "}" << endl;
o->newline();
- o->newline() << "static struct kprobe "
+ o->newline() << "static struct kprobe "
<< probe_entry_struct_kprobe_name(probenum)
<< "= {";
o->newline(1) << ".addr = 0x0, /* filled in during module init */" ;
@@ -1393,7 +1393,7 @@ dwarf_derived_probe::emit_probe_entries (translator_output* o, unsigned probenum
void
dwarf_builder::build(systemtap_session & sess,
- probe * base,
+ probe * base,
probe_point * location,
std::map<std::string, literal *> const & parameters,
vector<probe *> & results_to_expand_further,
@@ -1420,12 +1420,12 @@ dwarf_builder::build(systemtap_session & sess,
dw.focus_on_cu_containing_global_address(q.function_num_val);
dw.iterate_over_functions(&query_function, &q);
}
- else
+ else
{
// Otherwise we have module("foo"), kernel.statement("foo"), or
// kernel.function("foo"); in these cases we need to scan all
// the modules.
- assert((q.has_kernel && q.has_function_str) ||
+ assert((q.has_kernel && q.has_function_str) ||
(q.has_kernel && q.has_statement_str) ||
(q.has_module));
dw.iterate_over_modules(&query_module, &q);
@@ -1439,7 +1439,7 @@ dwarf_builder::build(systemtap_session & sess,
// Standard tapset registry.
// ------------------------------------------------------------------------
-void
+void
register_standard_tapsets(systemtap_session & s)
{
// Rudimentary binders for begin and end targets