From: sage Date: Sat, 9 Jul 2005 17:17:37 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v0.1~1951 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=57f7562e92b7dfdfed135d961575b0b8f72a035b;p=ceph.git *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@430 29311d96-e01e-0410-9327-a35deaab8ce9 --- diff --git a/ceph/client/SyntheticClient.cc b/ceph/client/SyntheticClient.cc index 9e641c93f6e6d..cfb1780f067d5 100644 --- a/ceph/client/SyntheticClient.cc +++ b/ceph/client/SyntheticClient.cc @@ -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); diff --git a/ceph/client/Trace.cc b/ceph/client/Trace.cc index 0c2799d9192c6..30d2a09af0017 100644 --- a/ceph/client/Trace.cc +++ b/ceph/client/Trace.cc @@ -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(); diff --git a/ceph/client/Trace.h b/ceph/client/Trace.h index 9126b42c6637f..83be10f48cba0 100644 --- a/ceph/client/Trace.h +++ b/ceph/client/Trace.h @@ -1,6 +1,7 @@ #ifndef __CLIENT_TRACE_H #define __CLIENT_TRACE_H +#include #include #include 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) {