* session.cxx (version_string): New method.
(version): Call it.
* hash.cxx (get_base_hash): Ditto.
// Copyright (C) Andrew Tridgell 2002 (original file)
-// Copyright (C) 2006-2011 Red Hat Inc. (systemtap changes)
+// Copyright (C) 2006-2014 Red Hat Inc. (systemtap changes)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
s.base_hash = new stap_hash();
stap_hash& h = *s.base_hash;
+ // Hash systemtap version
+ h.add("Systemtap version: ", s.version_string());
+
// Hash kernel release and arch.
h.add("Kernel Release: ", s.kernel_release);
h.add_path("Kernel Build Tree ", s.kernel_build_tree);
return s;
}
+
+string
+systemtap_session::version_string ()
+{
+ return _F("%s/%s, %s",
+ VERSION, dwfl_version(NULL), STAP_EXTENDED_VERSION);
+}
+
void
systemtap_session::version ()
{
- clog << _F("Systemtap translator/driver (version %s/%s, %s)\n"
+ clog << _F("Systemtap translator/driver (version %s)\n"
"Copyright (C) 2005-2014 Red Hat, Inc. and others\n"
"This is free software; see the source for copying conditions.",
- VERSION, dwfl_version(NULL), STAP_EXTENDED_VERSION) << endl;
+ version_string().c_str());
+
clog << _("enabled features:")
#ifdef HAVE_AVAHI
<< " AVAHI"
// command line parsing
int parse_cmdline (int argc, char * const argv []);
bool parse_cmdline_runtime (const std::string& opt_runtime);
+ std::string version_string ();
void version ();
void usage (int exitcode);
void check_options (int argc, char * const argv []);