From c3c350c0cf2faf08350c94f559f0cf2bb966adad Mon Sep 17 00:00:00 2001 From: sage Date: Fri, 10 Feb 2006 05:27:26 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@600 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/client/SyntheticClient.cc | 5 ++- ceph/config.cc | 4 +- ceph/osd/FakeStore.cc | 12 +++--- ceph/osd/FakeStore.h | 4 +- ceph/osd/OBFSStore.cc | 16 ++++---- ceph/osd/OSD.cc | 2 +- ceph/script/comb.pl | 75 ++++++++++++++++++++++++++++++++++ ceph/script/runset.pl | 5 +++ 8 files changed, 103 insertions(+), 20 deletions(-) create mode 100755 ceph/script/comb.pl diff --git a/ceph/client/SyntheticClient.cc b/ceph/client/SyntheticClient.cc index b2072d38a04a0..cd4807641478b 100644 --- a/ceph/client/SyntheticClient.cc +++ b/ceph/client/SyntheticClient.cc @@ -660,7 +660,10 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize) // size is i if (fd < 0) return fd; for (unsigned i=0; i& args) else if (strcmp(args[i], "--fakestore") == 0) { g_conf.ebofs = 0; g_conf.osd_pg_bits = 5; - //g_conf.fake_osd_sync = 2; + g_conf.osd_maxthreads = 1; // fucking hell } else if (strcmp(args[i], "--fakestore_fsync") == 0) g_conf.fakestore_fsync = atoi(args[++i]); @@ -335,7 +335,7 @@ void parse_config_options(vector& args) else if (strcmp(args[i], "--obfs") == 0) { g_conf.uofs = 1; - //g_conf.fake_osd_sync = 2; + g_conf.osd_maxthreads = 1; // until feng merges joel's fixes } else if (strcmp(args[i], "--osd_mkfs") == 0) diff --git a/ceph/osd/FakeStore.cc b/ceph/osd/FakeStore.cc index 56a44c96c1b59..1e59ea979afbf 100644 --- a/ceph/osd/FakeStore.cc +++ b/ceph/osd/FakeStore.cc @@ -58,13 +58,13 @@ int FakeStore::mount() return r; } - { + /*{ char name[80]; sprintf(name,"osd%d.fakestore.threadpool", whoami); fsync_threadpool = new ThreadPool >(name, g_conf.fakestore_syncthreads, (void (*)(FakeStore*, pair*))dofsync, this); - } + }*/ // all okay. return 0; @@ -77,7 +77,7 @@ int FakeStore::umount() // close collections db files //close_collections(); - delete fsync_threadpool; + //delete fsync_threadpool; // nothing return 0; @@ -93,14 +93,14 @@ int FakeStore::statfs(struct statfs *buf) /////////// -void FakeStore::do_fsync(int fd, Context *c) +/*void FakeStore::do_fsync(int fd, Context *c) { ::fsync(fd); ::close(fd); dout(10) << "do_fsync finished on " << fd << " context " << c << endl; c->finish(0); delete c; -} +}*/ //// @@ -362,7 +362,7 @@ int FakeStore::write(object_t oid, onsafe); ::close(fd); } else { - queue_fsync(fd, onsafe); + assert(0); //queue_fsync(fd, onsafe); } } else { ::close(fd); diff --git a/ceph/osd/FakeStore.h b/ceph/osd/FakeStore.h index 037646958d0e1..76b20c28da1a9 100644 --- a/ceph/osd/FakeStore.h +++ b/ceph/osd/FakeStore.h @@ -15,6 +15,7 @@ using namespace std; #include using namespace __gnu_cxx; + // fake attributes in memory, if we need to. @@ -32,6 +33,7 @@ class FakeStore : public ObjectStore, void wipe_dir(string mydir); + /* // async fsync class ThreadPool > *fsync_threadpool; void queue_fsync(int fd, class Context *c) { @@ -43,7 +45,7 @@ class FakeStore : public ObjectStore, f->do_fsync(af->first, af->second); delete af; } - + */ public: FakeStore(char *base, int whoami); diff --git a/ceph/osd/OBFSStore.cc b/ceph/osd/OBFSStore.cc index 2962282f808a6..885c67eeaf1fc 100644 --- a/ceph/osd/OBFSStore.cc +++ b/ceph/osd/OBFSStore.cc @@ -5,6 +5,8 @@ extern "C" { #include "../../uofs/uofs.h" } +#include "common/Timer.h" + #include "include/types.h" #include @@ -21,7 +23,7 @@ extern "C" { #include "config.h" #undef dout -#define dout(l) if (l<=g_conf.debug) cout << "osd" << whoami << ".obfsstore " +#define dout(l) if (l<=g_conf.debug) cout << "osd" << whoami << ".obfs " OBFSStore::OBFSStore(int whoami, char *param, char *dev) { @@ -200,14 +202,12 @@ int OBFSStore::read(object_t oid, size_t len, int OBFSStore::write(object_t oid, size_t len, off_t offset, bufferlist& bl, bool fsync) { - int ret;//, sync = 0; + int ret = 0; //dout(0) << "calling write function!" << endl; //if (whoami == 0) // dout(0) << oid << " 0 " << len << " " << offset << " 101" << endl; - //if (fsync) sync = 1; - ret = 0; for (list::iterator p = bl.buffers().begin(); p != bl.buffers().end(); p++) { @@ -224,9 +224,7 @@ int OBFSStore::write(object_t oid, size_t len, int OBFSStore::write(object_t oid, size_t len, off_t offset, bufferlist& bl, Context *onflush) { - write(oid, len, offset, bl, false); - - g_timer.add_event_after((float)g_conf.uofs_fake_sync, - onsafe); - return 0; + int r = write(oid, len, offset, bl, false); + g_timer.add_event_after((float)g_conf.uofs_fake_sync, onflush); + return r; } diff --git a/ceph/osd/OSD.cc b/ceph/osd/OSD.cc index 581680e458a03..3e770208e0094 100644 --- a/ceph/osd/OSD.cc +++ b/ceph/osd/OSD.cc @@ -220,7 +220,7 @@ void OSD::lock_object(object_t oid) osd_lock.Lock(); if (object_lock.count(oid)) { Cond c; - dout(15) << "lock_object " << hex << oid << dec << " waiting as " << &c << endl; + dout(0) << "lock_object " << hex << oid << dec << " waiting as " << &c << endl; object_lock_waiters[oid].push_back(&c); c.Wait(osd_lock); assert(object_lock.count(oid)); diff --git a/ceph/script/comb.pl b/ceph/script/comb.pl new file mode 100755 index 0000000000000..0e4e63476504f --- /dev/null +++ b/ceph/script/comb.pl @@ -0,0 +1,75 @@ +#!/usr/bin/perl + +use strict; + +my $xaxis = shift @ARGV; +my @vars; +while (@ARGV) { + $_ = shift @ARGV; + last if ($_ eq '-'); + push(@vars, $_); +} +my @dirs; +while (@ARGV) { + $_ = shift @ARGV; + last if ($_ eq '-'); + push(@dirs, $_) if -d $_; +} +my @filt = @ARGV; +push( @filt, '.' ) unless @filt; + +print "#xaxis $xaxis +#vars @vars +#dirs @dirs +#filt @filt +"; + +sub load_sum { + my $fn = shift @_; + + open(I, "$fn"); + my $k = ; + chomp($k); + my @k = split(/\s+/,$k); + shift @k; + + my $s; + while () { + chomp; + s/^\#//; + next unless $_; + my @l = split(/\s+/,$_); + my $k = shift @l; + for my $f (@k) { + $s->{$k}->{$f} = shift @l; + } + } + return $s; +} + + +my %res; +my @key; +my %didkey; +for my $f (@filt) { + for my $d (@dirs) { + next if ($f ne '.' && $d !~ /$f/); + + my ($x) = $d =~ /$xaxis=(\d+)/; + + for my $v (@vars) { + my ($what, $field) = split(/\./, $v); + my $s = &load_sum("$d/sum.$what"); + + #print "\t$v"; + push( @{$res{$x}}, $s->{'avgval'}->{$field} ); + push( @key, "$f.$field" ) unless $didkey{"$f.$field"}; + $didkey{"$f.$field"} = 1; + } + } +} + +print join("\t", "#", @key) . "\n"; +for my $x (sort {$a <=> $b} keys %res) { + print join("\t", $x, @{$res{$x}}) . "\n"; +} diff --git a/ceph/script/runset.pl b/ceph/script/runset.pl index 17e6c5a6609c5..07cbe45f8c2cd 100755 --- a/ceph/script/runset.pl +++ b/ceph/script/runset.pl @@ -116,7 +116,12 @@ sub run { $c .= " --syn until $h->{'until'}" if $h->{'until'}; $c .= " --syn writefile $h->{'writefile_mb'} $h->{'writefile_size'}" if $h->{'writefile'}; $c .= ' ' . $h->{'custom'} if $h->{'custom'}; + + # HACKS + #$c .= " --osd_maxthreads 0" if $h->{'fs'} ne 'ebofs'; + $c .= " --log_name $fn"; + print "-> $c\n"; my $r; -- 2.39.5