1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
18 #include "common/debug.h"
23 #include "common/Mutex.h"
25 #include "common/config.h"
27 #include <sys/types.h>
37 //cout << "start" << std::endl;
43 //generic_dout(0) << "** unable to open trace file " << filename << dendl;
46 //generic_dout(2) << "opened traced file '" << filename << "'" << dendl;
50 //cout << "first line is " << line << std::endl;
55 const char *Trace::peek_string(string &buf, const char *prefix)
57 //if (prefix) cout << "prefix '" << prefix << "' line '" << line << "'" << std::endl;
59 strstr(line.c_str(), "/prefix") == line.c_str()) {
62 buf.append(line.c_str() + strlen("/prefix"));
70 const char *Trace::get_string(string &buf, const char *prefix)
72 peek_string(buf, prefix);
74 //cout << "buf is " << buf << std::endl;
75 // read next line (and detect eof early)
78 //cout << "next line is " << line << std::endl;