]> sourceware.org Git - systemtap.git/commitdiff
module cache hashing: add systemtap version string
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 7 May 2014 13:52:57 +0000 (09:52 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Wed, 7 May 2014 13:55:08 +0000 (09:55 -0400)
* session.cxx (version_string): New method.
  (version): Call it.
* hash.cxx (get_base_hash): Ditto.

hash.cxx
session.cxx
session.h

index 57f199eabdcda171986e42cc0254c00f767c4220..29475af3586b2881908dedd32834637b883e0d60 100644 (file)
--- a/hash.cxx
+++ b/hash.cxx
@@ -1,5 +1,5 @@
 // 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
@@ -139,6 +139,9 @@ get_base_hash (systemtap_session& s)
   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);
index 3b797cde7b105cf8cb3f03a0d6f9bb66b7bae2ac..363b60c639632b78384686903948dd03e4ad1f12 100644 (file)
@@ -423,13 +423,22 @@ systemtap_session::clone(const string& arch, const string& release)
   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"
index 5f9cee74bbca6dbeb72047b572f505d47b86bde1..e20d96ef3c0243c9e2c076ed4d14edf276d76a62 100644 (file)
--- a/session.h
+++ b/session.h
@@ -139,6 +139,7 @@ public:
   // 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 []);
This page took 0.033683 seconds and 5 git commands to generate.