]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 9 Jul 2005 17:17:37 +0000 (17:17 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Sat, 9 Jul 2005 17:17:37 +0000 (17:17 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@430 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/client/SyntheticClient.cc
ceph/client/Trace.cc
ceph/client/Trace.h

index 9e641c93f6e6dc89843fe9966ef8fe92a84a138f..cfb1780f067d5ab8af306e9eb389724628009efe 100644 (file)
@@ -61,7 +61,7 @@ int SyntheticClient::run()
          {
                int iarg1 = iargs.front();
                iargs.pop_front();
-               srand(time(0) + getpid());
+               srand(time(0) + getpid() + client->whoami);
                sleep(rand() % iarg1);
          }
          break;
@@ -179,7 +179,7 @@ int SyntheticClient::run()
          {
                string prefix = get_sarg();
                int iarg1 = iargs.front();  iargs.pop_front();
-               
+
                Trace t("traces/trace.openssh.lib");
 
                client->mkdir(prefix.c_str(), 0755);
index 0c2799d9192c62b301a7f5fe3198f77546ae047e..30d2a09af001705cd57161aa6a655ee6226459f7 100644 (file)
@@ -57,13 +57,13 @@ Trace::Trace(const char* f)
          cr.append(buf, r);
        }
        close(fd);
-
+       
        // copy
        tl->len = cr.length()+1;
-       tl->data = new char[cr.length()];
+       tl->data = new char[tl->len];
        memcpy(tl->data, cr.c_str(), cr.length());
        tl->data[tl->len-1] = '\n';
-       
+
        // index!
        int o = 0;
        while (o < tl->len) {
@@ -81,6 +81,7 @@ Trace::Trace(const char* f)
        dout(1) << "trace " << filename << " loaded with " << tl->tokens.size() << " tokens" << endl;
        traces[filename] = tl;
   }
+
   tl->ref++;
 
   trace_lock.Unlock();
index 9126b42c6637fa479fbc6ab696b516636fa1d8a8..83be10f48cba08fc9d0ab959bd32b2657b1b3cb5 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __CLIENT_TRACE_H
 #define __CLIENT_TRACE_H
 
+#include <cassert>
 #include <list>
 #include <string>
 using namespace std;
@@ -33,6 +34,7 @@ class Trace {
   char strings[10][200];
   int ns;
   const char *get_string(const char *prefix = 0) {
+       assert(_cur != _end);
        const char *s = *_cur;
        _cur++;
        if (prefix) {