aboutsummaryrefslogtreecommitdiff
path: root/stage2
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2019-02-14 07:12:12 +0000
committerRob Austein <sra@hactrn.net>2019-02-14 07:12:12 +0000
commit6f702a880c0c8300385945afead0a8e8d8236adc (patch)
tree591f5458ccb21c85cbb569e53c6970bfb6c8d910 /stage2
parentd3a03cf27dab20ee49e2d245f6ca43c98c268cf8 (diff)
Debug.
Diffstat (limited to 'stage2')
-rwxr-xr-xstage211
1 files changed, 0 insertions, 11 deletions
diff --git a/stage2 b/stage2
deleted file mode 100755
index 01b67a8..0000000
--- a/stage2
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh -
-
-set -ex
-
-# We should now be running as a non-root user, set up the XiLinx license
-
-sudo install -o builder -g builder /cryptech-builder/Xilinx.lic $HOME/builder
-
-/cryptech-builder/ratinox license-user
-
-rm $HOME/builder
ing-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# $Id$
# 
# Copyright (C) 2010  Internet Systems Consortium ("ISC")
# 
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# 
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

# Use gnuplot to graph interesting data from gc_summary lines in rpkid logs.

import sys, os, time

class datapoint(object):

  outtype = os.getenv("OUTTYPE", "png")
  outname = os.getenv("OUTNAME", "")
  timefmt = os.getenv("TIMEFMT", "%T")
  pretend = os.getenv("PRETEND_EVERYTHING_CHANGED", False)
  threshold = int(os.getenv("THRESHOLD", "100"))

  raw = []
  filenames = []

  def __init__(self, filename, timestamp, process, count, typesig, line):
    self.filename = filename
    self.timestamp = timestamp
    self.process = process
    self.count = count
    self.typesig = typesig
    self.line = line
    self.key = "%s %s" % (filename, typesig)
    self.raw.append(self)
    if filename not in self.filenames:
      self.filenames.append(filename)

  def __cmp__(self, other):
    c = cmp(self.key, other.key)
    return c if c else cmp(self.timestamp, other.timestamp)

  @classmethod
  def plot(cls):

    print "# [%s] Looking for interesting records" % time.strftime("%T")
    changed = {}
    for i in cls.raw:
      if i.key not in changed:
        changed[i.key] = set()
      changed[i.key].add(i.count)
    if cls.pretend:
      changed = set(changed.iterkeys())
    else:
      changed = set(k for k, v in changed.iteritems() if max(v) - min(v) > cls.threshold)

    if not changed:
      print "# [%s] Apparently nothing worth reporting" % time.strftime("%T")
      print "print 'Nothing to plot'"
      return

    print "# [%s] Header" % time.strftime("%T")
    print "set xdata time"
    print "set timefmt '%Y-%m-%dT%H:%M:%S'"
    print "set format x '%s'" % cls.timefmt
    print "set key right bottom"
    if cls.outname:
      print "set terminal", cls.outtype
      print "set output '%s.%s'" % (cls.outname, cls.outtype)
      print "set term png size 1024,1024"
    print "plot", ", ".join("'-' using 1:2 with linespoints title '%s'" % i for i in changed)

    print "# [%s] Sorting" % time.strftime("%T")
    cls.raw.sort()

    key = None
    proc = None
    for i in cls.raw:
      if i.key not in changed:
        continue
      if key is not None and i.key != key:
        print "e"
      elif proc is not None and i.process != proc:
        print ""
      key = i.key
      proc = i.process
      print "#", i.key, i.line
      print i.timestamp, i.count
    print "e"
    if not cls.outname:
      print "pause mouse any"

for filename in sys.argv[1:]:
  print "# [%s] Reading %s" % (time.strftime("%T"), filename)
  for line in open(filename):
    if "gc_summary:" in line:
      word = line.split(None, 6)
      if word[4].isdigit() and word[5].startswith("(") and word[5].endswith(")"):
        datapoint(filename = filename,
                  timestamp = word[0] + "T" + word[1],
                  process   = word[2],
                  count     = int(word[4]),
                  typesig   = word[5],
                  line      = line.strip())
 
print "# [%s] Plotting" % time.strftime("%T")
datapoint.plot()