more clean up for getting numbers

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1273 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
anwleung 2007-03-21 00:14:04 +00:00
parent bebce27f52
commit ac3eab61e5
5 changed files with 8 additions and 52 deletions

View File

@ -428,7 +428,8 @@ int SyntheticClient::run()
case SYNCLIENT_MODE_READFILE:
{
string sarg1 = get_sarg(0);
//string sarg1 = get_sarg(0);
string sarg1 = "shared";
int iarg1 = iargs.front(); iargs.pop_front();
int iarg2 = iargs.front(); iargs.pop_front();
if (run_me())

View File

@ -140,17 +140,13 @@ void CInode::buffer_entry()
// were gonna get signaled when we start buffering
// plus i need to release the lock for anyone
// waiting for me to init
cout << "Buffer thread waiting on cond" << endl;
while (!batching)
buffer_cond.Wait(buffer_lock);
cout << "Buffer thread signaled" << endl;
// the sleep releases the lock and allows the dispatch
// to insert requests into the buffer
// sleep first, then serve cap
cout << "buffer thread sleeping to buffer" << endl;
buffer_cond.WaitInterval(buffer_lock, utime_t(5,0));
cout << "buffer thread awoke from interval sleep" << endl;
// now i've slept, make cap for users
list<uid_t> user_set;
@ -184,7 +180,6 @@ void CInode::buffer_entry()
for (set<MClientRequest *>::iterator ri = buffered_reqs.begin();
ri != buffered_reqs.end();
ri++) {
cout << "ABOUT TO PASS OFF THE REQUEST" << endl;
server->handle_client_open(*ri, this);
}
@ -193,7 +188,7 @@ void CInode::buffer_entry()
//turn batching off
batching = false;
}
cout << "Buffer thread about to unlock" << endl;
buffer_lock.Unlock();
cout << "<------buffer finish" << endl;
}

View File

