summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2005-08-10 20:25:35 +0000
committerfche <fche>2005-08-10 20:25:35 +0000
commitc0de7a8dc7987f0d1648e36085d328e290217aaa (patch)
tree30fb0c170c2b88faee491fba295e4b498c901edc
parentb5d770200feba14d6a33ce472a4246faecf5aee8 (diff)
downloadsystemtap-steved-c0de7a8dc7987f0d1648e36085d328e290217aaa.tar.gz
systemtap-steved-c0de7a8dc7987f0d1648e36085d328e290217aaa.tar.xz
systemtap-steved-c0de7a8dc7987f0d1648e36085d328e290217aaa.zip
2005-08-10 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx: Correct hex/decimal misformatting of verbose messages. * main.cxx: Add formal "-h" and "-V" options. * stap.1.in: Document them.
-rw-r--r--ChangeLog6
-rw-r--r--main.cxx24
-rw-r--r--stap.1.in6
-rw-r--r--tapsets.cxx32
4 files changed, 34 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f5660ce..0553076a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2005-08-10 Frank Ch. Eigler <fche@elastic.org>
+ * tapsets.cxx: Correct hex/decimal misformatting of verbose messages.
+ * main.cxx: Add formal "-h" and "-V" options.
+ * stap.1.in: Document them.
+
+2005-08-10 Frank Ch. Eigler <fche@elastic.org>
+
* tapsets.cxx: Move around "focusing on ..." messages to print
them only for matching functions/modules.
(dwflpp ctor): Also add cu (source file) name to derived
diff --git a/main.cxx b/main.cxx
index 7e2a1ec9..390816af 100644
--- a/main.cxx
+++ b/main.cxx
@@ -30,14 +30,21 @@ using namespace std;
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
@@ -46,9 +53,11 @@ usage (systemtap_session& s)
<< " 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
@@ -123,11 +132,15 @@ main (int argc, char * const argv [])
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;
@@ -180,7 +193,6 @@ main (int argc, char * const argv [])
s.guru_mode = true;
break;
- case '?':
case 'h':
default:
usage (s);
diff --git a/stap.1.in b/stap.1.in
index dc421cdd..44359b68 100644
--- a/stap.1.in
+++ b/stap.1.in
@@ -56,6 +56,12 @@ prints a list of supported options.
.B \-v
Verbose mode. Produces more informative output.
.TP
+.B \-h
+Show help message.
+.TP
+.B \-V
+Show version message.
+.TP
.B \-k
Keep the temporary directory after all processing. This may be useful
in order to examine the generated C code, or to reuse the compiled
diff --git a/tapsets.cxx b/tapsets.cxx
index ac936d95..a7f3f241 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -220,12 +220,6 @@ dwflpp
function_name.clear();
function = NULL;
-
- if (false && sess.verbose)
- clog << "focused on module '" << module_name
- << "' = [" << hex << module_start
- << " ," << hex << module_end
- << "]" << endl;
}
@@ -240,10 +234,6 @@ dwflpp
// 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;
}
@@ -256,11 +246,6 @@ dwflpp
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;
}
@@ -426,16 +411,12 @@ dwflpp
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);
}
@@ -450,9 +431,6 @@ dwflpp
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;
@@ -473,8 +451,6 @@ dwflpp
{
assert(module);
assert(cu);
- if (false && sess.verbose)
- clog << "iterating over functions in CU " << cu_name << endl;
dwarf_getfuncs(cu, callback, data, 0);
}
@@ -598,8 +574,8 @@ dwflpp
*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;
}
@@ -1176,8 +1152,8 @@ query_module (Dwfl_Module *mod __attribute__ ((unused)),
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)
{