void
-usage (systemtap_session& s)
+version ()
{
clog
<< "SystemTap translator/driver "
<< "(version " << VERSION << " built " << DATE << ")" << endl
<< "Copyright (C) 2005 Red Hat, Inc." << endl
<< "This is free software; see the source for copying conditions."
- << endl
+ << endl;
+}
+
+void
+usage (systemtap_session& s)
+{
+ version ();
+ clog
<< endl
<< "Usage: stap [options] FILE Run script in file."
<< endl
<< " or: stap [options] -e SCRIPT Run given script."
<< endl
<< endl
- << "Arguments:" << endl
+ << "Options:" << endl
<< " -- no more options after this" << endl
- << " -v verbose" << (s.verbose ? " [set]" : "")
+ << " -v verbose" << (s.verbose ? " [set]" : "") << endl
+ << " -h show help" << endl
+ << " -V show version" << endl
<< endl
<< " -k keep temporary directory" << endl
// << " -t test mode" << (s.test_mode ? " [set]" : "") << endl
while (true)
{
- int grc = getopt (argc, argv, "vp:I:e:o:tR:r:m:kg");
+ int grc = getopt (argc, argv, "hVvp:I:e:o:tR:r:m:kg");
if (grc < 0)
break;
switch (grc)
{
+ case 'V':
+ version ();
+ exit (0);
+
case 'v':
s.verbose = true;
break;
s.guru_mode = true;
break;
- case '?':
case 'h':
default:
usage (s);
function_name.clear();
function = NULL;
-
- if (false && sess.verbose)
- clog << "focused on module '" << module_name
- << "' = [" << hex << module_start
- << " ," << hex << module_end
- << "]" << endl;
}
// Reset existing pointers and names
function_name.clear();
function = NULL;
-
- if (false && sess.verbose)
- clog << "focused on CU '" << cu_name
- << "', in module '" << module_name << "'" << endl;
}
function = f;
function_name = default_name(dwarf_func_name(function),
"function");
-
- if (false && sess.verbose)
- clog << "focused on function '" << function_name
- << "', in CU '" << cu_name
- << "', module '" << module_name << "'" << endl;
}
void *),
void * data)
{
- if (false && sess.verbose)
- clog << "iterating over modules" << endl;
ptrdiff_t off = 0;
do
{
off = dwfl_getmodules (dwfl, callback, data, off);
}
while (off > 0);
- if (false && sess.verbose)
- clog << "finished iterating over modules" << endl;
dwflpp_assert("getdwarf", off);
}
return;
}
- if (false && sess.verbose)
- clog << "iterating over CUs in module " << module_name << endl;
-
Dwarf *dw = module_dwarf;
Dwarf_Off off = 0;
size_t cuhl;
{
assert(module);
assert(cu);
- if (false && sess.verbose)
- clog << "iterating over functions in CU " << cu_name << endl;
dwarf_getfuncs(cu, callback, data, 0);
}
*addr = line_addr;
if (sess.verbose)
clog << "function " << function_name
- << " entrypc: " << entrypc
- << " prologue-end: " << line_addr
+ << " entrypc: " << hex << entrypc
+ << " prologue-end: " << line_addr << dec
<< endl;
return true;
}
if (q->sess.verbose)
clog << "focused on module '" << q->dw.module_name
<< "' = [" << hex << q->dw.module_start
- << " ," << hex << q->dw.module_end
- << "]" << endl;
+ << "-" << q->dw.module_end
+ << ", bias " << q->dw.module_bias << "]" << dec << endl;
if (q->has_function_num || q->has_statement_num)
{