@ -271,8 +271,6 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
mds->unix_groups_byhash[group.get_root_hash()] = group;
mds->unix_groups_map[my_group] = group.get_root_hash();
cout << "New group " << my_group
<< " created from user " << my_user << endl;
}
hash_t my_hash = mds->unix_groups_map[my_group];
@ -295,7 +293,6 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
mds->unix_groups_byhash[new_hash] = group;
mds->unix_groups_map[my_group] = new_hash;
cout << "User " << my_user << " added to group " << my_group << endl;
}
//get hash for gid
@ -305,10 +302,6 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
ext_cap->set_type(1);
cout << "Made new " << my_want << " capability for uid: "
<< ext_cap->get_uid() << ", group: " << ext_cap->get_gid()
<< ", for hash: " << ext_cap->get_user_hash()
<< " for inode: " << ext_cap->get_ino()<< endl;
}
// default no grouping
else {
@ -320,7 +313,7 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
ext_cap->set_id(mds->cap_id_count, mds->get_nodeid());
mds->cap_id_count++;
cout << "Made new " << my_want << " capability for uid: "
dout(3) << "Made new " << my_want << " capability for uid: "
<< ext_cap->get_uid() << " for inode: " << ext_cap->get_ino()<< endl;
utime_t sign_time_start = g_clock.now();
@ -344,7 +337,7 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) {
// we want to index based on mode, so we can cache more caps
// does the cached cap have the write mode?
else {
cout << "Got cached " << my_want << " capability for uid: "
dout(3) << "Got cached " << my_want << " capability for uid: "
<< ext_cap->get_uid() << " for inode: " << ext_cap->get_ino() << endl;
if (ext_cap->mode() < mode) {
ext_cap->set_mode(mode);

View File

@ -261,7 +261,6 @@ void Server::commit_request(MClientRequest *req,
void Server::handle_client_update(MClientUpdate *m)
{
hash_t my_hash = m->get_user_hash();
cout << "handle_client_update for " << my_hash << endl;
dout(3) << "handle_client_update for " << my_hash << endl;
MClientUpdateReply *reply = new MClientUpdateReply(my_hash, mds->unix_groups_byhash[my_hash].get_list());
@ -2411,9 +2410,6 @@ void Server::handle_client_openc(MClientRequest *req, CInode *diri)
assert(dn);
if (r == 1) {
cout << "openc for " << req->get_filepath() << " from uid:" <<
req->get_caller_uid() << " on client:" << req->get_client() <<
" with client inst " << req->get_client_inst() << endl;
// created.
// it's a file.
in->inode.mode = 0644; // FIXME req should have a umask
@ -2499,7 +2495,6 @@ void Server::handle_client_openc(MClientRequest *req, CInode *diri)
*/
}
else {
cout << "Not buffering the request" << endl;
//in->two_req_ago = in->one_req_ago;
//in->one_req_ago = open_req_time;
in->update_buffer_time(open_req_time);

View File

@ -476,11 +476,7 @@ inline bool OSD::verify_cap(ExtCap *cap) {
if (!cap_cache->prev_verified(cap->get_id())) {
// actually verify
utime_t justver_time_start = g_clock.now();
if (cap->verif_extcap(monmap->get_key())) {
utime_t justver_time_end = g_clock.now();
cout << "Just verification time " << justver_time_end - justver_time_start << endl;
// cache the verification
cap_cache->insert(cap);
}
@ -2985,7 +2981,6 @@ void OSD::op_read(MOSDOp *op)//, PG *pg)
//<< " in " << *pg
<< endl;
//utime_t read_time_start = g_clock.now();
utime_t read_time_start;
if (outstanding_updates.count(op->get_reqid()) != 0)
read_time_start = outstanding_updates[op->get_reqid()];
@ -3000,7 +2995,6 @@ void OSD::op_read(MOSDOp *op)//, PG *pg)
ExtCap *op_capability = op->get_capability();
assert(op_capability);
utime_t hash_time_start = g_clock.now();
// if using groups...do we know group?
if (op_capability->get_type() == UNIX_GROUP ||
op_capability->get_type() == BATCH) {
@ -3015,8 +3009,6 @@ void OSD::op_read(MOSDOp *op)//, PG *pg)
return;
}
}
utime_t hash_time_end = g_clock.now();
cout << "re Hash update time " << hash_time_end - hash_time_start << endl;
// check accesses are right
if (check_request(op, op_capability)) {
@ -3025,14 +3017,11 @@ void OSD::op_read(MOSDOp *op)//, PG *pg)
else
dout(3) << "Access permissions are incorrect" << endl;
utime_t verifcap_time_start = g_clock.now();
assert(verify_cap(op_capability));
utime_t verifcap_time_end = g_clock.now();
cout << "re Capability verif time " << verifcap_time_end - verifcap_time_start << endl;
}
}
utime_t sec_time_end = g_clock.now();
cout << "re Security time " << sec_time_end - sec_time_start << endl;
cout << "Read Security time " << sec_time_end - sec_time_start << endl;
long r = 0;
bufferlist bl;
@ -3361,8 +3350,6 @@ void OSD::op_modify(MOSDOp *op, PG *pg)
utime_t write_time_start;
if (outstanding_updates.count(op->get_reqid()) != 0) {
write_time_start = outstanding_updates[op->get_reqid()];
cout << "Using stored time " << write_time_start << " for request " <<
op->get_reqid() << endl;
}
else
write_time_start = g_clock.now();
@ -3397,7 +3384,6 @@ void OSD::op_modify(MOSDOp *op, PG *pg)
ExtCap *op_capability = op->get_capability();
assert(op_capability);
// if using groups...do we know group?
utime_t hash_time_start = g_clock.now();
if (op_capability->get_type() == UNIX_GROUP ||
op_capability->get_type() == BATCH) {
// check if user is in group
@ -3406,39 +3392,26 @@ void OSD::op_modify(MOSDOp *op, PG *pg)
// do we have group cached? if not, update group
// we will lose execution control here! re-gain on reply
if (user_groups.count(my_hash) == 0) {
cout << "Setting the time " << write_time_start <<
" for request " << op->get_reqid() << endl;
outstanding_updates[op->get_reqid()] = write_time_start;
update_group(op->get_client_inst(), my_hash, op);
return;
}
}
utime_t hash_time_end = g_clock.now();
cout << "wr Hash check time " << hash_time_end - hash_time_start << endl;
cout << "Hash time SO FAR " << hash_time_end - sec_time_start << endl;
utime_t perm_time_start = g_clock.now();
// check accesses are right
if (check_request(op, op_capability)) {
dout(3) << "Access permissions are correct" << endl;
}
else
dout(3) << "Access permissions are incorrect" << endl;
utime_t perm_time_end = g_clock.now();
cout << "wr Check permissions time " << perm_time_end - perm_time_start << endl;
cout << "Check permissions time SO FAR " << perm_time_end - sec_time_start << endl;
utime_t verif_time_start = g_clock.now();
assert(verify_cap(op_capability));
utime_t verif_time_end = g_clock.now();
cout << "wr Verif capability time " << verif_time_end - verif_time_start << endl;
cout << "Verification time SO FAR " << verif_time_end - sec_time_start << endl;
}
}
utime_t sec_time_end = g_clock.now();
cout << "Security time spent " << sec_time_end - sec_time_start << endl;
//cout << "Security write time spent " << sec_time_end - sec_time_start << endl;
// locked by someone else?
// for _any_ op type -- eg only the locker can unlock!
@ -3572,8 +3545,7 @@ void OSD::op_modify(MOSDOp *op, PG *pg)
utime_t write_time_end = g_clock.now();
if (op->get_op() == OSD_OP_WRITE &&
op->get_source().is_client())
cout << "Write time " << write_time_end - write_time_start << endl <<
"with write_time_end " << write_time_end << endl;
cout << "Write time " << write_time_end - write_time_start << endl;
}