if (fd < 0) return fd;
for (unsigned i=0; i<chunks; i++) {
- if (time_to_stop()) break;
+ if (time_to_stop()) {
+ dout(0) << "stopping" << endl;
+ break;
+ }
dout(2) << "writing block " << i << "/" << chunks << endl;
// fill buf with a fingerprint
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]);
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)
return r;
}
- {
+ /*{
char name[80];
sprintf(name,"osd%d.fakestore.threadpool", whoami);
fsync_threadpool = new ThreadPool<FakeStore, pair<int,Context*> >(name, g_conf.fakestore_syncthreads,
(void (*)(FakeStore*, pair<int,Context*>*))dofsync,
this);
- }
+ }*/
// all okay.
return 0;
// close collections db files
//close_collections();
- delete fsync_threadpool;
+ //delete fsync_threadpool;
// nothing
return 0;
///////////
-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;
-}
+}*/
////
onsafe);
::close(fd);
} else {
- queue_fsync(fd, onsafe);
+ assert(0); //queue_fsync(fd, onsafe);
}
} else {
::close(fd);
#include <ext/hash_map>
using namespace __gnu_cxx;
+
// fake attributes in memory, if we need to.
void wipe_dir(string mydir);
+ /*
// async fsync
class ThreadPool<class FakeStore, pair<int, class Context*> > *fsync_threadpool;
void queue_fsync(int fd, class Context *c) {
f->do_fsync(af->first, af->second);
delete af;
}
-
+ */
public:
FakeStore(char *base, int whoami);
#include "../../uofs/uofs.h"
}
+#include "common/Timer.h"
+
#include "include/types.h"
#include <unistd.h>
#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)
{
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<bufferptr>::iterator p = bl.buffers().begin();
p != bl.buffers().end();
p++) {
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;
}
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));
--- /dev/null
+#!/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 = <I>;
+ chomp($k);
+ my @k = split(/\s+/,$k);
+ shift @k;
+
+ my $s;
+ while (<I>) {
+ 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";
+}
$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;